Package org.apache.fop.util
Class GenerationHelperContentHandler
java.lang.Object
org.apache.fop.util.DelegatingContentHandler
org.apache.fop.util.GenerationHelperContentHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,LexicalHandler
This class is a delegating SAX ContentHandler which has the purpose to provide a few handy
methods that make life easier when generating SAX events.
-
Constructor Summary
ConstructorsConstructorDescriptionGenerationHelperContentHandler
(ContentHandler handler, String mainNamespace, Object contentHandlerContext) Main constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
element
(String localName, Attributes atts) Convenience method to generate an empty element with attributes.void
element
(org.apache.xmlgraphics.util.QName qName, Attributes atts) Convenience method to generate an empty element with attributes.void
endElement
(String localName) Convenience method to generate a endElement SAX event.void
endElement
(org.apache.xmlgraphics.util.QName qName) Convenience method to generate a startElement SAX event.Returns the context object (may be null).Returns the main namespace used for generated XML content.void
setMainNamespace
(String namespaceURI) Sets the main namespace used for generated XML content when abbreviated ContentHandler calls are used.void
startElement
(String localName) Convenience method to generate a startElement SAX event.void
startElement
(String localName, Attributes atts) Convenience method to generate a startElement SAX event.void
startElement
(org.apache.xmlgraphics.util.QName qName) Convenience method to generate a startElement SAX event.void
startElement
(org.apache.xmlgraphics.util.QName qName, Attributes atts) Convenience method to generate a startElement SAX event.Methods inherited from class org.apache.fop.util.DelegatingContentHandler
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, error, fatalError, getDelegateContentHandler, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDelegateContentHandler, setDelegateDTDHandler, setDelegateEntityResolver, setDelegateErrorHandler, setDelegateLexicalHandler, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
GenerationHelperContentHandler
public GenerationHelperContentHandler(ContentHandler handler, String mainNamespace, Object contentHandlerContext) Main constructor. If the given handler also implements any of the EntityResolver, DTDHandler, LexicalHandler or ErrorHandler interfaces, these are set automatically.- Parameters:
handler
- the SAX content handler to delegate all calls tomainNamespace
- the main namespace used for generated XML content when abbreviated ContentHandler calls are used.contentHandlerContext
- additional content handler context state
-
-
Method Details
-
getMainNamespace
Returns the main namespace used for generated XML content.- Returns:
- the main namespace
-
setMainNamespace
Sets the main namespace used for generated XML content when abbreviated ContentHandler calls are used.- Parameters:
namespaceURI
- the new main namespace URI
-
getContentHandlerContext
Returns the context object (may be null).- Returns:
- the context object
-
startElement
Convenience method to generate a startElement SAX event.- Parameters:
localName
- the local name of the elementatts
- the attributes- Throws:
SAXException
- if a SAX exception occurs
-
startElement
Convenience method to generate a startElement SAX event.- Parameters:
localName
- the local name of the element- Throws:
SAXException
- if a SAX exception occurs
-
startElement
public void startElement(org.apache.xmlgraphics.util.QName qName, Attributes atts) throws SAXException Convenience method to generate a startElement SAX event.- Parameters:
qName
- the qualified name of the elementatts
- the attributes- Throws:
SAXException
- if a SAX exception occurs
-
startElement
Convenience method to generate a startElement SAX event.- Parameters:
qName
- the qualified name of the element- Throws:
SAXException
- if a SAX exception occurs
-
endElement
Convenience method to generate a endElement SAX event.- Parameters:
localName
- the local name of the element- Throws:
SAXException
- if a SAX exception occurs
-
endElement
Convenience method to generate a startElement SAX event.- Parameters:
qName
- the qualified name of the element- Throws:
SAXException
- if a SAX exception occurs
-
element
Convenience method to generate an empty element with attributes.- Parameters:
localName
- the local name of the elementatts
- the attributes- Throws:
SAXException
- if a SAX exception occurs
-
element
Convenience method to generate an empty element with attributes.- Parameters:
qName
- the qualified name of the elementatts
- the attributes- Throws:
SAXException
- if a SAX exception occurs
-