|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.XMLFilterImpl | +--net.sourceforge.saxadapter.SAXAdapter
This utility allows handlers to register and then parses an XML input source using the SAX2 spec and calls the appropriate callbacks on registered handlers.
Inner Class Summary | |
(package private) class |
SAXAdapter.NamespaceContextImpl
This class wraps the NamespaceSupport object |
Constructor Summary | |
SAXAdapter()
Default constructor which creates an XMLReader based on the SAX2 bootstrap mechanism |
|
SAXAdapter(java.lang.String argReaderClass)
Creates an XMLReader with the supplied XMLReader implementation class |
|
SAXAdapter(org.xml.sax.XMLReader argReader)
Sets the specified XMLReader as the parent of this XMLFilter |
Method Summary | |
void |
attributeDecl(java.lang.String eName,
java.lang.String aName,
java.lang.String type,
java.lang.String valueDefault,
java.lang.String value)
|
void |
characters(char[] ch,
int start,
int length)
|
void |
comment(char[] ch,
int start,
int length)
|
void |
elementDecl(java.lang.String name,
java.lang.String model)
|
void |
endCDATA()
|
void |
endDocument()
|
void |
endDTD()
|
void |
endElement(java.lang.String argNamespaceURI,
java.lang.String argLocalName,
java.lang.String argQName)
|
void |
endEntity(java.lang.String name)
|
void |
endPrefixMapping(java.lang.String prefix)
|
void |
error(org.xml.sax.SAXParseException argExc)
|
void |
externalEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
|
void |
fatalError(org.xml.sax.SAXParseException argExc)
|
org.xml.sax.ContentHandler |
getContentHandler()
|
org.xml.sax.Locator |
getDocumentLocator()
This method allows client code to obtain the Locator for parsing events that may indicate application errors but not XML syntax errors |
org.xml.sax.ErrorHandler |
getErrorHandler()
|
int |
getNamespaceMode()
Returns the XML namespace awareness mode set on the parent parser |
java.lang.Object |
getProperty(java.lang.String argPropURI)
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
void |
internalEntityDecl(java.lang.String name,
java.lang.String value)
|
void |
parse(org.xml.sax.InputSource argInputSource)
Parse the XML doc in the InputSource |
java.util.Map |
parse(org.xml.sax.InputSource argInputSource,
java.util.Map argContextMap)
Parse the XML doc in the InputStream
and use the passed in Map |
void |
parse(java.lang.String systemId)
|
java.util.Map |
parse(java.lang.String systemId,
java.util.Map argMap)
|
void |
processingInstruction(java.lang.String target,
java.lang.String data)
|
void |
registerDefaultHandler(SAXTagHandler argHandler)
Registers a handler that is invoked whenever no other handler is found that can handle a given tag |
void |
registerDefaultHandler(java.lang.String argNamespace,
SAXTagHandler argHandler)
Registers a handler that is invoked whenever no other handler is found that can handle a given tag in the specified namespace |
void |
registerHandler(java.lang.String argQName,
SAXTagHandler argHandler)
Registers a handler using the qualified name (used when parser is not namespace aware) |
void |
registerHandler(java.lang.String argTagNamespace,
java.lang.String argLocalTagName,
SAXTagHandler argHandler)
Registers a handler based on the tag namespace and unqualified tag name |
void |
reset()
This method resets all internal state including registered handlers of all types. |
void |
setContentHandler(org.xml.sax.ContentHandler argHandler)
|
void |
setDocumentLocator(org.xml.sax.Locator locator)
|
void |
setErrorHandler(org.xml.sax.ErrorHandler argErrorHandler)
Registers a custom error handler to deal with parsing errors. |
void |
setMap(java.util.Map argMap)
This method allows the context map to be set if it cannot be set through parse (i.e. |
void |
setMaxBufferSize(int argMaxBufferSize)
This method allows the maximum buffer size to be set for this instance. |
void |
setNamespaceMode(int argMode)
Determines the settings from the two SAX namespace flags This is a convenience method and the same effect can be achieved by setting the features flags through setFeature(). |
(package private) void |
setParentState(org.xml.sax.XMLReader argParent)
Sets this object as the implementor of DeclHandler and/or LexicalHandler if those handlers have been previously set |
void |
setProperty(java.lang.String argPropURI,
java.lang.Object argValue)
Sets a property on the parser (for setting vendor specific properties) |
void |
setValidating(boolean argBool)
Controls whether the SAX parser will validate the XML document Convenience method to set the SAX validating feature |
void |
skippedEntity(java.lang.String name)
|
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
|
void |
startElement(java.lang.String argNamespaceURI,
java.lang.String argLocalName,
java.lang.String argQName,
org.xml.sax.Attributes argAtts)
|
void |
startEntity(java.lang.String name)
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
|
void |
warning(org.xml.sax.SAXParseException argExc)
|
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl |
getDTDHandler, getEntityResolver, getFeature, getParent, notationDecl, resolveEntity, setDTDHandler, setEntityResolver, setFeature, setParent, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public SAXAdapter() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- public SAXAdapter(java.lang.String argReaderClass) throws org.xml.sax.SAXException
argReaderClass
- the fully-qualified classname of the XMLReader implorg.xml.sax.SAXException
- public SAXAdapter(org.xml.sax.XMLReader argReader) throws org.xml.sax.SAXException
argReader
- the XMLReader that will be the parent of the adapterorg.xml.sax.SAXException
- Method Detail |
public void registerHandler(java.lang.String argTagNamespace, java.lang.String argLocalTagName, SAXTagHandler argHandler)
argTagNamespace
- tag namespace URIargLocalTagName
- unqualified tag nameargHandler
- the handler to registerpublic void registerHandler(java.lang.String argQName, SAXTagHandler argHandler)
argQName
- qualified nameargHandler
- handler to be registeredpublic void registerDefaultHandler(SAXTagHandler argHandler)
argHandler
- default handler to be registeredpublic void registerDefaultHandler(java.lang.String argNamespace, SAXTagHandler argHandler)
argNamespace
- the namespace defined for this default handlerargHandler
- default handler to be registeredpublic void setValidating(boolean argBool) throws org.xml.sax.SAXException
argBool
- the value to setorg.xml.sax.SAXException
- public void setNamespaceMode(int argMode) throws org.xml.sax.SAXException
argMode
- the namespace awareness mode to be usedorg.xml.sax.SAXException
- public int getNamespaceMode() throws org.xml.sax.SAXException
org.xml.sax.SAXException
- public void reset()
public org.xml.sax.Locator getDocumentLocator()
public void setMap(java.util.Map argMap)
argMap
- the context Map to be used during parsingpublic void setMaxBufferSize(int argMaxBufferSize)
argMaxBufferSize
- the maximum size of the internal StringBuffer
to be maintained between document parse eventspublic java.util.Map parse(org.xml.sax.InputSource argInputSource, java.util.Map argContextMap) throws org.xml.sax.SAXException, java.io.IOException
InputStream
and use the passed in MapargInputSource
- input source to be parsedargContextMap
- the map to be passed to the handlersjava.io.IOException
- org.xml.sax.SAXException
- public java.util.Map parse(java.lang.String systemId, java.util.Map argMap) throws java.io.IOException, org.xml.sax.SAXException
public void parse(org.xml.sax.InputSource argInputSource) throws org.xml.sax.SAXException, java.io.IOException
InputSource
parse
in class org.xml.sax.helpers.XMLFilterImpl
argInputSource
- input source to be parsedjava.io.IOException
- org.xml.sax.SAXException
- public void parse(java.lang.String systemId) throws java.io.IOException, org.xml.sax.SAXException
parse
in class org.xml.sax.helpers.XMLFilterImpl
public void setErrorHandler(org.xml.sax.ErrorHandler argErrorHandler)
setErrorHandler
in class org.xml.sax.helpers.XMLFilterImpl
argErrorHandler
- the error handler to be registeredpublic org.xml.sax.ErrorHandler getErrorHandler()
getErrorHandler
in class org.xml.sax.helpers.XMLFilterImpl
public void setContentHandler(org.xml.sax.ContentHandler argHandler)
setContentHandler
in class org.xml.sax.helpers.XMLFilterImpl
public org.xml.sax.ContentHandler getContentHandler()
getContentHandler
in class org.xml.sax.helpers.XMLFilterImpl
public void setProperty(java.lang.String argPropURI, java.lang.Object argValue) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
setProperty
in class org.xml.sax.helpers.XMLFilterImpl
argPropURI
- URI of the property (see Megginson list)argValue
- Property valueorg.xml.sax.SAXNotRecognizedException
- org.xml.sax.SAXNotSupportedException
- public java.lang.Object getProperty(java.lang.String argPropURI) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
getProperty
in class org.xml.sax.helpers.XMLFilterImpl
public void startElement(java.lang.String argNamespaceURI, java.lang.String argLocalName, java.lang.String argQName, org.xml.sax.Attributes argAtts) throws org.xml.sax.SAXException
startElement
in class org.xml.sax.helpers.XMLFilterImpl
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in class org.xml.sax.helpers.XMLFilterImpl
public void endElement(java.lang.String argNamespaceURI, java.lang.String argLocalName, java.lang.String argQName) throws org.xml.sax.SAXException
endElement
in class org.xml.sax.helpers.XMLFilterImpl
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
startPrefixMapping
in class org.xml.sax.helpers.XMLFilterImpl
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException
endPrefixMapping
in class org.xml.sax.helpers.XMLFilterImpl
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
ignorableWhitespace
in class org.xml.sax.helpers.XMLFilterImpl
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
processingInstruction
in class org.xml.sax.helpers.XMLFilterImpl
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in class org.xml.sax.helpers.XMLFilterImpl
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
skippedEntity
in class org.xml.sax.helpers.XMLFilterImpl
public void startDocument() throws org.xml.sax.SAXException
startDocument
in class org.xml.sax.helpers.XMLFilterImpl
public void endDocument() throws org.xml.sax.SAXException
endDocument
in class org.xml.sax.helpers.XMLFilterImpl
public void error(org.xml.sax.SAXParseException argExc) throws org.xml.sax.SAXException
error
in class org.xml.sax.helpers.XMLFilterImpl
public void fatalError(org.xml.sax.SAXParseException argExc) throws org.xml.sax.SAXException
fatalError
in class org.xml.sax.helpers.XMLFilterImpl
public void warning(org.xml.sax.SAXParseException argExc) throws org.xml.sax.SAXException
warning
in class org.xml.sax.helpers.XMLFilterImpl
public void attributeDecl(java.lang.String eName, java.lang.String aName, java.lang.String type, java.lang.String valueDefault, java.lang.String value) throws org.xml.sax.SAXException
attributeDecl
in interface org.xml.sax.ext.DeclHandler
public void elementDecl(java.lang.String name, java.lang.String model) throws org.xml.sax.SAXException
elementDecl
in interface org.xml.sax.ext.DeclHandler
public void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
externalEntityDecl
in interface org.xml.sax.ext.DeclHandler
public void internalEntityDecl(java.lang.String name, java.lang.String value) throws org.xml.sax.SAXException
internalEntityDecl
in interface org.xml.sax.ext.DeclHandler
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException
comment
in interface org.xml.sax.ext.LexicalHandler
public void startCDATA() throws org.xml.sax.SAXException
startCDATA
in interface org.xml.sax.ext.LexicalHandler
public void endCDATA() throws org.xml.sax.SAXException
endCDATA
in interface org.xml.sax.ext.LexicalHandler
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
startDTD
in interface org.xml.sax.ext.LexicalHandler
public void endDTD() throws org.xml.sax.SAXException
endDTD
in interface org.xml.sax.ext.LexicalHandler
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException
startEntity
in interface org.xml.sax.ext.LexicalHandler
public void endEntity(java.lang.String name) throws org.xml.sax.SAXException
endEntity
in interface org.xml.sax.ext.LexicalHandler
void setParentState(org.xml.sax.XMLReader argParent) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
argParent
- the parent XMLReader with which the handlers
may be registeredorg.xml.sax.SAXNotRecognizedException
- org.xml.sax.SAXNotSupportedException
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |