org.ceryle.xtm
Class XtmDocument

java.lang.Object
  extended by org.ceryle.xtm.XtmNode
      extended by org.ceryle.xtm.XtmDocument
All Implemented Interfaces:
Iterator, Constants

public class XtmDocument
extends XtmNode
implements Constants

Defines an XTM document, ie., a container for nodes representing an XTM document. This does not currently support <mergeMap>, nor correct generation of documents whose root element is not <topicMap>, nor multiple topic maps in the same document.

Since:
JDK1.3
Version:
$Id: XtmDocument.java,v 3.3 2007-06-15 12:10:34 altheim Exp $
Author:
Murray Altheim

Field Summary
 
Fields inherited from class org.ceryle.xtm.XtmNode
ASSOCIATION_NODE, BASENAME_NODE, BASENAMESTRING_NODE, COMMENT_NODE, DOCUMENT_NODE, GrpSep, GRPSEP, id, INSTANCEOF_NODE, MEMBER_NODE, MERGEMAP_NODE, NODE, NonType, NONTYPE, OCCURRENCE_NODE, PARAMETERS_NODE, PROCESSING_INSTRUCTION_NODE, RecSep, RECSEP, REFERENCE_NODE, RESOURCEDATA_NODE, RESOURCEREF_NODE, ROLESPEC_NODE, SCOPE_NODE, SUBJECTIDENTITY_NODE, SUBJECTINDICATORREF_NODE, TOPIC_NODE, TOPICMAP_NODE, TOPICREF_NODE, VARIANT_NODE, VARIANTNAME_NODE
 
Fields inherited from interface org.ceryle.util.Constants
Amp, AMP, Apos, APOS, APP_NAME, APP_VERSION_NAME, APP_VERSION_NUMBER, AT, BANG, BAR, BIT_dev, BIT_http, BIT_ignoreCom, BIT_merge, BIT_none, BIT_noPreload, BIT_simple, BIT_ui, BIT_unused1, BIT_unused2, BIT_unused3, BIT_validating, BIT_verbose, BIT_xcatalog, BIT_xlink, BIT_xmlnsAware, BIT_xsd, BROKB, BSlash, BSLASH, CERYLE_CREDITS_FILE, CERYLE_DATA_DIR, CERYLE_HIST_FILE, CERYLE_LICENSE_FILE, CERYLE_PREF_FILE, CERYLE_PROP, CERYLE_PROP_BASE, CERYLE_PROP_FILE, CERYLE_RSRC_DIR, CERYLE_THANKS_FILE, CFLEX, Colon, COLON, Comma, COMMA, CR, CRet, Dash, DASH, DEFAULT_DIRECTORY, DEVELOPER, DOLR, Dot, DOT, EIGHT, Ellip, EOF, EqQuot, EQUAL, Equals, False, FALSE, FileProt, Filesep, FileURL, Five, FIVE, FONTSIZES, Four, FOUR, FSchar, GCOL_PROP, GRAPH_PROP, GRAVE, GT, Hash, HASH, HOME_DIRECTORY, HOME_DIRECTORY_PATH, HOME_DIRECTORY_URL, HTML, HttpProt, HttpURL, INDENT, INDENT_0, INDENT_1, INDENT_10, INDENT_2, INDENT_3, INDENT_4, INDENT_5, INDENT_6, INDENT_7, INDENT_8, INDENT_9, INIT, LCURL, LCurly, LF, LFS, Localhost, LPAR, LParen, LS, LSBrkt, LSBrkt2, LSQB, LT, MT, NBSP, NEL, NINE, NL, NL20x, NLchar, No, Null, NULL, NULL_STATE, NumParams, One, ONE, Pathsep, Percent, PERO, PLUS, Prcnt, PS, QMark, QMARK, Quot, QUOT, RCURL, RCurly, RESOURCE_BUNDLE, RPAR, RParen, RSBrkt, RSBrkt2, RSQB, Semi, SEMI, SEVEN, SIX, Slash, SLASH, SP, SPACE, Stago, Star, STAR, Tab, TAB, Tee, Three, THREE, Tilde, TILDE, TM_PROP, True, TRUE, Two, TWO, Under, UNDER, URI, URL, VBar, WIKI_PROP, XNodePfx, XNodeURL, XtmExt, Yes, Zero, ZERO
 
Constructor Summary
XtmDocument(XtmProcessor xtmp)
          Minimal XtmDocument constructor with a reference to the XtmProcessor used to populate the document.
XtmDocument(XtmProcessor xtmp, String systemId)
          XtmDocument constructor with a reference to the XtmProcessor used to populate the document, a String systemId, an optional literal used in the system identifier of the DOCTYPE declaration when serialized as an XTM document.
