|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microstar.xml.SAXDriver
public class SAXDriver
A SAX driver for Microstar's Ælfred XML parser.
This driver acts as a front-end for Ælfred, and translates Ælfred's events into SAX events. It implements the SAX parser interface, and you can use it without directly calling Ælfred at all:
org.xml.sax.Parser parser = new com.microstar.xml.SAXDriver();
When you are using SAX, you do not need to use the
XmlParser
or XmlHandler
classes at
all: this class is your entry point.
This driver is based on the 1.0gamma version of SAX, available from http://www.megginson.com/SAX/
XmlParser
Constructor Summary | |
---|---|
SAXDriver()
|
Method Summary | |
---|---|
void |
attribute(java.lang.String aname,
java.lang.String value,
boolean isSpecified)
Implement com.microstar.xml.XmlHandler#attribute. |
void |
charData(char[] ch,
int start,
int length)
Implement com.microstar.xml.XmlHandler#charData. |
void |
doctypeDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Implement com.microstar.xml.XmlHandler#doctypeDecl. |
void |
endDocument()
Implement com.microstar.xml.XmlHandler#endDocument. |
void |
endElement(java.lang.String elname)
Implement com.microstar.xml.XmlHandler#endElement. |
void |
endExternalEntity(java.lang.String systemId)
Implement com.microstar.xml.XmlHandler#endExternalEntity. |
void |
error(java.lang.String message,
java.lang.String url,
int line,
int column)
Implement com.microstar.xml.XmlHandler#error. |
int |
getColumnNumber()
|
int |
getLength()
|
int |
getLineNumber()
|
java.lang.String |
getName(int i)
|
java.lang.String |
getPublicId()
|
java.lang.String |
getSystemId()
|
java.lang.String |
getType(int i)
|
java.lang.String |
getType(java.lang.String name)
|
java.lang.String |
getValue(int i)
|
java.lang.String |
getValue(java.lang.String name)
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Implement com.microstar.xml.XmlHandler#ignorableWhitespace. |
void |
parse(org.xml.sax.InputSource source)
Parse a document. |
void |
parse(java.lang.String systemId)
Parse an XML document from a system identifier (URI). |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Implement com.microstar.xml.XmlHandler#processingInstruction. |
java.lang.Object |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Implement com.microstar.xml.XmlHandler.resolveSystemId |
void |
setDocumentHandler(org.xml.sax.DocumentHandler handler)
Set the document handler for this parser. |
void |
setDTDHandler(org.xml.sax.DTDHandler handler)
Set the DTD handler for this parser. |
void |
setEntityResolver(org.xml.sax.EntityResolver resolver)
Set the entity resolver for this parser. |
void |
setErrorHandler(org.xml.sax.ErrorHandler handler)
Set the error handler for this parser. |
void |
setLocale(java.util.Locale locale)
Set the locale. |
void |
startDocument()
Implement com.microstar.xml.XmlHandler#startDocument. |
void |
startElement(java.lang.String elname)
Implement com.microstar.xml.XmlHandler#startElement. |
void |
startExternalEntity(java.lang.String systemId)
Implement com.microstar.xml.XmlHandler#startExternalEntity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SAXDriver()
Method Detail |
---|
public void setLocale(java.util.Locale locale) throws org.xml.sax.SAXException
setLocale
in interface org.xml.sax.Parser
org.xml.sax.SAXException
public void setEntityResolver(org.xml.sax.EntityResolver resolver)
setEntityResolver
in interface org.xml.sax.Parser
resolver
- The object to receive entity events.public void setDTDHandler(org.xml.sax.DTDHandler handler)
setDTDHandler
in interface org.xml.sax.Parser
handler
- The object to receive DTD events.public void setDocumentHandler(org.xml.sax.DocumentHandler handler)
setDocumentHandler
in interface org.xml.sax.Parser
handler
- The object to receive document events.public void setErrorHandler(org.xml.sax.ErrorHandler handler)
setErrorHandler
in interface org.xml.sax.Parser
handler
- The object to receive error events.public void parse(org.xml.sax.InputSource source) throws org.xml.sax.SAXException
If you want anything useful to happen, you should set at least one type of handler.
parse
in interface org.xml.sax.Parser
source
- The XML input source.
org.xml.sax.SAXException
- The handlers may throw any exception.setEntityResolver(org.xml.sax.EntityResolver)
,
setDTDHandler(org.xml.sax.DTDHandler)
,
setDocumentHandler(org.xml.sax.DocumentHandler)
,
setErrorHandler(org.xml.sax.ErrorHandler)
public void parse(java.lang.String systemId) throws org.xml.sax.SAXException
parse
in interface org.xml.sax.Parser
org.xml.sax.SAXException
public void startDocument() throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
startDocument
in interface XmlHandler
org.xml.sax.SAXException
- May throw any exception.XmlHandler.startDocument()
public void endDocument() throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
endDocument
in interface XmlHandler
org.xml.sax.SAXException
- May throw any exception.XmlHandler.endDocument()
public java.lang.Object resolveEntity(java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException, java.io.IOException
Translate to the SAX interface.
Users should never invoke this method directly.
resolveEntity
in interface XmlHandler
publicId
- The public identifier, or null if none was supplied.systemId
- The system identifier.
org.xml.sax.SAXException
- May throw any exception.
java.io.IOException
XmlHandler.resolveEntity(java.lang.String, java.lang.String)
public void startExternalEntity(java.lang.String systemId) throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
startExternalEntity
in interface XmlHandler
systemId
- The URI of the external entity that is starting.
org.xml.sax.SAXException
- May throw any exception.XmlHandler.startExternalEntity(java.lang.String)
public void endExternalEntity(java.lang.String systemId) throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
endExternalEntity
in interface XmlHandler
systemId
- The URI of the external entity that is ending.
org.xml.sax.SAXException
- May throw any exception.XmlHandler.endExternalEntity(java.lang.String)
public void doctypeDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
doctypeDecl
in interface XmlHandler
name
- The document type name.publicId
- The public identifier, or null if unspecified.systemId
- The system identifier, or null if unspecified.
org.xml.sax.SAXException
- May throw any exception.XmlHandler.doctypeDecl(java.lang.String, java.lang.String, java.lang.String)
public void attribute(java.lang.String aname, java.lang.String value, boolean isSpecified) throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
attribute
in interface XmlHandler
aname
- The name of the attribute.value
- The value of the attribute, or null if the attribute
is #IMPLIED
.isSpecified
- True if the value was specified, false if it
was defaulted from the DTD.
org.xml.sax.SAXException
- May throw any exception.XmlHandler.attribute(java.lang.String, java.lang.String, boolean)
public void startElement(java.lang.String elname) throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
startElement
in interface XmlHandler
elname
- The element type name.
org.xml.sax.SAXException
- May throw any exception.XmlHandler.startElement(java.lang.String)
public void endElement(java.lang.String elname) throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
endElement
in interface XmlHandler
elname
- The element type name.
org.xml.sax.SAXException
- May throw any exception.XmlHandler.endElement(java.lang.String)
public void charData(char[] ch, int start, int length) throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
charData
in interface XmlHandler
ch
- The character data.start
- The starting position in the array.length
- The number of characters available.
org.xml.sax.SAXException
- May throw any exception.XmlHandler.charData(char[], int, int)
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
ignorableWhitespace
in interface XmlHandler
ch
- The literal whitespace characters.start
- The starting position in the array.length
- The number of whitespace characters available.
org.xml.sax.SAXException
- May throw any exception.XmlHandler.ignorableWhitespace(char[], int, int)
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
processingInstruction
in interface XmlHandler
target
- The target (the name at the start of the PI).data
- The data, if any (the rest of the PI).
org.xml.sax.SAXException
- May throw any exception.XmlHandler.processingInstruction(java.lang.String, java.lang.String)
public void error(java.lang.String message, java.lang.String url, int line, int column) throws org.xml.sax.SAXException
Translate to the SAX interface.
Users should never invoke this method directly.
error
in interface XmlHandler
message
- The error message.url
- The system identifier of the entity that
contains the error.line
- The approximate line number of the error.column
- The approximate column number of the error.
org.xml.sax.SAXException
- May throw any exception.XmlHandler.error(java.lang.String, java.lang.String, int, int)
public int getLength()
getLength
in interface org.xml.sax.AttributeList
public java.lang.String getName(int i)
getName
in interface org.xml.sax.AttributeList
public java.lang.String getType(int i)
getType
in interface org.xml.sax.AttributeList
public java.lang.String getValue(int i)
getValue
in interface org.xml.sax.AttributeList
public java.lang.String getType(java.lang.String name)
getType
in interface org.xml.sax.AttributeList
public java.lang.String getValue(java.lang.String name)
getValue
in interface org.xml.sax.AttributeList
public java.lang.String getPublicId()
getPublicId
in interface org.xml.sax.Locator
public java.lang.String getSystemId()
getSystemId
in interface org.xml.sax.Locator
public int getLineNumber()
getLineNumber
in interface org.xml.sax.Locator
public int getColumnNumber()
getColumnNumber
in interface org.xml.sax.Locator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |