addNamespaceAttribute
protected AttributesImpl addNamespaceAttribute(AttributesImpl attrs,
Namespace namespace)
If isDelcareNamespaceAttributes() is enabled then this method will add
the given namespace declaration to the supplied attributes object,
creating one if it does not exist.
attrs
- DOCUMENT ME!namespace
- DOCUMENT ME!
checkForNullHandlers
protected void checkForNullHandlers()
Ensures non-null content handlers?
createAttributes
protected Attributes createAttributes(Element element,
Attributes namespaceAttributes)
throws SAXException
documentLocator
protected void documentLocator(Document document)
throws SAXException
The org.xml.sax.Locator
is only really useful when parsing a
textual document as its main purpose is to identify the line and column
number. Since we are processing an in memory tree which will probably
have its line number information removed, we'll just use -1 for the line
and column numbers.
dtdHandler
protected void dtdHandler(Document document)
throws SAXException
We do not yet support DTD or XML Schemas so this method does nothing
right now.
endDocument
protected void endDocument()
throws SAXException
endElement
protected void endElement(Element element)
throws SAXException
endPrefixMapping
protected void endPrefixMapping(org.dom4j.tree.NamespaceStack stack,
int stackSize)
throws SAXException
Fires a SAX endPrefixMapping event for all the namespaceStack which have
gone out of scope
stack
- DOCUMENT ME!stackSize
- DOCUMENT ME!
entityResolver
protected void entityResolver(Document document)
throws SAXException
getContentHandler
public ContentHandler getContentHandler()
DOCUMENT ME!
- the
ContentHandler
called when SAX events are
raised
getDTDHandler
public DTDHandler getDTDHandler()
DOCUMENT ME!
getEntityResolver
public EntityResolver getEntityResolver()
DOCUMENT ME!
- the
EntityResolver
used when a Document contains a
DTD
getErrorHandler
public ErrorHandler getErrorHandler()
DOCUMENT ME!
getFeature
public boolean getFeature(String name)
throws SAXNotRecognizedException,
SAXNotSupportedException
Looks up the value of a feature.
getLexicalHandler
public LexicalHandler getLexicalHandler()
DOCUMENT ME!
- the
LexicalHandler
used when a Document contains a
DTD
getProperty
public Object getProperty(String name)
throws SAXNotRecognizedException,
SAXNotSupportedException
Gets the given SAX property
isDeclareNamespaceAttributes
public boolean isDeclareNamespaceAttributes()
Should namespace declarations be converted to "xmlns" attributes. This
property defaults to false
as per the SAX specification.
This property is set via the SAX feature
"http://xml.org/sax/features/namespace-prefixes"
isIgnoreableNamespace
protected boolean isIgnoreableNamespace(Namespace namespace,
org.dom4j.tree.NamespaceStack namespaceStack)
DOCUMENT ME!
namespace
- DOCUMENT ME!namespaceStack
- DOCUMENT ME!
- true if the given namespace is an ignorable namespace (such as
Namespace.NO_NAMESPACE or Namespace.XML_NAMESPACE) or if the
namespace has already been declared in the current scope
parse
public void parse(InputSource input)
throws SAXException
Parses an XML document. This method can only accept DocumentInputSource
inputs otherwise a SAXNotSupportedException
exception is thrown.
parse
public void parse(String systemId)
throws SAXNotSupportedException
This method is not supported.
setContentHandler
public void setContentHandler(ContentHandler contentHandler)
Sets the ContentHandler
called when SAX events are raised
contentHandler
- is the ContentHandler
called when SAX events
are raised
setDTDHandler
public void setDTDHandler(DTDHandler handler)
Sets the DTDHandler
.
setDeclareNamespaceAttributes
public void setDeclareNamespaceAttributes(boolean declareNamespaceAttrs)
Sets whether namespace declarations should be exported as "xmlns"
attributes or not. This property is set from the SAX feature
"http://xml.org/sax/features/namespace-prefixes"
declareNamespaceAttrs
- DOCUMENT ME!
setEntityResolver
public void setEntityResolver(EntityResolver entityResolver)
Sets the EntityResolver
.
entityResolver
- is the EntityResolver
setErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)
Sets the ErrorHandler
.
errorHandler
- DOCUMENT ME!
setFeature
public void setFeature(String name,
boolean value)
throws SAXNotRecognizedException,
SAXNotSupportedException
This implementation does actually use any features but just stores them
for later retrieval
name
- DOCUMENT ME!value
- DOCUMENT ME!
setLexicalHandler
public void setLexicalHandler(LexicalHandler lexicalHandler)
Sets the LexicalHandler
.
lexicalHandler
- is the LexicalHandler
setProperty
public void setProperty(String name,
Object value)
Sets the given SAX property
name
- DOCUMENT ME!value
- DOCUMENT ME!
setXMLReader
public void setXMLReader(XMLReader xmlReader)
Sets the XMLReader
used to write SAX events to
xmlReader
- is the XMLReader
startDocument
protected void startDocument()
throws SAXException
startElement
protected void startElement(Element element,
AttributesImpl namespaceAttributes)
throws SAXException
startPrefixMapping
protected AttributesImpl startPrefixMapping(Element element,
org.dom4j.tree.NamespaceStack namespaceStack)
throws SAXException
Fires a SAX startPrefixMapping event for all the namespaceStack which
have just come into scope
element
- DOCUMENT ME!namespaceStack
- DOCUMENT ME!
write
public void write(String text)
throws SAXException
Generates SAX events for the given text
text
- is the text to send to the SAX ContentHandler
write
public void write(CDATA cdata)
throws SAXException
Generates SAX events for the given CDATA
cdata
- is the CDATA to parse
write
public void write(Comment comment)
throws SAXException
Generates SAX events for the given Comment
comment
- is the Comment to parse
write
public void write(Document document)
throws SAXException
Generates SAX events for the given Document and all its content
document
- is the Document to parse
write
public void write(Element element)
throws SAXException
Generates SAX events for the given Element and all its content
element
- is the Element to parse
write
protected void write(Element element,
org.dom4j.tree.NamespaceStack namespaceStack)
throws SAXException
write
public void write(Entity entity)
throws SAXException
Generates SAX events for the given Entity
entity
- is the Entity to parse
write
public void write(Node node)
throws SAXException
A polymorphic method to write any Node to this SAX stream
write
public void write(ProcessingInstruction pi)
throws SAXException
Generates SAX events for the given ProcessingInstruction
pi
- is the ProcessingInstruction to parse
writeClose
public void writeClose(Element element)
throws SAXException
Writes the closing tag of an
Element
element
- Element
to output.
writeContent
protected void writeContent(Branch branch,
org.dom4j.tree.NamespaceStack namespaceStack)
throws SAXException
writeOpen
public void writeOpen(Element element)
throws SAXException
Writes the opening tag of an
Element
, including its
Attribute
s but without its content.
element
- Element
to output.