XtmDocument(XtmProcessor xtmp, String systemId, String encoding)
          XtmDocument constructor with a reference to the XtmProcessor used to populate the document, and a String systemId, an optional literal used in the system identifier of the DOCTYPE declaration when serialized as an XTM document.
 
Method Summary
 void addComment(XtmComment comment, boolean addLine)
          Add the XtmComment comment as a comment to this XtmDocument.
 void addTopicMap(XtmTopicMap map)
          Adds a new topic map to this XtmDocument.
 String getName()
          Returns a String containing the name of this XTM element type.
 short getNodeType()
          A short integer indicating what type of node this is.
 String getSystemId()
          Return a String containing the system identifier for the XTM DTD, to be used in the DOCTYPE declaration of a serialized output.
 XtmProcessor getXtmProcessor()
          Returns the XtmProcessor used to populate this XtmDocument.
 boolean hasNext()
          Return a boolean indicating if an iteration of this node has more elements.
 Iterator iterator()
          Returns an Iterator for this XtmDocument's content.
 Object next()
          Returns the next object in the iteration.
 void remove()
          Removes from the Collection the element last returned by the iterator.
 void setEncoding(String encoding)
          Set the encoding for the XTM Declaration to the String encoding.
 void setSystemId(String systemId)
          Set the system identifier for the XTM DTD to the String systemId, to be used in the DOCTYPE declaration of a serialized output.
 
Methods inherited from class org.ceryle.xtm.XtmNode
addPI, getID, getPI, getPIs, removePI, setID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XtmDocument

public XtmDocument(XtmProcessor xtmp)
Minimal XtmDocument constructor with a reference to the XtmProcessor used to populate the document.


XtmDocument

public XtmDocument(XtmProcessor xtmp,
                   String systemId)
XtmDocument constructor with a reference to the XtmProcessor used to populate the document, a String systemId, an optional literal used in the system identifier of the DOCTYPE declaration when serialized as an XTM document.


XtmDocument

public XtmDocument(XtmProcessor xtmp,
                   String systemId,
                   String encoding)
XtmDocument constructor with a reference to the XtmProcessor used to populate the document, and a String systemId, an optional literal used in the system identifier of the DOCTYPE declaration when serialized as an XTM document. encoding is an optional String that will be used in the XML declaration's encoding attribute (unimplemented).

Method Detail

getXtmProcessor

public XtmProcessor getXtmProcessor()
Returns the XtmProcessor used to populate this XtmDocument.


getName

public String getName()
Returns a String containing the name of this XTM element type. The XtmDocument node type is not represented by an element (see <topicMap>).

Overrides:
getName in class XtmNode

getNodeType

public short getNodeType()
A short integer indicating what type of node this is. The named constants for this value are defined in the org.ceryle.XtmNode class.

Overrides:
getNodeType in class XtmNode

setSystemId

public void setSystemId(String systemId)
Set the system identifier for the XTM DTD to the String systemId, to be used in the DOCTYPE declaration of a serialized output.


getSystemId

public String getSystemId()
Return a String containing the system identifier for the XTM DTD, to be used in the DOCTYPE declaration of a serialized output.


setEncoding

public void setEncoding(String encoding)
Set the encoding for the XTM Declaration to the String encoding. UNIMPLEMENTED


addTopicMap

public void addTopicMap(XtmTopicMap map)
Adds a new topic map to this XtmDocument.


addComment

public void addComment(XtmComment comment,
                       boolean addLine)
Add the XtmComment comment as a comment to this XtmDocument.

Parameters:
comment - The XtmComment to be added to this XtmDocument.
addLine - Indicates whether a linefeed should precede the comment.

iterator

public Iterator iterator()
Returns an Iterator for this XtmDocument's content.


next

public Object next()
            throws NoSuchElementException
Returns the next object in the iteration.

Specified by:
next in interface Iterator
Overrides:
next in class XtmNode
Returns:
the next object in the iteration.
Throws:
NoSuchElementException - if there are no more elements in this iteration.

hasNext

public boolean hasNext()
Return a boolean indicating if an iteration of this node has more elements. This should be subclassed as appropriate.

Specified by:
hasNext in interface Iterator
Overrides:
hasNext in class XtmNode
Returns:
A boolean value indicating if the iteration has more elements.

remove

public void remove()
            throws UnsupportedOperationException
Removes from the Collection the element last returned by the iterator. This should be subclassed as appropriate if support is desired.

Specified by:
remove in interface Iterator
Overrides:
remove in class XtmNode
Throws:
UnsupportedOperationException - because this operation is unsupported.


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.