Stay organized with collections
Save and categorize content based on your preferences.
XMLFilter
public
interface
XMLFilter
implements
XMLReader
Known indirect subclasses
|
Interface for an XML filter.
This module, both source code and documentation, is in the
Public Domain, and comes with NO WARRANTY.
See http://www.saxproject.org
for further information.
An XML filter is like an XML reader, except that it obtains its
events from another XML reader rather than a primary source like
an XML document or database. Filters can modify a stream of
events as they pass on to the final application.
The XMLFilterImpl helper class provides a convenient base
for creating SAX2 filters, by passing on all EntityResolver
, DTDHandler
,
ContentHandler
and ErrorHandler
events automatically.
Summary
Public methods
getParent
public abstract XMLReader getParent ()
Get the parent reader.
This method allows the application to query the parent
reader (which may be another filter). It is generally a
bad idea to perform any operations on the parent reader
directly: they should all pass through this filter.
Returns |
XMLReader |
The parent filter, or null if none has been set. |
setParent
public abstract void setParent (XMLReader parent)
Set the parent reader.
This method allows the application to link the filter to
a parent reader (which may be another filter). The argument
may not be null.
Parameters |
parent |
XMLReader : The parent reader. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# XMLFilter\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nXMLFilter\n=========\n\n\n`\npublic\n\n\ninterface\nXMLFilter\n`\n\n\n`\n\n\nimplements\n\n`[XMLReader](/reference/org/xml/sax/XMLReader)`\n\n\n`\n\n|-----------------------|\n| org.xml.sax.XMLFilter |\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [XMLFilterImpl](/reference/org/xml/sax/helpers/XMLFilterImpl) |---------------------------------------------------------------|----------------------------------------| | [XMLFilterImpl](/reference/org/xml/sax/helpers/XMLFilterImpl) | Base class for deriving an XML filter. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface for an XML filter.\n\n\u003e *This module, both source code and documentation, is in the\n\u003e Public Domain, and comes with **NO WARRANTY**.* See \u003chttp://www.saxproject.org\u003e for further information.\n\nAn XML filter is like an XML reader, except that it obtains its\nevents from another XML reader rather than a primary source like\nan XML document or database. Filters can modify a stream of\nevents as they pass on to the final application.\n\nThe XMLFilterImpl helper class provides a convenient base\nfor creating SAX2 filters, by passing on all [EntityResolver](/reference/org/xml/sax/EntityResolver), [DTDHandler](/reference/org/xml/sax/DTDHandler),\n[ContentHandler](/reference/org/xml/sax/ContentHandler) and [ErrorHandler](/reference/org/xml/sax/ErrorHandler) events automatically.\n\n\u003cbr /\u003e\n\n**See also:**\n\n- [XMLFilterImpl](/reference/org/xml/sax/helpers/XMLFilterImpl)\n\nSummary\n-------\n\n| ### Public methods ||\n|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[XMLReader](/reference/org/xml/sax/XMLReader) | ` `[getParent](/reference/org/xml/sax/XMLFilter#getParent())`() ` Get the parent reader. |\n| ` abstract void` | ` `[setParent](/reference/org/xml/sax/XMLFilter#setParent(org.xml.sax.XMLReader))`(`[XMLReader](/reference/org/xml/sax/XMLReader)` parent) ` Set the parent reader. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[org.xml.sax.XMLReader](/reference/org/xml/sax/XMLReader)` ` |---------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[ContentHandler](/reference/org/xml/sax/ContentHandler) | ` `[getContentHandler](/reference/org/xml/sax/XMLReader#getContentHandler())`() ` Return the current content handler. | | ` abstract `[DTDHandler](/reference/org/xml/sax/DTDHandler) | ` `[getDTDHandler](/reference/org/xml/sax/XMLReader#getDTDHandler())`() ` Return the current DTD handler. | | ` abstract `[EntityResolver](/reference/org/xml/sax/EntityResolver) | ` `[getEntityResolver](/reference/org/xml/sax/XMLReader#getEntityResolver())`() ` Return the current entity resolver. | | ` abstract `[ErrorHandler](/reference/org/xml/sax/ErrorHandler) | ` `[getErrorHandler](/reference/org/xml/sax/XMLReader#getErrorHandler())`() ` Return the current error handler. | | ` abstract boolean` | ` `[getFeature](/reference/org/xml/sax/XMLReader#getFeature(java.lang.String))`(`[String](/reference/java/lang/String)` name) ` Look up the value of a feature flag. | | ` abstract `[Object](/reference/java/lang/Object) | ` `[getProperty](/reference/org/xml/sax/XMLReader#getProperty(java.lang.String))`(`[String](/reference/java/lang/String)` name) ` Look up the value of a property. | | ` abstract void` | ` `[parse](/reference/org/xml/sax/XMLReader#parse(org.xml.sax.InputSource))`(`[InputSource](/reference/org/xml/sax/InputSource)` input) ` Parse an XML document. | | ` abstract void` | ` `[parse](/reference/org/xml/sax/XMLReader#parse(java.lang.String))`(`[String](/reference/java/lang/String)` systemId) ` Parse an XML document from a system identifier (URI). | | ` abstract void` | ` `[setContentHandler](/reference/org/xml/sax/XMLReader#setContentHandler(org.xml.sax.ContentHandler))`(`[ContentHandler](/reference/org/xml/sax/ContentHandler)` handler) ` Allow an application to register a content event handler. | | ` abstract void` | ` `[setDTDHandler](/reference/org/xml/sax/XMLReader#setDTDHandler(org.xml.sax.DTDHandler))`(`[DTDHandler](/reference/org/xml/sax/DTDHandler)` handler) ` Allow an application to register a DTD event handler. | | ` abstract void` | ` `[setEntityResolver](/reference/org/xml/sax/XMLReader#setEntityResolver(org.xml.sax.EntityResolver))`(`[EntityResolver](/reference/org/xml/sax/EntityResolver)` resolver) ` Allow an application to register an entity resolver. | | ` abstract void` | ` `[setErrorHandler](/reference/org/xml/sax/XMLReader#setErrorHandler(org.xml.sax.ErrorHandler))`(`[ErrorHandler](/reference/org/xml/sax/ErrorHandler)` handler) ` Allow an application to register an error event handler. | | ` abstract void` | ` `[setFeature](/reference/org/xml/sax/XMLReader#setFeature(java.lang.String,%20boolean))`(`[String](/reference/java/lang/String)` name, boolean value) ` Set the value of a feature flag. | | ` abstract void` | ` `[setProperty](/reference/org/xml/sax/XMLReader#setProperty(java.lang.String,%20java.lang.Object))`(`[String](/reference/java/lang/String)` name, `[Object](/reference/java/lang/Object)` value) ` Set the value of a property. | ||\n\nPublic methods\n--------------\n\n### getParent\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract XMLReader getParent ()\n```\n\nGet the parent reader.\n\nThis method allows the application to query the parent\nreader (which may be another filter). It is generally a\nbad idea to perform any operations on the parent reader\ndirectly: they should all pass through this filter.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------------------------------------------|---------------------------------------------------------|\n| [XMLReader](/reference/org/xml/sax/XMLReader) | The parent filter, or null if none has been set. \u003cbr /\u003e |\n\n### setParent\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void setParent (XMLReader parent)\n```\n\nSet the parent reader.\n\nThis method allows the application to link the filter to\na parent reader (which may be another filter). The argument\nmay not be null.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|----------------------------------------|\n| `parent` | `XMLReader`: The parent reader. \u003cbr /\u003e |"]]