SAXContentHandler builds a dom4j tree via SAX events.
| Modifier and Type | Field and Description |
|---|---|
| private StringBuffer | cdataText
buffer to hold contents of cdata section across multiple characters events |
| private Element | currentElement
The current element we are on |
| private int | declaredNamespaceIndex
The number of namespaces that are declared in the current scope |
| private Document | document
The document that is being built |
| private DocumentFactory | documentFactory
The factory used to create new |
| private ElementHandler | elementHandler
the |
| private ElementStack | elementStack
stack of |
| private String | entity
The name of the current entity |
| private int | entityLevel
The number of levels deep we are inside a startEntity/endEntity call |
| private EntityResolver | entityResolver
The entity resolver |
| private List | externalDTDDeclarations
external DTD declarations |
| private boolean | ignoreComments
Should we ignore comments |
| private boolean | includeExternalDTDDeclarations
Should external DTD declarations be expanded into a List in the DTD |
| private boolean | includeInternalDTDDeclarations
Should internal DTD declarations be expanded into a List in the DTD |
| private InputSource | |
| private boolean | insideCDATASection
Flag used to indicate that we are inside a CDATA section |
| private boolean | insideDTDSection
Flag used to indicate that we are inside a DTD section |
| private List | internalDTDDeclarations
internal DTD declarations |
| private boolean | internalDTDsubset
Are we in an internal DTD subset? |
| private Locator | locator
the Locator |
| private boolean | mergeAdjacentText
Whether adjacent text nodes should be merged |
| private NamespaceStack | namespaceStack
stack of |
| private boolean | stripWhitespaceText
Holds value of property stripWhitespaceText. |
| private StringBuffer | textBuffer
Buffer used to concatenate text together |
| private boolean | textInTextBuffer
Have we added text to the buffer |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | SAXContentHandler(DocumentFactory documentFactory, ElementHandler elementHandler, ElementStack elementStack)
|
| Modifier and Type | Method and Description |
|---|---|
| protected void | addAttributes(Element
DOCUMENT ME! element, Attributes DOCUMENT ME! attributes)Add all the attributes to the given elements |
| protected void | addDeclaredNamespaces(Element
DOCUMENT ME! element)Add all namespaces declared before the startElement() SAX event to the current element so that they are available to child elements and attributes |
| protected void | addDTDDeclaration(Decl
DOCUMENT ME! declaration)Adds an internal DTD declaration to the list of declarations |
| protected void | addExternalDTDDeclaration(Decl
DOCUMENT ME! declaration)Adds an external DTD declaration to the list of declarations |
| 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. val)Implements org. |
| 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. end)Overrides org. Implements org. |
| 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. end)Implements org. |
| protected void | completeCurrentTextNode()
If the current text buffer contains any text then create a new text node with it and add it to the current element |
| protected Document | |
| protected ElementStack | |
| public void | elementDecl(String
The element type name. name, String The content model as a normalized string. model)Implements org. |
| public void | |
| public void | endDocument()
Overrides org. Implements org. |
| 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. namespaceURI, 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)Overrides org. Implements org. |
| public void | endEntity(String
The name of the entity that is ending. name)Implements org. |
| public void | endPrefixMapping(String
The Namespace prefix being declared. prefix)Overrides org. Implements org. |
| public void | error(SAXParseException
DOCUMENT ME! exception)Overrides org. Implements org. |
| 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. sysId)Implements org. |
| public void | fatalError(SAXParseException
DOCUMENT ME! exception)Overrides org. Implements org. |
| public Document | |
| public ElementStack | |
| private String | |
| public EntityResolver | |
| public InputSource | |
| 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. |
| protected boolean | Returns: DOCUMENT ME!DOCUMENT ME! name)a Strategy Method to determine if a given entity name is ignorable |
| public boolean | |
| public boolean | Returns: whether external DTD declarations should be expanded into the DocumentType object or not.DOCUMENT ME! |
| public boolean | Returns: whether internal DTD declarations should be expanded into the DocumentType object or not.DOCUMENT ME! |
| public boolean | Returns: Value of property mergeAdjacentText.Returns whether adjacent text nodes should be merged together. |
| public boolean | Returns: Value of property stripWhitespaceText.Sets whether whitespace between element start and end tags should be ignored |
| public void | notationDecl(String
The notation name. name, String The notation's public identifier, or null if none was given. publicId, String The notation's system identifier, or null if none was given. systemId)Overrides org. Implements org. |
| public void | processingInstruction(String
The processing instruction target. target, String The processing instruction data, or null if
none is supplied. data)Overrides org. Implements org. |
| public void | setDocumentLocator(Locator
A locator for all SAX document events. documentLocator)Overrides org. Implements org. |
| public void | |
| public void | |
| public void | setIgnoreComments(boolean
whether we should ignore comments or not. ignoreComments)Sets whether we should ignore comments or not. |
| public void | setIncludeExternalDTDDeclarations(boolean
whether or not DTD declarations should be expanded and
included into the DocumentType object. include)Sets whether DTD external declarations should be expanded into the DocumentType object or not. |
| public void | setIncludeInternalDTDDeclarations(boolean
whether or not DTD declarations should be expanded and
included into the DocumentType object. include)Sets whether internal DTD declarations should be expanded into the DocumentType object or not. |
| public void | |
| public void | setMergeAdjacentText(boolean
New value of property mergeAdjacentText. mergeAdjacentText)Sets whether or not adjacent text nodes should be merged together when parsing. |
| public void | setStripWhitespaceText(boolean
New value of property stripWhitespaceText. stripWhitespaceText)Sets whether whitespace between element start and end tags should be ignored. |
| public void | startCDATA()
Implements org. |
| public void | startDocument()
Overrides org. Implements org. |
| 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.
(Note that this is not resolved against the document
base URI.) systemId)Implements org. |
| 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. namespaceURI, 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. qualifiedName, Attributes The attributes attached to the element. If
there are no attributes, it shall be an empty
Attributes object. attributes)Overrides org. Implements org. |
| public void | startEntity(String
The name of the entity. If it is a parameter
entity, the name will begin with '%', and if it is the
external DTD subset, it will be "[dtd]". name)Implements org. |
| public void | startPrefixMapping(String
The Namespace prefix being declared. prefix, String The Namespace URI mapped to the prefix. uri)Overrides org. Implements org. |
| public void | unparsedEntityDecl(String
The unparsed entity's name. name, String The entity's public identifier, or null if none was given. publicId, String The entity's system identifier. systemId, String The name of the associated notation. notationName)Overrides org. Implements org. |
| public void | warning(SAXParseException
DOCUMENT ME! exception)Overrides org. Implements org. |