|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.qedeq.kernel.xml.handler.common.SimpleHandler
org.qedeq.kernel.xml.handler.common.SaxDefaultHandler
public class SaxDefaultHandler
Default SAX handler. Delegates SAX events to a
AbstractSimpleHandler
which could also delegate events to other
AbstractSimpleHandler
s.
Before anything is parsed the method setExceptionList(SourceFileExceptionList)
must be called.
Constructor Summary | |
---|---|
SaxDefaultHandler(ModuleService plugin)
Constructor. |
Method Summary | |
---|---|
void |
changeHandler(AbstractSimpleHandler newHandler,
java.lang.String elementName,
SimpleAttributes attributes)
Change current handler to new one. |
void |
characters(char[] ch,
int start,
int length)
|
org.xml.sax.SAXParseException |
createSAXParseException(java.lang.Exception e)
Wraps exception in new SAXParseException including parsing position information. |
org.xml.sax.SAXParseException |
createSAXParseException(java.lang.String message)
Creates new SAXParseException including parsing position information. |
SourceArea |
createSourceArea()
Create current source area. |
void |
endDocument()
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
int |
getLevel()
Get current level. |
ModuleService |
getPlugin()
Get plugin we work for. |
void |
setBasisDocumentHandler(AbstractSimpleHandler handler)
Set basis handler for documents. |
void |
setExceptionList(SourceFileExceptionList errorList)
Set parse exception list. |
void |
startDocument()
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes amap)
|
Methods inherited from class org.qedeq.kernel.xml.handler.common.SimpleHandler |
---|
getEncoding, getLocator, getUrl, setDocumentLocator, setUrl |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SaxDefaultHandler(ModuleService plugin)
plugin
- The plugin we work for.Method Detail |
---|
public void setExceptionList(SourceFileExceptionList errorList)
errorList
- Collect errors here.public final void setBasisDocumentHandler(AbstractSimpleHandler handler)
handler
- Basis handler for documents. This handler might also pass control to
another handler via the
AbstractSimpleHandler.changeHandler(AbstractSimpleHandler, String, SimpleAttributes)
method.public final void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public final void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public final void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes amap) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public final void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public final void characters(char[] ch, int start, int length)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
public final void changeHandler(AbstractSimpleHandler newHandler, java.lang.String elementName, SimpleAttributes attributes) throws XmlSyntaxException
AbstractSimpleHandler.init()
.
The new handler also gets a AbstractSimpleHandler.startElement(String,
SimpleAttributes)
event.
The current handler is stacked. After the new handler gets the appropriate endElement
event, the control is switched back to the old handler.
The switch back is also done, if the tag level gets back to the same number. That means
if for example the new handler starts with the <banana>
tag, the
old handler is restored when the misspelled </bnana>
tag occurs:
<banana> <one /> <two > <one /> <one /> </two > </bnana>
newHandler
- This handler gets the new events.elementName
- Element name.attributes
- Element attributes.
XmlSyntaxException
- New Handler detected a semantic problem.public final int getLevel()
public final org.xml.sax.SAXParseException createSAXParseException(java.lang.Exception e)
SAXParseException
including parsing position information.
e
- Exception to wrap.
public final org.xml.sax.SAXParseException createSAXParseException(java.lang.String message)
SAXParseException
including parsing position information.
message
- Problem description.
public final SourceArea createSourceArea()
public ModuleService getPlugin()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |