Save This Page
Home » openjdk-7 » com.sun.org.apache.xml.internal » serializer » [javadoc | source]
com.sun.org.apache.xml.internal.serializer
abstract interface: ExtendedContentHandler [javadoc | source]

All Implemented Interfaces:
    ContentHandler

All Known Implementing Classes:
    ToXMLSAXHandler, ToXMLStream, ToTextSAXHandler, ToSAXHandler, AdaptiveResultTreeImpl, EmptySerializer, ToStream, StringValueHandler, SimpleResultTreeImpl, SerializationHandler, SerializerBase, ToHTMLSAXHandler, ToTextStream, ToHTMLStream, ToUnknownStream

This interface describes extensions to the SAX ContentHandler interface. It is intended to be used by a serializer. The methods on this interface will implement SAX- like behavior. This allows the gradual collection of information rather than having it all up front. For example the call
startElement(namespaceURI,localName,qName,atts)
could be replaced with the calls
startElement(namespaceURI,localName,qName)
addAttributes(atts)
If there are no attributes the second call can be dropped. If attributes are to be added one at a time with calls to
addAttribute(namespaceURI, localName, qName, type, value)
Field Summary
public static final  int NO_BAD_CHARS     
public static final  int HTML_ATTREMPTY     
public static final  int HTML_ATTRURL     
Method from com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler Summary:
addAttribute,   addAttribute,   addAttribute,   addAttributes,   addUniqueAttribute,   addXSLAttribute,   characters,   characters,   endElement,   entityReference,   getNamespaceMappings,   getNamespaceURI,   getNamespaceURIFromPrefix,   getPrefix,   namespaceAfterStartElement,   setSourceLocator,   startElement,   startElement,   startPrefixMapping
Method from com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler Detail:
 public  void addAttribute(String qName,
    String value)
    Add an attribute to the current element. The namespace URI of the attribute will be calculated from the prefix of qName. The local name will be derived from qName and the type will be assumed to be "CDATA".
 public  void addAttribute(String uri,
    String localName,
    String rawName,
    String type,
    String value) throws SAXException
    Add at attribute to the current element, not from an xsl:attribute element.
 public  void addAttribute(String uri,
    String localName,
    String rawName,
    String type,
    String value,
    boolean XSLAttribute) throws SAXException
    Add at attribute to the current element
 public  void addAttributes(Attributes atts) throws SAXException
    Add attributes to the current element
 public  void addUniqueAttribute(String qName,
    String value,
    int flags) throws SAXException
    Add a unique attribute to the current element. The attribute is guaranteed to be unique here. The serializer can write it out immediately without saving it in a table first. The integer flag contains information about the attribute, which helps the serializer to decide whether a particular processing is needed.
 public  void addXSLAttribute(String qName,
    String value,
    String uri)
    Add an attribute from an xsl:attribute element.
 public  void characters(String chars) throws SAXException
    This method is used to notify of a character event, but passing the data as a character String rather than the standard character array.
 public  void characters(Node node) throws SAXException
    This method is used to notify of a character event, but passing the data as a DOM Node rather than the standard character array.
 public  void endElement(String elemName) throws SAXException
    This method is used to notify that an element has ended. Unlike the standard SAX method
    endElement(namespaceURI,localName,qName)
    
    only the last parameter is passed. If needed the serializer can derive the localName from the qualified name and derive the namespaceURI from its implementation.
 public  void entityReference(String entityName) throws SAXException
    Notify of an entity reference.
 public NamespaceMappings getNamespaceMappings()
    This method returns an object that has the current namespace mappings in effect.
 public String getNamespaceURI(String name,
    boolean isElement)
    This method gets the prefix associated with a current element or attribute name.
 public String getNamespaceURIFromPrefix(String prefix)
    This method returns the namespace URI currently associated with the prefix.
 public String getPrefix(String uri)
    This method returns the prefix that currently maps to the given namespace URI.
 public  void namespaceAfterStartElement(String uri,
    String prefix) throws SAXException
    This method is used to notify that a prefix mapping is to start, but after an element is started. The SAX method call
    startPrefixMapping(prefix,uri)
    
    is used just before an element starts and applies to the element to come, not to the current element. This method applies to the current element. For example one could make the calls in this order:
    startElement("prfx8:elem9")
    namespaceAfterStartElement("http://namespace8","prfx8")
    
 public  void setSourceLocator(SourceLocator locator)
    This method is used to set the source locator, which might be used to generated an error message.
 public  void startElement(String qName) throws SAXException
    This method is used to notify of the start of an element
 public  void startElement(String uri,
    String localName,
    String qName) throws SAXException
    This method is used to notify that an element is starting. This method is just like the standard SAX method
    startElement(uri,localName,qname,atts)
    
    but without the attributes.
 public boolean startPrefixMapping(String prefix,
    String uri,
    boolean shouldFlush) throws SAXException
    This method is used to notify that a prefix maping is to start, which can be for the current element, or for the one to come.