|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.run.xml.SimpleValue
com.tangosol.run.xml.SimpleElement
public class SimpleElement
A simple implementation of the XmlElement interface. Protected methods are provided to support inheriting classes.
| Nested Class Summary | |
|---|---|
class |
SimpleElement.AttributeMapA Map implementation using a list that can be a read-only map that supports only Strings for keys and XmlValue for values. |
protected class |
SimpleElement.ElementIteratorProvides an Iterator implementation that exposes only those Elements from the Element list that match a certain name. |
protected class |
SimpleElement.ElementListAn implementation of List that only supports XmlElements as the content of the List. |
| 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 | |
|---|---|
SimpleElement()Construct an empty SimpleElement. |
|
SimpleElement(java.lang.String sName)Construct a SimpleElement. |
|
SimpleElement(java.lang.String sName, java.lang.Object oValue)Construct a SimpleElement. |
|
| Method Summary | |
|---|---|
XmlValue |
addAttribute(java.lang.String sName)Provides a means to add a new attribute value. |
XmlElement |
addElement(java.lang.String sName)Create a new element and add it as a child element to this element. |
protected void |
checkMutable()Validates that the element is mutable, otherwise throws an UnsupportedOperationException. |
java.lang.Object |
clone()Creates and returns a copy of this SimpleElement. |
XmlElement |
ensureElement(java.lang.String sPath)Ensure that a child element exists. |
boolean |
equals(java.lang.Object o)Compare this XML element and all of its contained information with another XML element for equality. |
XmlElement |
findElement(java.lang.String sPath)Find a child element with the specified '/'-delimited path. |
void |
fromXml(XmlElement xml)Deserialize the object from an XmlElement. |
java.lang.String |
getAbsolutePath()Get the '/'-delimited path of the element starting from the root element. |
XmlValue |
getAttribute(java.lang.String sName)Get an attribute value. |
java.util.Map |
getAttributeMap()Get the map of all attributes. |
java.lang.String |
getComment()Get the text of any comments that are in the XML element. |
XmlElement |
getElement(java.lang.String sName)Get a child element. |
java.util.List |
getElementList()Get the list of all child elements. |
java.util.Iterator |
getElements(java.lang.String sName)Get an iterator of child elements that have a specific name. |
java.lang.String |
getName()Get the name of the element. |
QualifiedName |
getQualifiedName()Obtains the QualifiedName of the XmlElement. |
XmlElement |
getRoot()Get the root element. |
XmlValue |
getSafeAttribute(java.lang.String sName)Get an attribute value, and return a temporary value if the attribute does not exist. |
XmlElement |
getSafeElement(java.lang.String sPath)Return the specified child element using the same path notation as supported by findElement, but return a read-only element if the specified element does not exist. |
int |
hashCode()Provide a hash value for this XML element and all of its contained information. |
protected XmlValue |
instantiateAttribute()Instantiate an XmlValue implementation for an attribute value. |
protected java.util.Map |
instantiateAttributeMap()Instantiate a Map implementation that will support the name to value map used to hold attributes. |
protected XmlElement |
instantiateElement(java.lang.String sName, java.lang.Object oValue)Instantiate an XmlElement implementation for an element. |
protected java.util.List |
instantiateElementList()Instantiate a List implementation that will hold child elements. |
protected boolean |
isNameMutable()Determine if the name can be changed. |
void |
readExternal(java.io.DataInput in)Restore the contents of this object by loading the object's state from the passed DataInput object. |
void |
readExternal(PofReader in)Restore the contents of a user type instance by reading its state using the specified PofReader object. |
void |
setAttribute(java.lang.String sName, XmlValue val)Set an attribute value. |
void |
setComment(java.lang.String sComment)Set the text of this element's comment. |
void |
setName(java.lang.String sName)Set the Name of the element. |
java.lang.String |
toString()Format the XML element and all its contained information into a String in a display format. |
java.lang.String |
toString(boolean fPretty)Format the XML element and all its contained information into a String in a display format. |
XmlElement |
toXml()Serialize the object into an XmlElement. |
protected void |
writeAttributes(java.io.PrintWriter out, boolean fPretty)Write the attributes as part of a start tag. |
protected void |
writeChildren(java.io.PrintWriter out, boolean fPretty)Write the element as it will appear in XML. |
protected void |
writeComment(java.io.PrintWriter out, boolean fPretty)Write the element as it will appear in XML. |
protected void |
writeEmptyTag(java.io.PrintWriter out, boolean fPretty)Write the element as a combined start/end tag. |
protected void |
writeEndTag(java.io.PrintWriter out, boolean fPretty)Write the element's end tag. |
void |
writeExternal(java.io.DataOutput out)Save the contents of this object by storing the object's state into the passed DataOutput object. |
void |
writeExternal(PofWriter out)Save the contents of a POF user type instance by writing its state using the specified PofWriter object. |
protected void |
writeStartTag(java.io.PrintWriter out, boolean fPretty)Write the element's start tag. |
void |
writeValue(java.io.PrintWriter out, boolean fPretty)Write the value as it will appear in XML. |
void |
writeXml(java.io.PrintWriter out, boolean fPretty)Write the element as it will appear in XML. |
| 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, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString, toBytes, toBytes, toBytes, toBytes, toInt, toInt, toLong, toLong |
| 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 |
| Constructor Detail |
|---|
public SimpleElement()
public SimpleElement(java.lang.String sName)
sName - the name of the element
public SimpleElement(java.lang.String sName,
java.lang.Object oValue)
sName - the name of the elementoValue - an initial value for this element| Method Detail |
|---|
public java.lang.String getName()
getName in interface XmlElementpublic void setName(java.lang.String sName)
setName in interface XmlElementsName - the new element namejava.lang.IllegalArgumentException - if the name is null or if the name is not a legal XML tag namejava.lang.UnsupportedOperationException - if the element cannot be renamedpublic QualifiedName getQualifiedName()
QualifiedName of the XmlElement.getQualifiedName in interface XmlElementQualifiedNamepublic XmlElement getRoot()
getRoot in interface XmlElementpublic java.lang.String getAbsolutePath()
getAbsolutePath in interface XmlElementpublic java.util.List getElementList()
getElementList in interface XmlElementpublic XmlElement getElement(java.lang.String sName)
getElement in interface XmlElementpublic java.util.Iterator getElements(java.lang.String sName)
getElements in interface XmlElementpublic XmlElement addElement(java.lang.String sName)
addElement in interface XmlElementsName - the name for the new elementjava.lang.IllegalArgumentException - if the name is null or if the name is not a legal XML tag namejava.lang.UnsupportedOperationException - if this element is immutable or otherwise cannot add a child elementpublic XmlElement findElement(java.lang.String sPath)
findElement in interface XmlElementsPath - element pathpublic XmlElement getSafeElement(java.lang.String sPath)
getSafeElement in interface XmlElementsPath - element pathpublic XmlElement ensureElement(java.lang.String sPath)
ensureElement in interface XmlElementsPath - element pathjava.lang.IllegalArgumentException - if the name is null or if any part of the path is not a legal XML tag namejava.lang.UnsupportedOperationException - if any element in the path is immutable or otherwise cannot add a child elementfindElement(java.lang.String)public java.util.Map getAttributeMap()
getAttributeMap in interface XmlElementpublic XmlValue getAttribute(java.lang.String sName)
getAttribute in interface XmlElementsName - the name of the attribute
public void setAttribute(java.lang.String sName,
XmlValue val)
setAttribute in interface XmlElementsName - the name of the attributeval - the new value for the attribute; null indicates that the attribute should be removedpublic XmlValue addAttribute(java.lang.String sName)
addAttribute in interface XmlElementsName - the name of the attributepublic XmlValue getSafeAttribute(java.lang.String sName)
getSafeAttribute in interface XmlElementsName - the name of the attributepublic java.lang.String getComment()
getComment in interface XmlElementpublic void setComment(java.lang.String sComment)
setComment in interface XmlElementsComment - the comment textjava.lang.IllegalArgumentException - if the comment contains "--"
public void writeXml(java.io.PrintWriter out,
boolean fPretty)
writeXml in interface XmlElementout - a PrintWriter object to use to write tofPretty - true to specify that the output is intended to be as human readable as possible
public void writeValue(java.io.PrintWriter out,
boolean fPretty)
writeValue in interface XmlValuewriteValue in class SimpleValueout - a PrintWriter object to use to write tofPretty - true to specify that the output is intended to be as human readable as possiblepublic XmlElement toXml()
toXml in interface XmlSerializablepublic void fromXml(XmlElement xml)
fromXml in interface XmlSerializablexml - an XmlElement that contains the serialized form of the objectjava.lang.UnsupportedOperationException - if this element is immutable
public void readExternal(java.io.DataInput in)
throws java.io.IOException
readExternal in interface ExternalizableLitereadExternal in class SimpleValuein - the DataInput stream to read data from in order to restore the state of this objectjava.io.IOException - if an I/O exception occursjava.io.NotActiveException - if the object is not in its initial state, and therefore cannot be deserialized into
public void writeExternal(java.io.DataOutput out)
throws java.io.IOException
writeExternal in interface ExternalizableLitewriteExternal in class SimpleValueout - the DataOutput stream to write the state of this object tojava.io.IOException - if an I/O exception occurs
public void readExternal(PofReader in)
throws java.io.IOException
readExternal in interface PortableObjectreadExternal in class SimpleValuein - the PofReader from which to read the object's statejava.io.IOException - if an I/O error occurs
public void writeExternal(PofWriter out)
throws java.io.IOException
writeExternal in interface PortableObjectwriteExternal in class SimpleValueout - the PofWriter to which to write the object's statejava.io.IOException - if an I/O error occursprotected void checkMutable()
java.lang.UnsupportedOperationExceptionprotected boolean isNameMutable()
protected java.util.List instantiateElementList()
protected XmlElement instantiateElement(java.lang.String sName,
java.lang.Object oValue)
sName - element nameoValue - element valueprotected java.util.Map instantiateAttributeMap()
protected XmlValue instantiateAttribute()
protected void writeEmptyTag(java.io.PrintWriter out,
boolean fPretty)
out - a PrintWriter object to use to write tofPretty - true to specify that the output is intended to be as human readable as possible
protected void writeStartTag(java.io.PrintWriter out,
boolean fPretty)
out - a PrintWriter object to use to write tofPretty - true to specify that the output is intended to be as human readable as possible
protected void writeEndTag(java.io.PrintWriter out,
boolean fPretty)
out - a PrintWriter object to use to write tofPretty - true to specify that the output is intended to be as human readable as possible
protected void writeAttributes(java.io.PrintWriter out,
boolean fPretty)
out - a PrintWriter object to use to write tofPretty - true to specify that the output is intended to be as human readable as possible
protected void writeComment(java.io.PrintWriter out,
boolean fPretty)
out - a PrintWriter object to use to write tofPretty - true to specify that the output is intended to be as human readable as possible
protected void writeChildren(java.io.PrintWriter out,
boolean fPretty)
out - a PrintWriter object to use to write tofPretty - true to specify that the output is intended to be as human readable as possiblepublic java.lang.String toString()
toString in interface XmlElementtoString in interface XmlValuetoString in class SimpleValuepublic java.lang.String toString(boolean fPretty)
fPretty - true to specify that the output is intended to be as human readable as possiblepublic int hashCode()
hashCode in interface XmlElementhashCode in interface XmlValuehashCode in class SimpleValuepublic boolean equals(java.lang.Object o)
equals in interface XmlElementequals in interface XmlValueequals in class SimpleValuepublic java.lang.Object clone()
clone in interface XmlElementclone in interface XmlValueclone in class SimpleValue
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||