|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectzeus.concepts.xmlobject.Parser
Basic implementation for XML parsers. Performs DOM based validating
parsing, requiring only that the translateRoot(Document)
method be implemented to take control of the parsing. Requires an
underlying Xerces parser to be available.
| Field Summary | |
protected java.io.InputStream |
inputStream
Input data stream. |
protected java.lang.Object |
root
Root object of the XML data. |
| Constructor Summary | |
Parser()
Default constructor. |
|
Parser(java.io.File file)
Construct instance, and use specified file as input source. |
|
Parser(java.lang.String string)
Construct instance, and use specified string as input source. |
|
| Method Summary | |
java.io.InputStream |
getInputStream()
Retrieve the input stream for the parser. |
java.lang.Object |
getRootObject()
Retrieve the root object. |
void |
load()
Read the input source and build the Java object structure. |
void |
refresh()
Update the object hierarchy from the current input stream. |
protected boolean |
setFeature(java.lang.String feature,
org.apache.xerces.parsers.DOMParser parser)
Set a feature of the parser. |
void |
setInputStream(java.io.InputStream inputStream)
Set the input source for the parser. |
void |
setRootObject(java.lang.Object root)
Set the root of the object hierarchy. |
protected void |
setupParser(org.apache.xerces.parsers.DOMParser parser)
Set the validation features of the underlying parser. |
protected abstract java.lang.Object |
translateRoot(org.w3c.dom.Document doc)
Translate the root element of the document, then return it as a Java object. |
boolean |
write(java.io.File file)
Write the current root object to the specified file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.io.InputStream inputStream
protected java.lang.Object root
| Constructor Detail |
public Parser()
public Parser(java.io.File file)
throws java.io.FileNotFoundException
public Parser(java.lang.String string)
| Method Detail |
protected abstract java.lang.Object translateRoot(org.w3c.dom.Document doc)
public void load()
protected void setupParser(org.apache.xerces.parsers.DOMParser parser)
protected boolean setFeature(java.lang.String feature,
org.apache.xerces.parsers.DOMParser parser)
public void setInputStream(java.io.InputStream inputStream)
public java.io.InputStream getInputStream()
public void setRootObject(java.lang.Object root)
public java.lang.Object getRootObject()
public void refresh()
public boolean write(java.io.File file)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||