Added in API level 1

XMLFilterImpl

open class XMLFilterImpl : XMLFilter, EntityResolver, DTDHandler, ContentHandler, ErrorHandler
kotlin.Any
   ↳ org.xml.sax.helpers.XMLFilterImpl

Base class for deriving 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.

This class is designed to sit between an XMLReader and the client application's event handlers. By default, it does nothing but pass requests up to the reader and events on to the handlers unmodified, but subclasses can override specific methods to modify the event stream or the configuration requests as they pass through.

Summary

Public constructors

Construct an empty XML filter, with no parent.

Construct an XML filter with the specified parent.

Public methods
open Unit
characters(ch: CharArray!, start: Int, length: Int)

Filter a character data event.

open Unit

Filter an end document event.

open Unit
endElement(uri: String!, localName: String!, qName: String!)

Filter an end element event.

open Unit

Filter an end Namespace prefix mapping event.

open Unit

Filter an error event.

open Unit

Filter a fatal error event.

open ContentHandler!

Get the content event handler.

open DTDHandler!

Get the current DTD event handler.

open EntityResolver!

Get the current entity resolver.

open ErrorHandler!

Get the current error event handler.

open Boolean

Look up the value of a feature.

open XMLReader!

Get the parent reader.

open Any!

Look up the value of a property.

open Unit
ignorableWhitespace(ch: CharArray!, start: Int, length: Int)

Filter an ignorable whitespace event.

open Unit
notationDecl(name: String!, publicId: String!, systemId: String!)

Filter a notation declaration event.

open Unit
parse(input: InputSource!)

Parse a document.

open Unit
parse(systemId: String!)

Parse a document.

open Unit
processingInstruction(target: String!, data: String!)

Filter a processing instruction event.

open InputSource!
resolveEntity(publicId: String!, systemId: String!)

Filter an external entity resolution.

open Unit

Set the content event handler.

open Unit

Set the DTD event handler.

open Unit

Filter a new document locator event.

open Unit

Set the entity resolver.

open Unit

Set the error event handler.

open Unit
setFeature(name: String!, value: Boolean)

Set the value of a feature.

open Unit
setParent(parent: XMLReader!)

Set the parent reader.

open Unit
setProperty(name: String!, value: Any!)

Set the value of a property.

open Unit

Filter a skipped entity event.

open Unit

Filter a start document event.

open Unit
startElement(uri: String!, localName: String!, qName: String!, atts: Attributes!)

Filter a start element event.

open Unit
startPrefixMapping(prefix: String!, uri: String!)

Filter a start Namespace prefix mapping event.

open Unit
unparsedEntityDecl(name: String!, publicId: String!, systemId: String!, notationName: String!)

Filter an unparsed entity declaration event.

open Unit

Filter a warning event.

Public constructors

XMLFilterImpl

Added in API level 1
XMLFilterImpl()

Construct an empty XML filter, with no parent.

This filter will have no parent: you must assign a parent before you start a parse or do any configuration with setFeature or setProperty, unless you use this as a pure event consumer rather than as an XMLReader.

XMLFilterImpl

Added in API level 1
XMLFilterImpl(parent: XMLReader!)

Construct an XML filter with the specified parent.

Parameters
parent XMLReader!: the XML reader from which this filter receives its events.

Public methods

characters

Added in API level 1
open fun characters(
    ch: CharArray!,
    start: Int,
    length: Int
): Unit

Filter a character data event.

Parameters
ch CharArray!: An array of characters.
start Int: The starting position in the array.
length Int: The number of characters to use from the array.
Exceptions
org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
org.xml.sax.SAXException The client may throw an exception during processing.

endDocument

Added in API level 1
open fun endDocument(): Unit

Filter an end document event.

Exceptions
org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
org.xml.sax.SAXException The client may throw an exception during processing.

endElement

Added in API level 1
open fun endElement(
    uri: String!,
    localName: String!,
    qName: String!
): Unit

Filter an end element event.

Parameters
uri String!: The element's Namespace URI, or the empty string.
localName String!: The element's local name, or the empty string.
qName String!: The element's qualified (prefixed) name, or the empty string.
Exceptions
org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
org.xml.sax.SAXException The client may throw an exception during processing.

endPrefixMapping

Added in API level 1
open fun endPrefixMapping(prefix: String!): Unit

Filter an end Namespace prefix mapping event.

Parameters
prefix String!: The Namespace prefix.
Exceptions
org.xml.sax.SAXException the client may throw an exception during processing
org.xml.sax.SAXException The client may throw an exception during processing.

error

Added in API level 1
open fun error(e: SAXParseException!): Unit

Filter an error event.

Parameters
exception The error information encapsulated in a SAX parse exception.
e SAXParseException!: The error as an exception.
Exceptions
org.xml.sax.SAXException The client may throw an exception during processing.

fatalError

Added in API level 1
open fun fatalError(e: SAXParseException!): Unit

Filter a fatal error event.

Parameters
exception The error information encapsulated in a SAX parse exception.
e SAXParseException!: The error as an exception.
Exceptions
org.xml.sax.SAXException The client may throw an exception during processing.

getContentHandler

Added in API level 1
open fun getContentHandler(): ContentHandler!

Get the content event handler.

Return
ContentHandler! The current content handler, or null if none was set.

getDTDHandler

Added in API level 1
open fun getDTDHandler(): DTDHandler!

Get the current DTD event handler.

Return
DTDHandler! The current DTD handler, or null if none was set.

getEntityResolver

Added in API level 1
open fun getEntityResolver(): EntityResolver!

Get the current entity resolver.

Return
EntityResolver! The current entity resolver, or null if none was set.

getErrorHandler

Added in API level 1
open fun getErrorHandler(): ErrorHandler!

Get the current error event handler.

Return
ErrorHandler! The current error handler, or null if none was set.

getFeature

Added in API level 1
open fun getFeature(name: String!): Boolean

Look up the value of a feature.

This will always fail if the parent is null.

Parameters
name String!: The feature name.
Return
Boolean The current value of the feature.
Exceptions
org.xml.sax.SAXNotRecognizedException If the feature value can't be assigned or retrieved from the parent.
org.xml.sax.SAXNotSupportedException When the parent recognizes the feature name but cannot determine its value at this time.

getParent

Added in API level 1
open fun getParent(): XMLReader!

Get the parent reader.

Return
XMLReader! The parent XML reader, or null if none is set.

See Also

getProperty

Added in API level 1
open fun getProperty(name: String!): Any!

Look up the value of a property.

Parameters
name String!: The property name.
Return
Any! The current value of the property.
Exceptions
org.xml.sax.SAXNotRecognizedException If the property value can't be assigned or retrieved from the parent.
org.xml.sax.SAXNotSupportedException When the parent recognizes the property name but cannot determine its value at this time.

ignorableWhitespace

Added in API level 1
open fun ignorableWhitespace(
    ch: CharArray!,
    start: Int,
    length: Int
): Unit

Filter an ignorable whitespace event.

Parameters
ch CharArray!: An array of characters.
start Int: The starting position in the array.
length Int: The number of characters to use from the array.
Exceptions
org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
org.xml.sax.SAXException The client may throw an exception during processing.

notationDecl

Added in API level 1
open fun notationDecl(
    name: String!,
    publicId: String!,
    systemId: String!
): Unit

Filter a notation declaration event.

Parameters
name String!: The notation name.
publicId String!: The notation's public identifier, or null.
systemId String!: The notation's system identifier, or null.
Exceptions
org.xml.sax.SAXException The client may throw an exception during processing.

parse

Added in API level 1
open fun parse(input: InputSource!): Unit

Parse a document.

Parameters
input InputSource!: The input source for the document entity.
Exceptions
org.xml.sax.SAXException Any SAX exception, possibly wrapping another exception.
java.io.IOException An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.

parse

Added in API level 1
open fun parse(systemId: String!): Unit

Parse a document.

Parameters
systemId String!: The system identifier as a fully-qualified URI.
Exceptions
org.xml.sax.SAXException Any SAX exception, possibly wrapping another exception.
java.io.IOException An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.

processingInstruction

Added in API level 1
open fun processingInstruction(
    target: String!,
    data: String!
): Unit

Filter a processing instruction event.

Parameters
target String!: The processing instruction target.
data String!: The text following the target.
Exceptions
org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
org.xml.sax.SAXException The client may throw an exception during processing.

resolveEntity

Added in API level 1
open fun resolveEntity(
    publicId: String!,
    systemId: String!
): InputSource!

Filter an external entity resolution.

Parameters
publicId String!: The entity's public identifier, or null.
systemId String!: The entity's system identifier.
Return
InputSource! A new InputSource or null for the default.
Exceptions
org.xml.sax.SAXException The client may throw an exception during processing.
java.io.IOException The client may throw an I/O-related exception while obtaining the new InputSource.

setContentHandler

Added in API level 1
open fun setContentHandler(handler: ContentHandler!): Unit

Set the content event handler.

Parameters
handler ContentHandler!: the new content handler

setDTDHandler

Added in API level 1
open fun setDTDHandler(handler: DTDHandler!): Unit

Set the DTD event handler.

Parameters
handler DTDHandler!: the new DTD handler

setDocumentLocator

Added in API level 1
open fun setDocumentLocator(locator: Locator!): Unit

Filter a new document locator event.

Parameters
locator Locator!: The document locator.

setEntityResolver

Added in API level 1
open fun setEntityResolver(resolver: EntityResolver!): Unit

Set the entity resolver.

Parameters
resolver EntityResolver!: The new entity resolver.

setErrorHandler

Added in API level 1
open fun setErrorHandler(handler: ErrorHandler!): Unit

Set the error event handler.

Parameters
handler ErrorHandler!: the new error handler

setFeature

Added in API level 1
open fun setFeature(
    name: String!,
    value: Boolean
): Unit

Set the value of a feature.

This will always fail if the parent is null.

Parameters
name String!: The feature name.
value Boolean: The requested feature value.
Exceptions
org.xml.sax.SAXNotRecognizedException If the feature value can't be assigned or retrieved from the parent.
org.xml.sax.SAXNotSupportedException When the parent recognizes the feature name but cannot set the requested value.

setParent

Added in API level 1
open fun setParent(parent: XMLReader!): Unit

Set the parent reader.

This is the XMLReader from which this filter will obtain its events and to which it will pass its configuration requests. The parent may itself be another filter.

If there is no parent reader set, any attempt to parse or to set or get a feature or property will fail.

Parameters
parent XMLReader!: The parent XML reader.

See Also

setProperty

Added in API level 1
open fun setProperty(
    name: String!,
    value: Any!
): Unit

Set the value of a property.

This will always fail if the parent is null.

Parameters
name String!: The property name.
value Any!: The requested property value.
Exceptions
org.xml.sax.SAXNotRecognizedException If the property value can't be assigned or retrieved from the parent.
org.xml.sax.SAXNotSupportedException When the parent recognizes the property name but cannot set the requested value.

skippedEntity

Added in API level 1
open fun skippedEntity(name: String!): Unit

Filter a skipped entity event.

Parameters
name String!: The name of the skipped entity.
Exceptions
org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
org.xml.sax.SAXException The client may throw an exception during processing.

startDocument

Added in API level 1
open fun startDocument(): Unit

Filter a start document event.

Exceptions
org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
org.xml.sax.SAXException The client may throw an exception during processing.

startElement

Added in API level 1
open fun startElement(
    uri: String!,
    localName: String!,
    qName: String!,
    atts: Attributes!
): Unit

Filter a start element event.

Parameters
uri String!: The element's Namespace URI, or the empty string.
localName String!: The element's local name, or the empty string.
qName String!: The element's qualified (prefixed) name, or the empty string.
atts Attributes!: The element's attributes.
Exceptions
org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
org.xml.sax.SAXException The client may throw an exception during processing.

startPrefixMapping

Added in API level 1
open fun startPrefixMapping(
    prefix: String!,
    uri: String!
): Unit

Filter a start Namespace prefix mapping event.

Parameters
prefix String!: The Namespace prefix.
uri String!: The Namespace URI.
Exceptions
org.xml.sax.SAXException the client may throw an exception during processing
org.xml.sax.SAXException The client may throw an exception during processing.

unparsedEntityDecl

Added in API level 1
open fun unparsedEntityDecl(
    name: String!,
    publicId: String!,
    systemId: String!,
    notationName: String!
): Unit

Filter an unparsed entity declaration event.

Parameters
name String!: The entity name.
publicId String!: The entity's public identifier, or null.
systemId String!: The entity's system identifier, or null.
notationName String!: The name of the associated notation.
Exceptions
org.xml.sax.SAXException The client may throw an exception during processing.

warning

Added in API level 1
open fun warning(e: SAXParseException!): Unit

Filter a warning event.

Parameters
exception The warning information encapsulated in a SAX parse exception.
e SAXParseException!: The warning as an exception.
Exceptions
org.xml.sax.SAXException The client may throw an exception during processing.