|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.run.xml.SimpleValue
com.tangosol.run.xml.SimpleElement
com.tangosol.run.xml.SimpleDocument
public class SimpleDocument
A simple implementation of the XmlElement interface. Protected methods are provided to support inheriting classes.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.tangosol.run.xml.SimpleElement |
---|
SimpleElement.AttributeMap, SimpleElement.ElementIterator, SimpleElement.ElementList |
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 |
Constructor Summary | |
---|---|
SimpleDocument()
Construct an empty SimpleDocument. |
|
SimpleDocument(String sName)
Construct a SimpleDocument. |
|
SimpleDocument(String sName,
String sDtdUri,
String sDtdName)
Construct a SimpleDocument. |
Method Summary | |
---|---|
protected void |
checkMutable()
Validates that the document is mutable, otherwise throws an UnsupportedOperationException. |
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. |
void |
fromXml(XmlElement xml)
Deserialize the object from an XmlElement. |
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 |
readExternal(DataInput in)
Restore the contents of this object by loading the object's state from the passed DataInput object. |
void |
readExternal(ObjectInput in)
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
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. |
XmlElement |
toXml()
Serialize the object into an XmlElement. |
void |
writeExternal(DataOutput out)
Save the contents of this object by storing the object's state into the passed DataOutput object. |
void |
writeExternal(ObjectOutput out)
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays. |
void |
writeXml(PrintWriter out,
boolean fPretty)
Write the XML document, including an XML header and DOCTYPE if one exists. |
Methods inherited from class com.tangosol.run.xml.SimpleElement |
---|
addAttribute, addElement, ensureElement, findElement, getAbsolutePath, getAttribute, getAttributeMap, getComment, getElement, getElementList, getElements, getName, getRoot, getSafeAttribute, getSafeElement, instantiateAttribute, instantiateAttributeMap, instantiateElement, instantiateElementList, isNameMutable, setAttribute, setComment, setName, toString, toString, writeAttributes, writeChildren, writeComment, writeEmptyTag, writeEndTag, writeStartTag, writeValue |
Methods inherited from class com.tangosol.run.xml.SimpleValue |
---|
convert, ensureType, getBinary, getBinary, getBoolean, getBoolean, getDate, getDate, getDateTime, getDateTime, getDecimal, getDecimal, getDouble, getDouble, getInt, getInt, getInternalValue, getLong, getLong, getParent, getString, getString, getTime, getTime, getValue, isAttribute, isContent, isEmpty, isMutable, setAttribute, setBinary, setBoolean, setDate, setDateTime, setDecimal, setDouble, setInt, setInternalValue, setLong, setMutable, setParent, setString, setTime |
Methods inherited from class com.tangosol.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, toBitString, toBitString, toBitString |
Methods inherited from interface com.tangosol.run.xml.XmlDocument |
---|
toString |
Methods inherited from interface com.tangosol.run.xml.XmlElement |
---|
addAttribute, addElement, ensureElement, findElement, getAbsolutePath, getAttribute, getAttributeMap, getComment, getElement, getElementList, getElements, getName, 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 |
Constructor Detail |
---|
public SimpleDocument()
public SimpleDocument(String sName)
sName
- the name of the root elementpublic SimpleDocument(String sName, String sDtdUri, String sDtdName)
sName
- the name of the root elementsDtdUri
- the URI of the DTD (system identifier)sDtdName
- the name of the DTD (public identifier); may be nullMethod Detail |
---|
public String getDtdUri()
getDtdUri
in interface XmlDocument
public void setDtdUri(String sUri)
setDtdUri
in interface XmlDocument
sUri
- the document type URIpublic String getDtdName()
getDtdName
in interface XmlDocument
public void setDtdName(String sName)
setDtdName
in interface XmlDocument
sName
- the DTD public identifierpublic String getEncoding()
getEncoding
in interface XmlDocument
public void setEncoding(String sEncoding)
setEncoding
in interface XmlDocument
sEncoding
- the encoding that the document will usepublic String getDocumentComment()
getDocumentComment
in interface XmlDocument
public void setDocumentComment(String sComment)
setDocumentComment
in interface XmlDocument
sComment
- the document commentpublic void writeXml(PrintWriter out, boolean fPretty)
writeXml
in interface XmlDocument
writeXml
in interface XmlElement
writeXml
in class SimpleElement
out
- a PrintWriter object to use to write tofPretty
- true to specify that the output is intended to be as
human readable as possiblepublic int hashCode()
hashCode
in interface XmlDocument
hashCode
in interface XmlElement
hashCode
in interface XmlValue
hashCode
in class SimpleElement
public boolean equals(Object o)
equals
in interface XmlDocument
equals
in interface XmlElement
equals
in interface XmlValue
equals
in class SimpleElement
public Object clone()
clone
in interface XmlDocument
clone
in interface XmlElement
clone
in interface XmlValue
clone
in class SimpleElement
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- the stream to write the object to
IOException
- Includes any I/O exceptions that may occurpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
in
- the stream to read data from in order to restore the object
IOException
- if I/O errors occur
ClassNotFoundException
- If the class for an object being
restored cannot be found.public void readExternal(DataInput in) throws IOException
readExternal
in interface ExternalizableLite
readExternal
in class SimpleElement
in
- the DataInput stream to read data from in order to restore
the state of this object
IOException
- if an I/O exception occurs
NotActiveException
- if the object is not in its initial
state, and therefore cannot be deserialized intopublic void writeExternal(DataOutput out) throws IOException
writeExternal
in interface ExternalizableLite
writeExternal
in class SimpleElement
out
- the DataOutput stream to write the state of this object to
IOException
- if an I/O exception occurspublic XmlElement toXml()
toXml
in interface XmlSerializable
toXml
in class SimpleElement
public void fromXml(XmlElement xml)
fromXml
in interface XmlSerializable
fromXml
in class SimpleElement
xml
- an XmlElement that contains the serialized form of the
object
UnsupportedOperationException
- if this element is immutableprotected void checkMutable()
checkMutable
in class SimpleElement
UnsupportedOperationException
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |