|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.xml.Document
public class Document
A simple XML document. Just for representing a simple tree-structure. Validating can be set to TRUE, but an internal DOCTYPE is not retrieved
setValidate(boolean)
,
getDoctype()
Constructor Summary | |
---|---|
Document()
initializes the document with empty processing instructions and a "root" root node |
|
Document(Document doc)
initializes the object with the given Document |
|
Document(java.lang.String pi)
initializes the object with the given processing instructions and a "root" root node |
|
Document(java.lang.String pi,
Element root)
initializes the object with the given processing instructions and root |
Method Summary | |
---|---|
void |
clear()
clears the document |
java.lang.Object |
clone()
returns a copy of this object (warnings or errors are not cloned!) |
java.lang.String |
getDoctype()
returns the DOCTYPE definition, unfortunately it is not set from a read file (must be set manually again before saving) |
java.util.Vector |
getErrors()
returns errors, if any, from previous parse (of type SAXParseException) |
java.lang.String |
getPI()
returns the processing instructions |
Element |
getRoot()
returns the root node, the node that contains the PI, DOCTYPE (actual) root-node |
boolean |
getValidate()
returns whether we validate the parsing or not |
java.util.Vector |
getWarnings()
returns the warnings, if any, from previous parse (of type SAXParseException) |
boolean |
hasErrors()
returns whether any errors happened during the last parse |
boolean |
hasWarnings()
whether there were any warning during the previous parse |
static void |
main(java.lang.String[] args)
for testing only |
boolean |
read(java.io.Reader reader)
reads the XML data from the given reader, returns TRUE if successful (if any error happened during parsing, FALSE is returned!) |
boolean |
read(java.lang.String filename)
reads the given file, returns TRUE if successful |
void |
setDoctype(java.lang.String doctype)
sets the DOCTYPE definition |
void |
setPI(java.lang.String pi)
sets the processing instructions |
void |
setRoot(Element root)
sets the root node |
void |
setValidate(boolean validate)
sets whether we validate the parsing or not |
java.lang.String |
toString()
returns the document in a string representation |
boolean |
write(java.lang.String filename)
writes the document to the given file, returns TRUE if it succeeds |
boolean |
write(java.io.Writer writer)
writes the document to the given Writer, returns TRUE if it succeeds |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Document()
public Document(java.lang.String pi)
public Document(java.lang.String pi, Element root)
public Document(Document doc)
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public void clear()
public void setPI(java.lang.String pi)
public java.lang.String getPI()
public void setDoctype(java.lang.String doctype)
public java.lang.String getDoctype()
public void setValidate(boolean validate)
public boolean getValidate()
public void setRoot(Element root)
public Element getRoot()
public java.util.Vector getErrors()
public boolean hasErrors()
public java.util.Vector getWarnings()
public boolean hasWarnings()
public boolean write(java.lang.String filename)
public boolean write(java.io.Writer writer)
public boolean read(java.lang.String filename)
public boolean read(java.io.Reader reader)
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |