Modifier and Type | Field and Description |
---|---|
private static final boolean | DEBUG
Set true to monitor SAX events and similar diagnostic info. |
private static final int | ENTITY_FIELD_NAME
m_entities name offset. |
private static final int | ENTITY_FIELD_NOTATIONNAME
m_entities notation name offset. |
private static final int | ENTITY_FIELD_PUBLICID
m_entities public ID offset. |
private static final int | ENTITY_FIELD_SYSTEMID
m_entities system ID offset. |
private static final int | ENTITY_FIELDS_PER
Number of entries per record for m_entities. |
protected FastStringBuffer | m_chars
All the character content, including attribute values, are stored in this buffer. |
protected transient int | m_coalescedTextType
Type of coalesced text block. |
protected transient IntStack | m_contextIndexes
Namespace support, only relevent at construction time. |
protected SuballocatedIntVector | m_data
This vector holds offset and length data. |
protected SuballocatedIntVector | m_dataOrQName
Data or qualified name values, one array element for each node. |
protected boolean | m_endDocumentOccured
End document has been reached. |
private List | m_entities
Vector of entities. |
private static final String[] | m_fixednames
fixed dom-style names. |
protected Map | m_idAttributes
This table holds the ID string to node associations, for XML IDs. |
private IncrementalSAXSource | m_incrementalSAXSource
If we're building the model incrementally on demand, we need to be able to tell the source when to send us more data. |
protected transient boolean | m_insideDTD
We are inside the DTD. |
protected transient Locator | m_locator
The SAX Document locator |
protected transient IntStack | m_parents
The parent stack, needed only for construction. |
pack-priv boolean | |
protected transient Vector | m_prefixMappings
Namespace support, only relevent at construction time. |
protected transient int | m_previous
The current previous node, needed only for construction time. |
protected IntVector | m_sourceColumn
Made protected for access by SAX2RTFDTM. |
protected IntVector | m_sourceLine
Made protected for access by SAX2RTFDTM. |
protected StringVector | m_sourceSystemId
Made protected for access by SAX2RTFDTM. |
private transient String | m_systemId
The SAX Document system-id |
protected int | m_textPendingStart
The starting offset within m_chars for the text or CDATA_SECTION node currently being acumulated, or -1 if there is no text node in progress |
protected transient int | m_textType
Type of next characters() event within text block in prgress. |
protected boolean | m_useSourceLocationProperty
Describes whether information about document source location should be maintained or not. |
protected DTMStringPool | m_valuesOrPrefixes
pool of string values that come as strings. |
protected DTMTreeWalker | m_walker
Tree Walker for dispatchToEvents. |
Access | Constructor and Description |
---|---|
public | SAX2DTM(DTMManager
The DTMManager who owns this DTM. mgr, Source the JAXP 1.1 Source object for this DTM. source, int The DTM identity ID for this DTM. dtmIdentity, DTMWSFilter The white space filter for this DTM, which may
be null. whiteSpaceFilter, XMLStringFactory XMLString factory for creating character content. xstringfactory, boolean true if the caller considers it worth it to use
indexing schemes. doIndexing)Construct a SAX2DTM object using the default block size. |
public | SAX2DTM(DTMManager
The DTMManager who owns this DTM. mgr, Source the JAXP 1.1 Source object for this DTM. source, int The DTM identity ID for this DTM. dtmIdentity, DTMWSFilter The white space filter for this DTM, which may
be null. whiteSpaceFilter, XMLStringFactory XMLString factory for creating character content. xstringfactory, boolean true if the caller considers it worth it to use
indexing schemes. doIndexing, int The block size of the DTM. blocksize, boolean true if we want to build the previous sibling node array. usePrevsib, boolean true if we want to use a new ExpandedNameTable for this DTM. newNameTable)Construct a SAX2DTM object ready to be constructed from SAX2 ContentHandler events. |
Modifier and Type | Method and Description |
---|---|
protected int | Returns: The data or qualified name, or DTM.NULL.The node identity. identity)Get the data or qualified name for the given node identity. |
protected void | addNewDTMID(int
The node identity at which the new DTM ID will begin
addressing. nodeIndex)Get a new DTM ID beginning at the specified node index. |
protected int | Returns: The index identity of the node that was added.raw type ID, one of DTM.XXX_NODE. type, int The expended type ID. expandedTypeID, int The current parent index. parentIndex, int The previous sibling index. previousSibling, int index into m_data table, or string handle. dataOrPrefix, boolean true if the node can have a first child, false
if it is atomic. canHaveFirstChild)Construct the node map from the node. |
public void | attributeDecl(String
The name of the associated element. eName, String The name of the attribute. aName, String A string representing the attribute type. type, String A string representing the attribute default
("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
none of these applies. valueDefault, String A string representing the attribute's default value,
or null if there is none. value)Implements org. Report an attribute type declaration. |
public void | characters(char[]
The characters. ch, int The start position in the character array. start, int The number of characters to use from the
character array. length)Implements org. Receive notification of character data inside an element. |
protected void | charactersFlush()
Check whether accumulated text should be stripped; if not, append the appropriate flavor of text/cdata node. |
public void | |
public void | clearCoRoutine(boolean
true of doTerminate should be called on the
coRoutine parser. callDoTerminate)Ask the CoRoutine parser to doTerminate and clear the reference. |
public void | comment(char[]
An array holding the characters in the comment. ch, int The starting position in the array. start, int The number of characters to use from the array. length)Implements org. Report an XML comment anywhere in the document. |
protected boolean | Returns: true if the declaration has already been declared in the current context.non-null prefix string. prefix)Check if a declaration has already been made for a given prefix. |
public void | dispatchCharactersEvents(int
The node ID. nodeHandle, ContentHandler A non-null reference to a ContentHandler. ch, boolean true if the content should be normalized according to
the rules for the XPath
normalize-space
function. normalize)Implements abstract com. Implements com. Directly call the characters method on the passed ContentHandler for the string-value of the given node (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value). |
public void | dispatchToEvents(int
The node ID. nodeHandle, ContentHandler A non-null reference to a ContentHandler. ch)Implements abstract com. Implements com. Directly create SAX parser events from a subtree. |
public void | elementDecl(String
The element type name. name, String The content model as a normalized string. model)Implements org. Report an element type declaration. |
public void | |
public void | endDocument()
Implements org. Receive notification of the end of the document. |
public void | |
public void | endElement(String
The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed. uri, String The local name (without prefix), or the
empty string if Namespace processing is not being
performed. localName, String The qualified XML 1.0 name (with prefix), or the
empty string if qualified names are not available. qName)Implements org. Receive notification of the end of an element. |
public void | endEntity(String
The name of the entity that is ending. name)Implements org. Report the end of an entity. |
public void | endPrefixMapping(String
The Namespace prefix being declared. prefix)Implements org. Receive notification of the end of a Namespace mapping. |
public void | error(SAXParseException
The warning information encoded as an exception. e)Implements org. Receive notification of a recoverable parser error. |
public void | externalEntityDecl(String
The name of the entity. If it is a parameter
entity, the name will begin with '%'. name, String The declared public identifier of the entity, or
null if none was declared. publicId, String The declared system identifier of the entity. systemId)Implements org. Report a parsed external entity declaration. |
public void | fatalError(SAXParseException
The error information encoded as an exception. e)Implements org. Report a fatal XML parsing error. |
public int | Returns: The attribute node handle with the specified name (nodeName ) or DTM.NULL if there is no such
attribute.int Handle of the node upon which to look up this attribute.. nodeHandle, String The namespace URI of the attribute to
retrieve, or null. namespaceURI, String The local name of the attribute to
retrieve. name)Implements abstract com. Implements com. Retrieves an attribute node by by qualified name and namespace URI. |
public ContentHandler | Returns: null if this model doesn't respond to SAX events, "this" if the DTM object has a built-in SAX ContentHandler, the IncrementalSAXSource if we're bound to one and should receive the SAX stream via it for incremental build purposes... Note that IncrementalSAXSource_Filter is package private, hence it can be statically referenced using instanceof (CR 6537912).Implements com. getContentHandler returns "our SAX builder" -- the thing that someone else should send SAX events to in order to extend this DTM model. |
public DeclHandler | Returns: null if this model doesn't respond to SAX Decl events.Implements com. Return this DTM's DeclHandler. |
public String | Returns: the public identifier String object, or null if there is none.Implements abstract com. Implements com. Return the public identifier of the external subset, normalized as described in 4.2.2 External Entities [XML]. |
public String | Returns: the system identifier String object, or null if there is none.Implements abstract com. Implements com. A document type declaration information item has the following properties: 1. |
public DTDHandler | Returns: null if this model doesn't respond to SAX dtd events.Implements com. Return this DTM's DTDHandler. |
public int | Returns: The handle of the matching element.The unique elementId)id value for an element.Implements abstract com. Implements com. Returns the |
public EntityResolver | Returns: null if this model doesn't respond to SAX entity ref events.Implements com. Return this DTM's EntityResolver. |
public ErrorHandler | Returns: null if this model doesn't respond to SAX error events.Implements com. Return this DTM's ErrorHandler. |
public String | |
public int | Returns: The prefix if there is one, or null.The namespace URI, which may be null. uri)Get a prefix either from the uri mapping, or just make one up! |
public LexicalHandler | Returns: null if this model doesn't respond to lexical SAX events, "this" if the DTM object has a built-in SAX ContentHandler, the IncrementalSAXSource if we're bound to one and should receive the SAX stream via it for incremental build purposes... Note that IncrementalSAXSource_Filter is package private, hence it can be statically referenced using instanceof (CR 6537912).Implements com. Return this DTM's lexical handler. |
public String | Returns: String Local name of this node.the id of the node. nodeHandle)Implements abstract com. Implements com. Given a node handle, return its XPath-style localname. |
public String | Returns: String URI value of this node's namespace, or null if no namespace was resolved.the id of the node. nodeHandle)Implements abstract com. Implements com. Given a node handle, return its DOM-style namespace URI (As defined in Namespaces, this is the declared URI which this node's prefix -- or default in lieu thereof -- was mapped to.) %REVIEW% Null or ""? |
public String | Returns: The prefix if there is one, or null.Get a prefix either from the qname or from the uri mapping, or just make one up! |
protected int | Returns: identity+1, or DTM.NULL.The node identity (index). identity)Implements abstract com. Get the next node identity value in the list, and call the iterator if it hasn't been added yet. |
public String | Returns: String Name of this node, which may be an empty string. %REVIEW% Document when empty string is possible... %REVIEW-COMMENT% It should never be empty, should it?the id of the node. nodeHandle)Implements abstract com. Implements com. Given a node handle, return its DOM-style node name. |
public String | Returns: String Name of this node, which may be an empty string.the id of the node. nodeHandle)Overrides com. Implements com. Given a node handle, return the XPath node name. |
public String | Returns: String Value of this node, or null if not meaningful for this node type.The node id. nodeHandle)Implements abstract com. Implements com. Given a node handle, return its node value. |
public int | Returns: The number of that are currently in the tree.Implements abstract com. Get the number of nodes that have been added. |
public String | Returns: String prefix of this node's name, or "" if no explicit namespace prefix was given.the id of the node. nodeHandle)Implements abstract com. Implements com. Given a namespace handle, return the prefix that the namespace decl is mapping. |
public String | |
public SourceLocator | getSourceLocatorFor(int
an node)int valueImplements com. Retrieve the SourceLocator associated with a specific node. |
public XMLString | Returns: A string object that represents the string-value of the given node.The node ID. nodeHandle)Implements abstract com. Implements com. Get the string-value of a node as a String object (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value). |
public String | Returns: String containing the URI of the Unparsed Entity, or an empty string if no such entity exists.A string containing the Entity Name of the unparsed
entity. name)Implements abstract com. Implements com. The getUnparsedEntityURI function returns the URI of the unparsed entity with the specified name in the same document as the context node (see [3.3 Unparsed Entities]). |
public void | ignorableWhitespace(char[]
The whitespace characters. ch, int The start position in the character array. start, int The number of characters to use from the
character array. length)Implements org. Receive notification of ignorable whitespace in element content. |
public void | internalEntityDecl(String
The name of the entity. If it is a parameter
entity, the name will begin with '%'. name, String The replacement text of the entity. value)Implements org. Report an internal entity declaration. |
public boolean | Returns: true if the attribute was specified;
false if it was defaulted.Must be a valid handle to an attribute node. attributeHandle)Implements abstract com. Implements com. 5. |
private final boolean | Returns: true if this is a text or cdata section.oneof DTM.XXX_NODE. type)Bottleneck determination of text type. |
public boolean | Returns: Return true if the given node is whitespace.The node Handle. nodeHandle)Determine if the string-value of a node is whitespace |
public void | migrateTo(DTMManager
the DTMManager manager)Overrides com. Implements com. Migrate a DTM built with an old DTMManager to a new DTMManager. |
public boolean | Returns: true iff we're building this model incrementally (eg we're partnered with a IncrementalSAXSource) and thus require that the transformation and the parse run simultaneously. Guidance to the DTMManager.Implements com.
|
protected boolean | Returns: The true if a next node is found or false if there are no more nodes.Implements abstract com. This method should try and build one or more nodes in the table. |
public void | notationDecl(String
The notation name. name, String The notation public identifier, or null if not
available. publicId, String The notation system identifier. systemId)Implements org. Receive notification of a notation declaration. |
public void | processingInstruction(String
The processing instruction target. target, String The processing instruction data, or null if
none is supplied. data)Implements org. Receive notification of a processing instruction. |
public InputSource | Returns: The new input source, or null to require the default behaviour.The public identifer, or null if none is
available. publicId, String The system identifier provided in the XML
document. systemId)Implements org. Resolve an external entity. |
public void | setDocumentLocator(Locator
A locator for all SAX document events. locator)Implements org. Receive a Locator object for document events. |
public void | setIDAttribute(String
The ID string. id, int The associated element handle. elem)Set an ID string to node association in the ID table. |
public void | setIncrementalSAXSource(IncrementalSAXSource
The parser that we want to recieve events from
on demand. incrementalSAXSource)Bind a IncrementalSAXSource to this DTM. |
public void | setProperty(String
a property, Object String valuean value)Object valueImplements com. Set a run time property for this DTM instance. |
protected void | |
public void | setUseSourceLocation(boolean useSourceLocation)
Set whether information about document source location should be maintained or not. |
public void | skippedEntity(String
The name of the skipped entity. name)Implements org. Receive notification of a skipped entity. |
public void | startCDATA()
Implements org. Report the start of a CDATA section. |
public void | startDocument()
Implements org. Receive notification of the beginning of the document. |
public void | startDTD(String
The document type name. name, String The declared public identifier for the
external DTD subset, or null if none was declared. publicId, String The declared system identifier for the
external DTD subset, or null if none was declared. systemId)Implements org. Report the start of DTD declarations, if any. |
public void | startElement(String
The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed. uri, String The local name (without prefix), or the
empty string if Namespace processing is not being
performed. localName, String The qualified name (with prefix), or the
empty string if qualified names are not available. qName, Attributes The specified or defaulted attributes. attributes)Implements org. Receive notification of the start of an element. |
public void | startEntity(String
The name of the entity. If it is a parameter
entity, the name will begin with '%'. name)Implements org. Report the beginning of an entity in content.</entity> |
public void | startPrefixMapping(String
The Namespace prefix being declared. prefix, String The Namespace URI mapped to the prefix. uri)Implements org. Receive notification of the start of a Namespace mapping. |
public void | unparsedEntityDecl(String
The entity name. name, String The entity public identifier, or null if not
available. publicId, String The entity system identifier. systemId, String The name of the associated notation. notationName)Implements org. Receive notification of an unparsed entity declaration. |
public void | warning(SAXParseException
The warning information encoded as an exception. e)Implements org. Receive notification of a parser warning. |