Package org.xmlpull.v1.sax2
Class Driver
- java.lang.Object
-
- org.xmlpull.v1.sax2.Driver
-
- All Implemented Interfaces:
Attributes,Locator,XMLReader
public class Driver extends Object implements Locator, XMLReader, Attributes
SAX2 Driver that pulls events from XmlPullParser and comverts them into SAX2 callbacks.- Author:
- Aleksander Slominski
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringAPACHE_DYNAMIC_VALIDATION_FEATUREprotected static StringAPACHE_SCHEMA_VALIDATION_FEATUREprotected ContentHandlercontentHandlerprotected static StringDECLARATION_HANDLER_PROPERTYprotected ErrorHandlererrorHandlerprotected static StringLEXICAL_HANDLER_PROPERTYprotected static StringNAMESPACE_PREFIXES_FEATUREprotected static StringNAMESPACES_FEATUREprotected XmlPullParserppprotected StringsystemIdprotected static StringVALIDATION_FEATURE
-
Constructor Summary
Constructors Constructor Description Driver()Driver(XmlPullParser pp)
-
Method Summary
-
-
-
Field Detail
-
DECLARATION_HANDLER_PROPERTY
protected static final String DECLARATION_HANDLER_PROPERTY
- See Also:
- Constant Field Values
-
LEXICAL_HANDLER_PROPERTY
protected static final String LEXICAL_HANDLER_PROPERTY
- See Also:
- Constant Field Values
-
NAMESPACES_FEATURE
protected static final String NAMESPACES_FEATURE
- See Also:
- Constant Field Values
-
NAMESPACE_PREFIXES_FEATURE
protected static final String NAMESPACE_PREFIXES_FEATURE
- See Also:
- Constant Field Values
-
VALIDATION_FEATURE
protected static final String VALIDATION_FEATURE
- See Also:
- Constant Field Values
-
APACHE_SCHEMA_VALIDATION_FEATURE
protected static final String APACHE_SCHEMA_VALIDATION_FEATURE
- See Also:
- Constant Field Values
-
APACHE_DYNAMIC_VALIDATION_FEATURE
protected static final String APACHE_DYNAMIC_VALIDATION_FEATURE
- See Also:
- Constant Field Values
-
contentHandler
protected ContentHandler contentHandler
-
errorHandler
protected ErrorHandler errorHandler
-
systemId
protected String systemId
-
pp
protected XmlPullParser pp
-
-
Constructor Detail
-
Driver
public Driver() throws XmlPullParserException- Throws:
XmlPullParserException
-
Driver
public Driver(XmlPullParser pp) throws XmlPullParserException
- Throws:
XmlPullParserException
-
-
Method Detail
-
getLength
public int getLength()
- Specified by:
getLengthin interfaceAttributes
-
getURI
public String getURI(int index)
- Specified by:
getURIin interfaceAttributes
-
getLocalName
public String getLocalName(int index)
- Specified by:
getLocalNamein interfaceAttributes
-
getQName
public String getQName(int index)
- Specified by:
getQNamein interfaceAttributes
-
getType
public String getType(int index)
- Specified by:
getTypein interfaceAttributes
-
getValue
public String getValue(int index)
- Specified by:
getValuein interfaceAttributes
-
getIndex
public int getIndex(String uri, String localName)
- Specified by:
getIndexin interfaceAttributes
-
getIndex
public int getIndex(String qName)
- Specified by:
getIndexin interfaceAttributes
-
getType
public String getType(String uri, String localName)
- Specified by:
getTypein interfaceAttributes
-
getType
public String getType(String qName)
- Specified by:
getTypein interfaceAttributes
-
getValue
public String getValue(String uri, String localName)
- Specified by:
getValuein interfaceAttributes
-
getValue
public String getValue(String qName)
- Specified by:
getValuein interfaceAttributes
-
getPublicId
public String getPublicId()
- Specified by:
getPublicIdin interfaceLocator
-
getSystemId
public String getSystemId()
- Specified by:
getSystemIdin interfaceLocator
-
getLineNumber
public int getLineNumber()
- Specified by:
getLineNumberin interfaceLocator
-
getColumnNumber
public int getColumnNumber()
- Specified by:
getColumnNumberin interfaceLocator
-
getFeature
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException
- Specified by:
getFeaturein interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setFeature
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException
- Specified by:
setFeaturein interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
getProperty
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException
- Specified by:
getPropertyin interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setProperty
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException
- Specified by:
setPropertyin interfaceXMLReader- Throws:
SAXNotRecognizedExceptionSAXNotSupportedException
-
setEntityResolver
public void setEntityResolver(EntityResolver resolver)
- Specified by:
setEntityResolverin interfaceXMLReader
-
getEntityResolver
public EntityResolver getEntityResolver()
- Specified by:
getEntityResolverin interfaceXMLReader
-
setDTDHandler
public void setDTDHandler(DTDHandler handler)
- Specified by:
setDTDHandlerin interfaceXMLReader
-
getDTDHandler
public DTDHandler getDTDHandler()
- Specified by:
getDTDHandlerin interfaceXMLReader
-
setContentHandler
public void setContentHandler(ContentHandler handler)
- Specified by:
setContentHandlerin interfaceXMLReader
-
getContentHandler
public ContentHandler getContentHandler()
- Specified by:
getContentHandlerin interfaceXMLReader
-
setErrorHandler
public void setErrorHandler(ErrorHandler handler)
- Specified by:
setErrorHandlerin interfaceXMLReader
-
getErrorHandler
public ErrorHandler getErrorHandler()
- Specified by:
getErrorHandlerin interfaceXMLReader
-
parse
public void parse(InputSource source) throws SAXException, IOException
- Specified by:
parsein interfaceXMLReader- Throws:
SAXExceptionIOException
-
parse
public void parse(String systemId) throws SAXException, IOException
- Specified by:
parsein interfaceXMLReader- Throws:
SAXExceptionIOException
-
parseSubTree
public void parseSubTree(XmlPullParser pp) throws SAXException, IOException
- Throws:
SAXExceptionIOException
-
startElement
protected void startElement(String namespace, String localName, String qName) throws SAXException
Calls {@link ContentHandler.startElement(String, String, String, Attributes) startElement} on theContentHandlerwiththisdriver object as theAttributesimplementation. In default implementationAttributesobject is valid only during this method call and may not be stored. Sub-classes can overwrite this method to cache attributes.- Throws:
SAXException
-
-