|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.backtrack.xmlparser.XmlHandler
public class XmlHandler
The XML element handler that builds the XML tree.
Red (tfeng) |
Red (tfeng) |
Field Summary | |
---|---|
private java.util.Hashtable<java.lang.String,java.lang.String> |
_currentAttributes
The attributes of the current XML node. |
private ConfigXmlTree |
_currentTree
XML tree starting from the current node. |
private java.lang.String |
_systemId
The system ID of the XML document. |
static java.lang.String |
MoML_DTD_1
The standard MoML DTD, represented as a string. |
static java.lang.String |
MoML_PUBLIC_ID_1
The public ID for version 1 MoML. |
Constructor Summary | |
---|---|
XmlHandler(ConfigXmlTree tree,
java.lang.String systemId)
Construct an XML handler with the given XML tree as the current tree. |
Method Summary | |
---|---|
void |
attribute(java.lang.String name,
java.lang.String value,
boolean isSpecified)
Handle an attribute. |
void |
charData(char[] ch,
int start,
int length)
Handle a chunk of char data. |
void |
doctypeDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Handle a document type declaration. |
void |
endDocument()
Handle the end of the XML document. |
void |
endElement(java.lang.String elementName)
Handle the end of an XML element. |
void |
endExternalEntity(java.lang.String systemId)
Handle the end of an external entity. |
void |
error(java.lang.String message,
java.lang.String systemId,
int line,
int column)
Signal an error message. |
ConfigXmlTree |
getCurrentTree()
Return the current XML tree. |
java.lang.String |
getSystemId()
Return the system ID of the XML document. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Handle consecutive ignorable white spaces. |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Handle a processing instruction. |
java.lang.Object |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Resolve an external entity. |
void |
startDocument()
Handle the start of the XML document. |
void |
startElement(java.lang.String elementName)
Handle the start of an XML element. |
void |
startExternalEntity(java.lang.String systemId)
Handle the start of an external entity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MoML_DTD_1
public static final java.lang.String MoML_PUBLIC_ID_1
private java.util.Hashtable<java.lang.String,java.lang.String> _currentAttributes
private ConfigXmlTree _currentTree
private java.lang.String _systemId
Constructor Detail |
---|
XmlHandler(ConfigXmlTree tree, java.lang.String systemId)
tree
- The initial XML tree.systemId
- The system ID of the document type.Method Detail |
---|
public void attribute(java.lang.String name, java.lang.String value, boolean isSpecified) throws java.lang.Exception
attribute
in interface XmlHandler
name
- The name of the attribute.value
- The value of the attribute.isSpecified
- true if the value was specified, false if it was
defaulted from the DTD.
java.lang.Exception
- Not thrown in this base class.XmlHandler.startElement(java.lang.String)
,
XmlParser.declaredAttributes(java.lang.String)
,
XmlParser.getAttributeType(java.lang.String, java.lang.String)
,
XmlParser.getAttributeDefaultValue(java.lang.String, java.lang.String)
public void charData(char[] ch, int start, int length) throws java.lang.Exception
charData
in interface XmlHandler
ch
- The character data.start
- The starting position in the array.length
- The number of characters available.
java.lang.Exception
- Not thrown in this base class.public void doctypeDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws java.lang.Exception
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.
java.lang.Exception
- Not thrown in this base class.public void endDocument() throws java.lang.Exception
endDocument
in interface XmlHandler
java.lang.Exception
- The handler may throw any exception.XmlHandler.startDocument()
public void endElement(java.lang.String elementName) throws java.lang.Exception
endElement
in interface XmlHandler
elementName
- The name of the element.
java.lang.Exception
- Not thrown in this base class.XmlHandler.startElement(java.lang.String)
,
XmlParser.declaredElements()
,
XmlParser.getElementContentType(java.lang.String)
public void endExternalEntity(java.lang.String systemId) throws java.lang.Exception
endExternalEntity
in interface XmlHandler
systemId
- The system ID of the external entity.
java.lang.Exception
- Not thrown in this base class.XmlHandler.startExternalEntity(java.lang.String)
,
XmlHandler.resolveEntity(java.lang.String, java.lang.String)
public void error(java.lang.String message, java.lang.String systemId, int line, int column) throws java.lang.Exception
error
in interface XmlHandler
message
- The error message.systemId
- The system ID of the XML document that contains the
error.line
- The line number of the error.column
- The column number of the error.
java.lang.Exception
- Not thrown in this base class.XmlException
public ConfigXmlTree getCurrentTree()
public java.lang.String getSystemId()
public void ignorableWhitespace(char[] ch, int start, int length) throws java.lang.Exception
ignorableWhitespace
in interface XmlHandler
ch
- The literal whitespace characters.start
- The starting position in the array.length
- The number of whitespace characters available.
java.lang.Exception
- Not thrown in this base class.public void processingInstruction(java.lang.String target, java.lang.String data) throws java.lang.Exception
processingInstruction
in interface XmlHandler
target
- The target (the name at the start of the processing
instruction).data
- The data, if any (the rest of the processing instruction).
java.lang.Exception
- Not thrown in this base class.public java.lang.Object resolveEntity(java.lang.String publicId, java.lang.String systemId) throws java.lang.Exception
resolveEntity
in interface XmlHandler
publicId
- The public ID, or null if none was supplied.systemId
- The system ID.
java.lang.Exception
- Not thrown in this base class.XmlHandler.startExternalEntity(java.lang.String)
,
XmlHandler.endExternalEntity(java.lang.String)
public void startDocument() throws java.lang.Exception
startDocument
in interface XmlHandler
java.lang.Exception
- Not thrown in this base class.XmlHandler.endDocument()
public void startElement(java.lang.String elementName) throws java.lang.Exception
startElement
in interface XmlHandler
elementName
- The name of the XML element.
java.lang.Exception
- Not thrown in this base class.XmlHandler.attribute(java.lang.String, java.lang.String, boolean)
,
XmlHandler.endElement(java.lang.String)
,
XmlParser.declaredElements()
,
XmlParser.getElementContentType(java.lang.String)
public void startExternalEntity(java.lang.String systemId) throws java.lang.Exception
startExternalEntity
in interface XmlHandler
systemId
- The system ID of the external entity.
java.lang.Exception
- Not thrown in this base class.XmlHandler.endExternalEntity(java.lang.String)
,
XmlHandler.resolveEntity(java.lang.String, java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |