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. |
|
XMLFilterImpl(parent: XMLReader!) 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 |
endPrefixMapping(prefix: String!) Filter an end Namespace prefix mapping event. |
open Unit |
error(e: SAXParseException!) 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 |
getFeature(name: String!) Look up the value of a feature. |
open XMLReader! |
Get the parent reader. |
open Any! |
getProperty(name: String!) 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 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 |
setContentHandler(handler: ContentHandler!) Set the content event handler. |
open Unit |
setDTDHandler(handler: DTDHandler!) Set the DTD event handler. |
open Unit |
setDocumentLocator(locator: Locator!) Filter a new document locator event. |
open Unit |
setEntityResolver(resolver: EntityResolver!) Set the entity resolver. |
open Unit |
setErrorHandler(handler: ErrorHandler!) Set the error event handler. |
open Unit |
setFeature(name: String!, value: Boolean) Set the value of a feature. |
open Unit |
Set the parent reader. |
open Unit |
setProperty(name: String!, value: Any!) Set the value of a property. |
open Unit |
skippedEntity(name: String!) 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 |
warning(e: SAXParseException!) Filter a warning event. |
Public constructors
XMLFilterImpl
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
XMLFilterImpl(parent: XMLReader!)
Construct an XML filter with the specified parent.
Parameters | |
---|---|
parent |
XMLReader!: the XML reader from which this filter receives its events. |
See Also
Public methods
characters
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
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
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
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
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
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
open fun getContentHandler(): ContentHandler!
Get the content event handler.
Return | |
---|---|
ContentHandler! |
The current content handler, or null if none was set. |
getDTDHandler
open fun getDTDHandler(): DTDHandler!
Get the current DTD event handler.
Return | |
---|---|
DTDHandler! |
The current DTD handler, or null if none was set. |
getEntityResolver
open fun getEntityResolver(): EntityResolver!
Get the current entity resolver.
Return | |
---|---|
EntityResolver! |
The current entity resolver, or null if none was set. |
getErrorHandler
open fun getErrorHandler(): ErrorHandler!
Get the current error event handler.
Return | |
---|---|
ErrorHandler! |
The current error handler, or null if none was set. |
getFeature
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
open fun getParent(): XMLReader!
Get the parent reader.
Return | |
---|---|
XMLReader! |
The parent XML reader, or null if none is set. |
See Also
getProperty
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
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
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
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
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
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
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
open fun setContentHandler(handler: ContentHandler!): Unit
Set the content event handler.
Parameters | |
---|---|
handler |
ContentHandler!: the new content handler |
setDTDHandler
open fun setDTDHandler(handler: DTDHandler!): Unit
Set the DTD event handler.
Parameters | |
---|---|
handler |
DTDHandler!: the new DTD handler |
setDocumentLocator
open fun setDocumentLocator(locator: Locator!): Unit
Filter a new document locator event.
Parameters | |
---|---|
locator |
Locator!: The document locator. |
setEntityResolver
open fun setEntityResolver(resolver: EntityResolver!): Unit
Set the entity resolver.
Parameters | |
---|---|
resolver |
EntityResolver!: The new entity resolver. |
setErrorHandler
open fun setErrorHandler(handler: ErrorHandler!): Unit
Set the error event handler.
Parameters | |
---|---|
handler |
ErrorHandler!: the new error handler |
setFeature
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
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
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
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
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
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
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
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
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. |