net.sf.saxon.option.dom4j

Class DOM4JWriter

public class DOM4JWriter extends Builder

JDOMWriter is a Receiver that constructs a JDOM document from the stream of events
Constructor Summary
DOM4JWriter()
Create a JDOMWriter using the default node factory
Method Summary
voidattribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)
voidcharacters(CharSequence chars, int locationId, int properties)
Character data.
voidclose()
End of the document.
voidcomment(CharSequence chars, int locationId, int properties)
Handle a comment.
voidendDocument()
Notify the end of a document node
voidendElement()
End of an element.
NodeInfogetCurrentRoot()
Get the current root node.
DocumentgetDocument()
Get the constructed document node
voidnamespace(int namespaceCode, int properties)
voidopen()
Start of the document.
voidprocessingInstruction(String target, CharSequence data, int locationId, int properties)
Handle a processing instruction.
voidsetUnparsedEntity(String name, String systemID, String publicID)
Notify an unparsed entity URI.
voidstartContent()
voidstartDocument(int properties)
Start of a document node.
voidstartElement(int nameCode, int typeCode, int locationId, int properties)
Start of an element.
booleanusesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute events

Constructor Detail

DOM4JWriter

public DOM4JWriter()
Create a JDOMWriter using the default node factory

Method Detail

attribute

public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)

characters

public void characters(CharSequence chars, int locationId, int properties)
Character data.

close

public void close()
End of the document.

comment

public void comment(CharSequence chars, int locationId, int properties)
Handle a comment.

endDocument

public void endDocument()
Notify the end of a document node

endElement

public void endElement()
End of an element.

getCurrentRoot

public NodeInfo getCurrentRoot()
Get the current root node.

Returns: a Saxon wrapper around the constructed XOM document node

getDocument

public Document getDocument()
Get the constructed document node

Returns: the document node of the constructed XOM tree

namespace

public void namespace(int namespaceCode, int properties)

open

public void open()
Start of the document.

processingInstruction

public void processingInstruction(String target, CharSequence data, int locationId, int properties)
Handle a processing instruction.

setUnparsedEntity

public void setUnparsedEntity(String name, String systemID, String publicID)
Notify an unparsed entity URI.

Parameters: name The name of the unparsed entity systemID The system identifier of the unparsed entity publicID The public identifier of the unparsed entity

startContent

public void startContent()

startDocument

public void startDocument(int properties)
Start of a document node.

startElement

public void startElement(int nameCode, int typeCode, int locationId, int properties)
Start of an element.

usesTypeAnnotations

public boolean usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute events

Returns: true if the Receiver makes any use of this information. If false, the caller may supply untyped nodes instead of supplying the type annotation