Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.run.xml
Interface XmlDocument

All Superinterfaces:
java.io.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
 java.lang.Object clone()
          Creates and returns a copy of this XmlDocument.
 boolean equals(java.lang.Object o)
          Compare this XML document and all of its contained information with another XML document for equality.
 java.lang.String getDocumentComment()
          Get the XML comment that appears outside of the root element.
 java.lang.String getDtdName()
          Get the public identifier of the DTD (DOCTYPE) for the document.
 java.lang.String getDtdUri()
          Get the URI of the DTD (DOCTYPE) for the document.
 java.lang.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(java.lang.String sComment)
          Set the XML comment that appears outside of the root element.
 void setDtdName(java.lang.String sName)
          Set the public identifier of the DTD (DOCTYPE) for the document.
 void setDtdUri(java.lang.String sUri)
          Set the URI of the DTD (DOCTYPE) for the document.
 void setEncoding(java.lang.String sEncoding)
          Set the encoding string for the XML document.
 java.lang.String toString()
          Format the XML document and all its contained information into a String in a display format.
 void writeXml(java.io.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

java.lang.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(java.lang.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

java.lang.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(java.lang.String sName)
Set the public identifier of the DTD (DOCTYPE) for the document.
Parameters:
sName - the DTD public identifier

getEncoding

java.lang.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(java.lang.String sEncoding)
Set the encoding string for the XML document.
Parameters:
sEncoding - the encoding that the document will use

getDocumentComment

java.lang.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(java.lang.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(java.io.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 interface XmlElement
Parameters:
out - a PrintWriter object to use to write to
fPretty - true to specify that the output is intended to be as human readable as possible

toString

java.lang.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.
Specified by:
toString in interface XmlElement
Specified by:
toString in interface XmlValue
Returns:
a String representation of the XML document

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:
Specified by:
hashCode in interface XmlElement
Specified by:
hashCode in interface XmlValue
Returns:
the hash value for this XML document

equals

boolean equals(java.lang.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.
Specified by:
equals in interface XmlElement
Specified by:
equals in interface XmlValue
Returns:
true if the documents are equal, false otherwise

clone

java.lang.Object clone()
Creates and returns a copy of this XmlDocument.
Specified by:
clone in interface XmlElement
Specified by:
clone in interface XmlValue
Returns:
a clone of this instance.

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.