Class GenerationHelperContentHandler

java.lang.Object
org.apache.fop.util.DelegatingContentHandler
org.apache.fop.util.GenerationHelperContentHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler

public class GenerationHelperContentHandler extends DelegatingContentHandler
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 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 to
      mainNamespace - the main namespace used for generated XML content when abbreviated ContentHandler calls are used.
      contentHandlerContext - additional content handler context state
  • Method Details

    • getMainNamespace

      public String getMainNamespace()
      Returns the main namespace used for generated XML content.
      Returns:
      the main namespace
    • setMainNamespace

      public void setMainNamespace(String namespaceURI)
      Sets the main namespace used for generated XML content when abbreviated ContentHandler calls are used.
      Parameters:
      namespaceURI - the new main namespace URI
    • getContentHandlerContext

      public Object getContentHandlerContext()
      Returns the context object (may be null).
      Returns:
      the context object
    • startElement

      public void startElement(String localName, Attributes atts) throws SAXException
      Convenience method to generate a startElement SAX event.
      Parameters:
      localName - the local name of the element
      atts - the attributes
      Throws:
      SAXException - if a SAX exception occurs
    • startElement

      public void startElement(String localName) throws SAXException
      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 element
      atts - the attributes
      Throws:
      SAXException - if a SAX exception occurs
    • startElement

      public void startElement(org.apache.xmlgraphics.util.QName qName) throws SAXException
      Convenience method to generate a startElement SAX event.
      Parameters:
      qName - the qualified name of the element
      Throws:
      SAXException - if a SAX exception occurs
    • endElement

      public void endElement(String localName) throws SAXException
      Convenience method to generate a endElement SAX event.
      Parameters:
      localName - the local name of the element
      Throws:
      SAXException - if a SAX exception occurs
    • endElement

      public void endElement(org.apache.xmlgraphics.util.QName qName) throws SAXException
      Convenience method to generate a startElement SAX event.
      Parameters:
      qName - the qualified name of the element
      Throws:
      SAXException - if a SAX exception occurs
    • element

      public void element(String localName, Attributes atts) throws SAXException
      Convenience method to generate an empty element with attributes.
      Parameters:
      localName - the local name of the element
      atts - the attributes
      Throws:
      SAXException - if a SAX exception occurs
    • element

      public void element(org.apache.xmlgraphics.util.QName qName, Attributes atts) throws SAXException
      Convenience method to generate an empty element with attributes.
      Parameters:
      qName - the qualified name of the element
      atts - the attributes
      Throws:
      SAXException - if a SAX exception occurs