Driver
open class Driver : Locator, XMLReader, Attributes
SAX2 Driver that pulls events from XmlPullParser and converts them into SAX2 callbacks.
Summary
Constants
APACHE_DYNAMIC_VALIDATION_FEATURE
protected static val APACHE_DYNAMIC_VALIDATION_FEATURE: String
Value: "http://apache.org/xml/features/validation/dynamic"
APACHE_SCHEMA_VALIDATION_FEATURE
protected static val APACHE_SCHEMA_VALIDATION_FEATURE: String
Value: "http://apache.org/xml/features/validation/schema"
DECLARATION_HANDLER_PROPERTY
protected static val DECLARATION_HANDLER_PROPERTY: String
Value: "http://xml.org/sax/properties/declaration-handler"
LEXICAL_HANDLER_PROPERTY
protected static val LEXICAL_HANDLER_PROPERTY: String
Value: "http://xml.org/sax/properties/lexical-handler"
NAMESPACES_FEATURE
protected static val NAMESPACES_FEATURE: String
Value: "http://xml.org/sax/features/namespaces"
NAMESPACE_PREFIXES_FEATURE
protected static val NAMESPACE_PREFIXES_FEATURE: String
Value: "http://xml.org/sax/features/namespace-prefixes"
VALIDATION_FEATURE
protected static val VALIDATION_FEATURE: String
Value: "http://xml.org/sax/features/validation"
Public constructors
Public methods
getColumnNumber
open fun getColumnNumber(): Int
Return |
Int |
The column number, or -1 if none is available. |
getContentHandler
open fun getContentHandler(): ContentHandler!
Return |
ContentHandler! |
The current content handler, or null if none has been registered. |
getDTDHandler
open fun getDTDHandler(): DTDHandler!
Return |
DTDHandler! |
The current DTD handler, or null if none has been registered. |
getEntityResolver
open fun getEntityResolver(): EntityResolver!
Return |
EntityResolver! |
The current entity resolver, or null if none has been registered. |
getErrorHandler
open fun getErrorHandler(): ErrorHandler!
Return |
ErrorHandler! |
The current error handler, or null if none has been registered. |
getFeature
open fun getFeature(name: String!): Boolean
Parameters |
name |
String!: The feature name, which is a fully-qualified URI. |
Return |
Boolean |
The current value of the feature (true or false). |
getIndex
open fun getIndex(
uri: String!,
localName: String!
): Int
Parameters |
uri |
String!: The Namespace URI, or the empty string if the name has no Namespace URI. |
localName |
String!: The attribute's local name. |
Return |
Int |
The index of the attribute, or -1 if it does not appear in the list. |
getIndex
open fun getIndex(qName: String!): Int
Parameters |
qName |
String!: The qualified (prefixed) name. |
Return |
Int |
The index of the attribute, or -1 if it does not appear in the list. |
getLength
open fun getLength(): Int
Return |
Int |
The number of attributes in the list. |
getLineNumber
open fun getLineNumber(): Int
Return |
Int |
The line number, or -1 if none is available. |
getLocalName
open fun getLocalName(index: Int): String!
Parameters |
index |
Int: The attribute index (zero-based). |
Return |
String! |
The local name, or the empty string if Namespace processing is not being performed, or null if the index is out of range. |
getProperty
open fun getProperty(name: String!): Any!
Parameters |
name |
String!: The property name, which is a fully-qualified URI. |
Return |
Any! |
The current value of the property. |
getPublicId
open fun getPublicId(): String!
Return |
String! |
A string containing the public identifier, or null if none is available. |
getQName
open fun getQName(index: Int): String!
Parameters |
index |
Int: The attribute index (zero-based). |
Return |
String! |
The XML qualified name, or the empty string if none is available, or null if the index is out of range. |
getSystemId
open fun getSystemId(): String!
Return |
String! |
A string containing the system identifier, or null if none is available. |
getType
open fun getType(index: Int): String!
Parameters |
index |
Int: The attribute index (zero-based). |
Return |
String! |
The attribute's type as a string, or null if the index is out of range. |
getType
open fun getType(
uri: String!,
localName: String!
): String!
Parameters |
uri |
String!: The Namespace URI, or the empty String if the name has no Namespace URI. |
localName |
String!: The local name of the attribute. |
Return |
String! |
The attribute type as a string, or null if the attribute is not in the list or if Namespace processing is not being performed. |
getType
open fun getType(qName: String!): String!
Parameters |
qName |
String!: The XML qualified name. |
Return |
String! |
The attribute type as a string, or null if the attribute is not in the list or if qualified names are not available. |
getURI
open fun getURI(index: Int): String!
Parameters |
index |
Int: The attribute index (zero-based). |
Return |
String! |
The Namespace URI, or the empty string if none is available, or null if the index is out of range. |
getValue
open fun getValue(index: Int): String!
Parameters |
index |
Int: The attribute index (zero-based). |
Return |
String! |
The attribute's value as a string, or null if the index is out of range. |
getValue
open fun getValue(
uri: String!,
localName: String!
): String!
Parameters |
uri |
String!: The Namespace URI, or the empty String if the name has no Namespace URI. |
localName |
String!: The local name of the attribute. |
Return |
String! |
The attribute value as a string, or null if the attribute is not in the list. |
getValue
open fun getValue(qName: String!): String!
Parameters |
qName |
String!: The XML qualified name. |
Return |
String! |
The attribute value as a string, or null if the attribute is not in the list or if qualified names are not available. |
parse
open fun parse(source: InputSource!): Unit
Parameters |
input |
The input source for the top-level of the XML document. |
parse
open fun parse(systemId: String!): Unit
Parameters |
systemId |
String!: The system identifier (URI). |
setFeature
open fun setFeature(
name: String!,
value: Boolean
): Unit
Parameters |
name |
String!: The feature name, which is a fully-qualified URI. |
value |
Boolean: The requested value of the feature (true or false). |
setProperty
open fun setProperty(
name: String!,
value: Any!
): Unit
Parameters |
name |
String!: The property name, which is a fully-qualified URI. |
value |
Any!: The requested value for the property. |
Protected methods
startElement
protected open fun startElement(
namespace: String!,
localName: String!,
qName: String!
): Unit
Calls startElement
on the ContentHandler
with this
driver object as the Attributes
implementation. In default implementation Attributes
object is valid only during this method call and may not be stored. Sub-classes can overwrite this method to cache attributes.
Properties
systemId
protected var systemId: String!