Top Description Fields Constructors Methods
com.sun.tools.xjc.reader.xmlschema.bindinfo

public Class ForkingFilter

extends XMLFilterImpl
Class Inheritance
Imports
java.util.ArrayList, org.xml.sax.Attributes, .ContentHandler, .Locator, .SAXException, .XMLFilter, org.xml.sax.helpers.XMLFilterImpl, javax.xml.XMLConstants

XMLFilter that can fork an event to another ContentHandler in the middle.

The side handler receives SAX events before the next handler in the filter chain does.

Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
private int
depth

The depth of the current element that the side handler is seeing.

private Locator
private final ArrayList<String>
namespaces

In-scope namespace mapping.

private ContentHandler
side

Non-null if we are also forking events to this handler.

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

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

Overrides org.xml.sax.helpers.XMLFilterImpl.characters.

Implements org.xml.sax.ContentHandler.characters.

Filter a character data event.

public void
public void
endElement(String uri, String localName, String qName)

Overrides org.xml.sax.helpers.XMLFilterImpl.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Filter an end element event.

public void
endPrefixMapping(String prefix)

Overrides org.xml.sax.helpers.XMLFilterImpl.endPrefixMapping.

Implements org.xml.sax.ContentHandler.endPrefixMapping.

Filter an end Namespace prefix mapping event.

public Locator
public ContentHandler
public void
ignorableWhitespace(char[] ch, int start, int length)

Overrides org.xml.sax.helpers.XMLFilterImpl.ignorableWhitespace.

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Filter an ignorable whitespace event.

private void
public void
public void
public void
startElement(String uri, String localName, String qName, Attributes atts)

Overrides org.xml.sax.helpers.XMLFilterImpl.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Filter a start element event.

public void
startForking(String uri, String localName, String qName, Attributes atts, ContentHandler side)

Starts the event forking.

public void
startPrefixMapping(String prefix, String uri)

Overrides org.xml.sax.helpers.XMLFilterImpl.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Filter a start Namespace prefix mapping event.

Inherited from org.xml.sax.helpers.XMLFilterImpl:
errorfatalErrorgetContentHandlergetDTDHandlergetEntityResolvergetErrorHandlergetFeaturegetParentgetPropertynotationDeclparseparseprocessingInstructionresolveEntitysetContentHandlersetDTDHandlersetEntityResolversetErrorHandlersetFeaturesetParentsetPropertyskippedEntityunparsedEntityDeclwarning

Field Detail

depthback to summary
private int depth

The depth of the current element that the side handler is seeing.

locback to summary
private Locator loc
namespacesback to summary
private final ArrayList<String> namespaces

In-scope namespace mapping. namespaces[2n ] := prefix namespaces[2n+1] := namespace URI

sideback to summary
private ContentHandler side

Non-null if we are also forking events to this handler.

Constructor Detail

ForkingFilterback to summary
public ForkingFilter()
ForkingFilterback to summary
public ForkingFilter(ContentHandler next)

Method Detail

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

Overrides org.xml.sax.helpers.XMLFilterImpl.characters.

Implements org.xml.sax.ContentHandler.characters.

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

Filter a character data event.

Annotations
@Override
Exceptions
SAXException:
The client may throw an exception during processing.
endDocumentback to summary
public void endDocument() throws SAXException

Overrides org.xml.sax.helpers.XMLFilterImpl.endDocument.

Implements org.xml.sax.ContentHandler.endDocument.

Doc from org.xml.sax.helpers.XMLFilterImpl.endDocument.

Filter an end document event.

Annotations
@Override
Exceptions
SAXException:
The client may throw an exception during processing.
endElementback to summary
public void endElement(String uri, String localName, String qName) throws SAXException

Overrides org.xml.sax.helpers.XMLFilterImpl.endElement.

Implements org.xml.sax.ContentHandler.endElement.

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

Filter an end element event.

Annotations
@Override
Exceptions
SAXException:
The client may throw an exception during processing.
endPrefixMappingback to summary
public void endPrefixMapping(String prefix) throws SAXException

Overrides org.xml.sax.helpers.XMLFilterImpl.endPrefixMapping.

Implements org.xml.sax.ContentHandler.endPrefixMapping.

Doc from org.xml.sax.helpers.XMLFilterImpl.endPrefixMapping.

Filter an end Namespace prefix mapping event.

Annotations
@Override
Exceptions
SAXException:
The client may throw an exception during processing.
getDocumentLocatorback to summary
public Locator getDocumentLocator()
getSideHandlerback to summary
public ContentHandler getSideHandler()
ignorableWhitespaceback to summary
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException

Overrides org.xml.sax.helpers.XMLFilterImpl.ignorableWhitespace.

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Doc from org.xml.sax.helpers.XMLFilterImpl.ignorableWhitespace.

Filter an ignorable whitespace event.

Annotations
@Override
Exceptions
SAXException:
The client may throw an exception during processing.
resetback to summary
private void reset()
setDocumentLocatorback to summary
public void setDocumentLocator(Locator locator)

Overrides org.xml.sax.helpers.XMLFilterImpl.setDocumentLocator.

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Doc from org.xml.sax.helpers.XMLFilterImpl.setDocumentLocator.

Filter a new document locator event.

Annotations
@Override
startDocumentback to summary
public void startDocument() throws SAXException

Overrides org.xml.sax.helpers.XMLFilterImpl.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

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

Filter a start document event.

Annotations
@Override
Exceptions
SAXException:
The client may throw an exception during processing.
startElementback to summary
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException

Overrides org.xml.sax.helpers.XMLFilterImpl.startElement.

Implements org.xml.sax.ContentHandler.startElement.

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

Filter a start element event.

Annotations
@Override
Exceptions
SAXException:
The client may throw an exception during processing.
startForkingback to summary
public void startForking(String uri, String localName, String qName, Attributes atts, ContentHandler side) throws SAXException

Starts the event forking.

startPrefixMappingback to summary
public void startPrefixMapping(String prefix, String uri) throws SAXException

Overrides org.xml.sax.helpers.XMLFilterImpl.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

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

Filter a start Namespace prefix mapping event.

Annotations
@Override
Exceptions
SAXException:
The client may throw an exception during processing.