Class SPathFilter
- java.lang.Object
-
- org.xml.sax.helpers.XMLFilterImpl
-
- org.apache.taglibs.standard.extra.spath.SPathFilter
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler,org.xml.sax.DTDHandler,org.xml.sax.EntityResolver,org.xml.sax.ErrorHandler,org.xml.sax.XMLFilter,org.xml.sax.XMLReader
public class SPathFilter extends org.xml.sax.helpers.XMLFilterImplFilters a SAX stream based on a single supplied SPath expression.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.StackacceptedDepthsprivate static booleanDEBUGprivate intdepthprivate intexcludedDepthprotected java.util.ListstepsThe steps in the SPath expression we use for filtering.
-
Constructor Summary
Constructors Constructor Description SPathFilter(Path path)Constructs a new SPathFilter, given a Path.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Filter for characters().voidendElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)Filter for endElement().voidendPrefixMapping(java.lang.String prefix)Filter for endPrefixMapping().voidignorableWhitespace(char[] ch, int start, int length)Filter for ignoreableWhitespace().private voidinit()Initializes state used for filtering.private booleanisAccepted()Returns true if events should be passed through, false otherwise.private booleanisExcluded()Returns true if events should be blocked, false otherwise.static booleannodeMatchesStep(Step s, java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes a)voidprocessingInstruction(java.lang.String target, java.lang.String data)Filter for processingInstruction().voidskippedEntity(java.lang.String name)Filter for skippedEntity().voidstartDocument()Resets state.voidstartElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes a)Filter for startElement().voidstartPrefixMapping(java.lang.String prefix, java.lang.String uri)Filter for startPrefixMapping().-
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, notationDecl, parse, parse, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, unparsedEntityDecl, warning
-
-
-
-
Field Detail
-
steps
protected java.util.List steps
The steps in the SPath expression we use for filtering.
-
depth
private int depth
-
acceptedDepths
private java.util.Stack acceptedDepths
-
excludedDepth
private int excludedDepth
-
DEBUG
private static final boolean DEBUG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SPathFilter
public SPathFilter(Path path)
Constructs a new SPathFilter, given a Path.
-
-
Method Detail
-
init
private void init()
Initializes state used for filtering.
-
startElement
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes a) throws org.xml.sax.SAXExceptionFilter for startElement().- Specified by:
startElementin interfaceorg.xml.sax.ContentHandler- Overrides:
startElementin classorg.xml.sax.helpers.XMLFilterImpl- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXExceptionFilter for endElement().- Specified by:
endElementin interfaceorg.xml.sax.ContentHandler- Overrides:
endElementin classorg.xml.sax.helpers.XMLFilterImpl- Throws:
org.xml.sax.SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXExceptionFilter for ignoreableWhitespace().- Specified by:
ignorableWhitespacein interfaceorg.xml.sax.ContentHandler- Overrides:
ignorableWhitespacein classorg.xml.sax.helpers.XMLFilterImpl- Throws:
org.xml.sax.SAXException
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXExceptionFilter for characters().- Specified by:
charactersin interfaceorg.xml.sax.ContentHandler- Overrides:
charactersin classorg.xml.sax.helpers.XMLFilterImpl- Throws:
org.xml.sax.SAXException
-
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXExceptionFilter for startPrefixMapping().- Specified by:
startPrefixMappingin interfaceorg.xml.sax.ContentHandler- Overrides:
startPrefixMappingin classorg.xml.sax.helpers.XMLFilterImpl- Throws:
org.xml.sax.SAXException
-
endPrefixMapping
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXExceptionFilter for endPrefixMapping().- Specified by:
endPrefixMappingin interfaceorg.xml.sax.ContentHandler- Overrides:
endPrefixMappingin classorg.xml.sax.helpers.XMLFilterImpl- Throws:
org.xml.sax.SAXException
-
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXExceptionFilter for processingInstruction().- Specified by:
processingInstructionin interfaceorg.xml.sax.ContentHandler- Overrides:
processingInstructionin classorg.xml.sax.helpers.XMLFilterImpl- Throws:
org.xml.sax.SAXException
-
skippedEntity
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXExceptionFilter for skippedEntity().- Specified by:
skippedEntityin interfaceorg.xml.sax.ContentHandler- Overrides:
skippedEntityin classorg.xml.sax.helpers.XMLFilterImpl- Throws:
org.xml.sax.SAXException
-
startDocument
public void startDocument()
Resets state.- Specified by:
startDocumentin interfaceorg.xml.sax.ContentHandler- Overrides:
startDocumentin classorg.xml.sax.helpers.XMLFilterImpl
-
nodeMatchesStep
public static boolean nodeMatchesStep(Step s, java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes a)
-
isAccepted
private boolean isAccepted()
Returns true if events should be passed through, false otherwise.
-
isExcluded
private boolean isExcluded()
Returns true if events should be blocked, false otherwise.
-
-