Top Description Fields Constructors Methods
com.sun.tools.xjc.reader.internalizer

pack-priv Class WhitespaceStripper

extends XMLFilterImpl
Class Inheritance
Imports
org.glassfish.jaxb.core.WhiteSpaceProcessor, org.xml.sax.Attributes, .ContentHandler, .EntityResolver, .ErrorHandler, .SAXException, .XMLReader, org.xml.sax.helpers.XMLFilterImpl

Strips ignorable whitespace from SAX event stream.

This filter works only when the event stream doesn't contain any mixed content.

Author
Kohsuke Kawaguchi ([email protected])

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private char[]
private int
private int

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
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
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
processPendingText()

Forwars the buffered characters if it contains any non-whitespace character.

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.

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

Field Detail

AFTER_END_ELEMENTback to summary
private static final int AFTER_END_ELEMENT
AFTER_START_ELEMENTback to summary
private static final int AFTER_START_ELEMENT
bufback to summary
private char[] buf
bufLenback to summary
private int bufLen
stateback to summary
private int state

Constructor Detail

WhitespaceStripperback to summary
public WhitespaceStripper(XMLReader reader)
WhitespaceStripperback to summary
public WhitespaceStripper(ContentHandler handler, ErrorHandler eh, EntityResolver er)

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.
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.
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.
processPendingTextback to summary
private void processPendingText() throws SAXException

Forwars the buffered characters if it contains any non-whitespace character.

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.