Top Description Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.runtime

pack-priv final Class ContentHandlerAdaptor

extends DefaultHandler
Class Inheritance
Imports
com.sun.istack.FinalArrayList, .SAXException2, org.xml.sax.Attributes, .SAXException, org.xml.sax.helpers.DefaultHandler, javax.xml.stream.XMLStreamException, java.io.IOException

Receives SAX2 events and send the equivalent events to XMLSerializer
Author
Kohsuke Kawaguchi ([email protected])

Field Summary

Modifier and TypeField and Description
private final FinalArrayList<String>
prefixMap

Stores newly declared prefix-URI mapping.

private final XMLSerializer
serializer

Events will be sent to this object.

private final StringBuffer

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
characters(char[] ch, int start, int length)

Overrides org.xml.sax.helpers.DefaultHandler.characters.

Implements org.xml.sax.ContentHandler.characters.

Receive notification of character data inside an element.

private boolean
public void
endElement(String namespaceURI, String localName, String qName)

Overrides org.xml.sax.helpers.DefaultHandler.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Receive notification of the end of an element.

private void
private String
public void
startDocument()

Overrides org.xml.sax.helpers.DefaultHandler.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

Receive notification of the beginning of the document.

public void
startElement(String namespaceURI, String localName, String qName, Attributes atts)

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the start of an element.

public void
startPrefixMapping(String prefix, String uri)

Overrides org.xml.sax.helpers.DefaultHandler.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Receive notification of the start of a Namespace mapping.

Inherited from org.xml.sax.helpers.DefaultHandler:
endDocumentendPrefixMappingerrorfatalErrorignorableWhitespacenotationDeclprocessingInstructionresolveEntitysetDocumentLocatorskippedEntityunparsedEntityDeclwarning

Field Detail

prefixMapback to summary
private final FinalArrayList<String> prefixMap

Stores newly declared prefix-URI mapping.

serializerback to summary
private final XMLSerializer serializer

Events will be sent to this object.

textback to summary
private final StringBuffer text

Constructor Detail

ContentHandlerAdaptorback to summary
pack-priv ContentHandlerAdaptor(XMLSerializer _serializer)

Method Detail

charactersback to summary
public void characters(char[] ch, int start, int length)

Overrides org.xml.sax.helpers.DefaultHandler.characters.

Implements org.xml.sax.ContentHandler.characters.

Doc from org.xml.sax.helpers.DefaultHandler.characters.

Receive notification of character data inside an element.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).

Annotations
@Override
containsPrefixMappingback to summary
private boolean containsPrefixMapping(String prefix, String uri)
endElementback to summary
public void endElement(String namespaceURI, String localName, String qName) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Doc from org.xml.sax.helpers.DefaultHandler.endElement.

Receive notification of the end of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).

Annotations
@Override
Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
flushTextback to summary
private void flushText() throws SAXException, IOException, XMLStreamException
getPrefixback to summary
private String getPrefix(String qname)
startDocumentback to summary
public void startDocument()

Overrides org.xml.sax.helpers.DefaultHandler.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

Doc from org.xml.sax.helpers.DefaultHandler.startDocument.

Receive notification of the beginning of the document.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as allocating the root node of a tree or creating an output file).

Annotations
@Override
startElementback to summary
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Doc from org.xml.sax.helpers.DefaultHandler.startElement.

Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).

Annotations
@Override
Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
startPrefixMappingback to summary
public void startPrefixMapping(String prefix, String uri)

Overrides org.xml.sax.helpers.DefaultHandler.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Doc from org.xml.sax.helpers.DefaultHandler.startPrefixMapping.

Receive notification of the start of a Namespace mapping.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each Namespace prefix scope (such as storing the prefix mapping).

Annotations
@Override