Package org.exolab.adaptx.xslt.handlers
Class DOMBuilder
java.lang.Object
org.exolab.adaptx.xslt.handlers.DOMBuilder
- All Implemented Interfaces:
ResultHandler
,DocumentHandler
An implementation of ResultHandler that builds a DOM tree
- Version:
- $Revision: 3837 $ $Date: 2003-09-09 07:05:25 +0200 (Tue, 09 Sep 2003) $
- Author:
- Keith Visco
-
Constructor Summary
ConstructorsConstructorDescriptionDOMBuilder
(Document document) Creates a new DOMBuilderDOMBuilder
(Node node) Creates a new DOMBuilder with the given node -
Method Summary
Modifier and TypeMethodDescriptionvoid
cdata
(char[] chars, int start, int length) Signals to receive CDATA charactersvoid
characters
(char[] chars, int start, int length) Signals the start of charactersvoid
Signals to recieve a commentvoid
Signals the end of the documentvoid
endElement
(String name) Signals the start of elementvoid
entityReference
(String name) Signals to recieve an entity reference with the given namevoid
ignorableWhitespace
(char[] chars, int start, int length) Signals the start of ignorable whitespace charactersboolean
Returns true if the DOM builder has completedvoid
processingInstruction
(String target, String data) Signals to recieve a processing instructionvoid
setDocumentLocator
(Locator locator) Sets the document locatorvoid
setEscapeText
(boolean escapeText) Sets the behavoir of handling character content.void
setIndentSize
(short indentSize) Sets the indent size for all formatters that perform serialization, in which indentation is applicable.void
setOutputFormat
(OutputFormat format) Sets the output format information for Formatters that perform serialization.void
Signals the start of a documentvoid
startElement
(String name, AttributeList atts) Signals the start of elementvoid
unescapedCharacters
(char[] chars, int start, int length) Signals to receive characters which should not be escaped
-
Constructor Details
-
DOMBuilder
Creates a new DOMBuilder- Parameters:
the
- Document in which to use when building the DOM. If the document is not empty...it will be cleared, by removing the document element.
-
DOMBuilder
Creates a new DOMBuilder with the given node- Parameters:
node
- the Node to use when building the DOM fragment
-
-
Method Details
-
cdata
public void cdata(char[] chars, int start, int length) Signals to receive CDATA characters- Specified by:
cdata
in interfaceResultHandler
- Parameters:
chars
- the character array containing the characters to receivestart
- the index into the character array to start receiving characters atlength
- the number of characters to recieve
-
characters
Signals the start of characters- Specified by:
characters
in interfaceDocumentHandler
- Parameters:
chars
- the character array containing the characters to receivestart
- the index into the character array to start receiving characters atlength
- the number of characters to recieve- Throws:
SAXException
-
comment
Description copied from interface:ResultHandler
Signals to recieve a comment- Specified by:
comment
in interfaceResultHandler
- Parameters:
data
- , the content of the comment
-
endDocument
Signals the end of the document- Specified by:
endDocument
in interfaceDocumentHandler
- Throws:
SAXException
-
endElement
Signals the start of element- Specified by:
endElement
in interfaceDocumentHandler
- Parameters:
name
- the name of the elementatts
- the AttributeList containing the associated attributes for the element- Throws:
SAXException
-
entityReference
Signals to recieve an entity reference with the given name- Specified by:
entityReference
in interfaceResultHandler
- Parameters:
name
- the name of the entity reference
-
ignorableWhitespace
Signals the start of ignorable whitespace characters- Specified by:
ignorableWhitespace
in interfaceDocumentHandler
- Parameters:
chars
- the character array containing the characters to receivestart
- the index into the character array to start receiving characters atlength
- the number of characters to recieve- Throws:
SAXException
-
isFinished
public boolean isFinished()Returns true if the DOM builder has completed- Returns:
- true if the DOM builder has completed
-
processingInstruction
Signals to recieve a processing instruction- Specified by:
processingInstruction
in interfaceDocumentHandler
- Parameters:
target
- the target of the processing instructiondata
- the content of the processing instruction- Throws:
SAXException
-
setDocumentLocator
Sets the document locator- Specified by:
setDocumentLocator
in interfaceDocumentHandler
- Parameters:
locator
- the Locator used by this DocumentHandler
-
setEscapeText
public void setEscapeText(boolean escapeText) Sets the behavoir of handling character content. If argument is true, character content will be escaped. If false, character content will not be escaped.- Parameters:
escapeText
- the flag indicating whether or not to escape character content
-
setIndentSize
public void setIndentSize(short indentSize) Sets the indent size for all formatters that perform serialization, in which indentation is applicable.- Specified by:
setIndentSize
in interfaceResultHandler
- Parameters:
indentSize
- the number of characters to indent
-
setOutputFormat
Sets the output format information for Formatters that perform serialization.- Specified by:
setOutputFormat
in interfaceResultHandler
- Parameters:
format
- the OutputFormat used to specify properties during serialization
-
startDocument
Signals the start of a document- Specified by:
startDocument
in interfaceDocumentHandler
- Throws:
SAXException
-
startElement
Signals the start of element- Specified by:
startElement
in interfaceDocumentHandler
- Parameters:
name
- the name of the elementatts
- the AttributeList containing the associated attributes for the element- Throws:
SAXException
-
unescapedCharacters
public void unescapedCharacters(char[] chars, int start, int length) Signals to receive characters which should not be escaped- Specified by:
unescapedCharacters
in interfaceResultHandler
- Parameters:
chars
- the character array containing the characters to receivestart
- the index into the character array to start receiving characters atlength
- the number of characters to recieve
-