|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.util.xml.XmlDocument
public class XmlDocument
An XMLDocument is an in-memory representation of an XML document. It contains an XML element as its root, and other information relevant to the document as a whole, such as its URL, its DTD, and so on. The document can be parsed from or written out to its URL or File, or to some other arbitrary Writer. Documents do not parse themselves, but are passed to an XmlReader.
See the package summary for a brief description of how to use this class.
Field Summary | |
---|---|
(package private) java.lang.String |
_docType
|
(package private) java.lang.String |
_dtd
|
(package private) java.lang.String |
_dtdPublicID
|
(package private) java.lang.String |
_dtdSystemID
|
private java.io.File |
_file
|
(package private) XmlParser |
_parser
|
private XmlElement |
_root
|
private java.net.URL |
_url
|
Constructor Summary | |
---|---|
XmlDocument()
Create an XML document with no idea of where it exists. |
|
XmlDocument(java.io.File file)
Create an XML document located in the given file. |
|
XmlDocument(java.net.URL url)
Create an XML document with the given URL. |
|
XmlDocument(java.net.URL url,
java.lang.String dtdPublicID)
Create an XML document with the given URL and the DTD system ID. |
Method Summary | |
---|---|
java.lang.String |
getDTD()
Get the DTD of this document. |
java.lang.String |
getDTDPublicID()
Get the public ID of the DTD of this document. |
java.lang.String |
getDTDSystemID()
Get the system ID of the DTD of this document. |
java.io.File |
getFile()
Get the file corresponding to this document. |
XmlElement |
getRoot()
Get the root element of this document. |
java.net.URL |
getURL()
Get the URL of this document. |
void |
setDocType(java.lang.String dt)
Set the type of this document. |
void |
setDTD(java.lang.String dtd)
Set the DTD of this document. |
void |
setDTDPublicID(java.lang.String id)
Set the DTD of this document by its public ID. |
void |
setDTDSystemID(java.lang.String id)
Set the DTD of this document by its public ID. |
void |
setFile(java.io.File file)
Set the file that this document corresponds to. |
void |
setRoot(XmlElement root)
Set the root element of this document. |
void |
setURL(java.net.URL url)
Set the URL of this document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.lang.String _dtd
java.lang.String _docType
java.lang.String _dtdPublicID
java.lang.String _dtdSystemID
private java.net.URL _url
private java.io.File _file
private XmlElement _root
XmlParser _parser
Constructor Detail |
---|
public XmlDocument()
public XmlDocument(java.net.URL url)
public XmlDocument(java.io.File file)
public XmlDocument(java.net.URL url, java.lang.String dtdPublicID)
Method Detail |
---|
public java.lang.String getDTD()
public java.lang.String getDTDPublicID()
public java.lang.String getDTDSystemID()
public java.net.URL getURL()
public java.io.File getFile()
public XmlElement getRoot()
public void setDTD(java.lang.String dtd)
public void setDocType(java.lang.String dt)
public void setDTDPublicID(java.lang.String id)
public void setDTDSystemID(java.lang.String id)
public void setRoot(XmlElement root)
public void setFile(java.io.File file)
public void setURL(java.net.URL url)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |