Package com.tangosol.run.xml
Interface XmlDocument
-
- All Superinterfaces:
Serializable
,XmlElement
,XmlValue
- All Known Implementing Classes:
SimpleDocument
public interface XmlDocument extends XmlElement
An interface for XML document access. The XmlDocumnet interface represents the document as both the root element (through the underlying XmlElement interface) and the properties specific to a document, such as DOCTYPE.- Author:
- cp 2001.07.11
-
-
Field Summary
-
Fields inherited from interface com.tangosol.run.xml.XmlValue
TYPE_BINARY, TYPE_BOOLEAN, TYPE_DATE, TYPE_DATETIME, TYPE_DECIMAL, TYPE_DOUBLE, TYPE_INT, TYPE_LONG, TYPE_STRING, TYPE_TIME
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
clone()
Creates and returns a copy of this XmlDocument.boolean
equals(Object o)
Compare this XML document and all of its contained information with another XML document for equality.String
getDocumentComment()
Get the XML comment that appears outside of the root element.String
getDtdName()
Get the public identifier of the DTD (DOCTYPE) for the document.String
getDtdUri()
Get the URI of the DTD (DOCTYPE) for the document.String
getEncoding()
Get the encoding string for the XML document.int
hashCode()
Provide a hash value for this XML document and all of its contained information.void
setDocumentComment(String sComment)
Set the XML comment that appears outside of the root element.void
setDtdName(String sName)
Set the public identifier of the DTD (DOCTYPE) for the document.void
setDtdUri(String sUri)
Set the URI of the DTD (DOCTYPE) for the document.void
setEncoding(String sEncoding)
Set the encoding string for the XML document.String
toString()
Format the XML document and all its contained information into a String in a display format.void
writeXml(PrintWriter out, boolean fPretty)
Write the XML document, including an XML header and DOCTYPE if one exists.-
Methods inherited from interface com.tangosol.run.xml.XmlElement
addAttribute, addElement, ensureElement, findElement, getAbsolutePath, getAttribute, getAttributeMap, getComment, getElement, getElementList, getElements, getName, getQualifiedName, getRoot, getSafeAttribute, getSafeElement, setAttribute, setComment, setName
-
Methods inherited from interface com.tangosol.run.xml.XmlValue
getBinary, getBinary, getBoolean, getBoolean, getDate, getDate, getDateTime, getDateTime, getDecimal, getDecimal, getDouble, getDouble, getInt, getInt, getLong, getLong, getParent, getString, getString, getTime, getTime, getValue, isAttribute, isContent, isEmpty, isMutable, setBinary, setBoolean, setDate, setDateTime, setDecimal, setDouble, setInt, setLong, setParent, setString, setTime, writeValue
-
-
-
-
Method Detail
-
getDtdUri
String getDtdUri()
Get the URI of the DTD (DOCTYPE) for the document. This is referred to as the System Identifier by the XML specification. For example: http://java.sun.com/j2ee/dtds/web-app_2_2.dtd- Returns:
- the document type URI
-
setDtdUri
void setDtdUri(String sUri)
Set the URI of the DTD (DOCTYPE) for the document. This is referred to as the System Identifier by the XML specification.- Parameters:
sUri
- the document type URI
-
getDtdName
String getDtdName()
Get the public identifier of the DTD (DOCTYPE) for the document. For example: -//Sun Microsystems, Inc.//DTD Web Application 1.2//EN- Returns:
- the DTD public identifier
-
setDtdName
void setDtdName(String sName)
Set the public identifier of the DTD (DOCTYPE) for the document.- Parameters:
sName
- the DTD public identifier
-
getEncoding
String getEncoding()
Get the encoding string for the XML document. Documents that are parsed may or may not have the encoding string from the persistent form of the document.- Returns:
- the encoding set for the document
-
setEncoding
void setEncoding(String sEncoding)
Set the encoding string for the XML document.- Parameters:
sEncoding
- the encoding that the document will use
-
getDocumentComment
String getDocumentComment()
Get the XML comment that appears outside of the root element. This differs from the Comment property of this object, which refers to the comment within the root element.- Returns:
- the document comment
-
setDocumentComment
void setDocumentComment(String sComment)
Set the XML comment that appears outside of the root element. This differs from the Comment property of this object, which refers to the comment within the root element.- Parameters:
sComment
- the document comment
-
writeXml
void writeXml(PrintWriter out, boolean fPretty)
Write the XML document, including an XML header and DOCTYPE if one exists. This overrides the contract of the XmlElement super interface.- Specified by:
writeXml
in interfaceXmlElement
- Parameters:
out
- a PrintWriter object to use to write tofPretty
- true to specify that the output is intended to be as human readable as possible
-
toString
String toString()
Format the XML document and all its contained information into a String in a display format. Note that this overrides the contract of the toString method in the super interface XmlElement.
-
hashCode
int hashCode()
Provide a hash value for this XML document and all of its contained information. Note that this overrides the contract of the hashCode method in the super interface XmlElement. The hash value is defined as a xor of the following:- the hashCode from the root element
- the hashCode from the document type
-
equals
boolean equals(Object o)
Compare this XML document and all of its contained information with another XML document for equality. Note that this overrides the contract of the equals method in the super interface XmlElement.
-
clone
Object clone()
Creates and returns a copy of this XmlDocument.- Specified by:
clone
in interfaceXmlElement
- Specified by:
clone
in interfaceXmlValue
- Returns:
- a clone of this instance.
-
-