|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XmlElement
An interface for XML element access. The XmlElement interface represents both the element and its content (through the underlying XmlValue interface).
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 | |
---|---|
XmlValue |
addAttribute(String sName)
Provides a means to add a new attribute value. |
XmlElement |
addElement(String sName)
Create a new element and add it as a child element to this element. |
Object |
clone()
Creates and returns a copy of this XmlElement. |
XmlElement |
ensureElement(String sPath)
Ensure that a child element exists. |
boolean |
equals(Object o)
Compare this XML element and all of its contained information with another XML element for equality. |
XmlElement |
findElement(String sPath)
Find a child element with the specified '/'-delimited path. |
String |
getAbsolutePath()
Get the '/'-delimited path of the element starting from the root element. |
XmlValue |
getAttribute(String sName)
Get an attribute value. |
Map |
getAttributeMap()
Get the map of all attributes. |
String |
getComment()
Get the text of any comments that are in the XML element. |
XmlElement |
getElement(String sName)
Get a child element. |
List |
getElementList()
Get the list of all child elements. |
Iterator |
getElements(String sName)
Get an iterator of child elements that have a specific name. |
String |
getName()
Get the name of the element. |
XmlElement |
getRoot()
Get the root element. |
XmlValue |
getSafeAttribute(String sName)
Get an attribute value, and return a temporary value if the attribute does not exist. |
XmlElement |
getSafeElement(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. |
void |
setAttribute(String sName,
XmlValue val)
Set an attribute value. |
void |
setComment(String sComment)
Set the text of this element's comment. |
void |
setName(String sName)
Set the Name of the element. |
String |
toString()
Format the XML element and all its contained information into a String in a display format. |
void |
writeXml(PrintWriter out,
boolean fPretty)
Write the element as it will appear in XML. |
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 |
---|
String getName()
void setName(String sName)
sName
- the new element name
IllegalArgumentException
- if the name is null or if the name is
not a legal XML tag name
UnsupportedOperationException
- if the element can not be renamedXmlElement getRoot()
String getAbsolutePath()
List getElementList()
XmlElement getElement(String sName)
Iterator getElements(String sName)
XmlElement addElement(String sName)
sName
- the name for the new element
IllegalArgumentException
- if the name is null or if the name is
not a legal XML tag name
UnsupportedOperationException
- if this element is immutable or
otherwise can not add a child elementXmlElement findElement(String sPath)
sPath
- element path
XmlElement getSafeElement(String sPath)
sPath
- element path
XmlElement ensureElement(String sPath)
sPath
- element path
IllegalArgumentException
- if the name is null or if any part
of the path is not a legal XML tag name
UnsupportedOperationException
- if any element in the path
is immutable or otherwise can not add a child elementfindElement(java.lang.String)
Map getAttributeMap()
XmlValue getAttribute(String sName)
sName
- the name of the attribute
void setAttribute(String sName, XmlValue val)
sName
- the name of the attributeval
- the new value for the attribute; null indicates that the
attribute should be removedXmlValue addAttribute(String sName)
sName
- the name of the attributeXmlValue getSafeAttribute(String sName)
sName
- the name of the attribute
String getComment()
void setComment(String sComment)
sComment
- the comment text
IllegalArgumentException
- if the comment contains "--"void writeXml(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 possibleString toString()
toString
in interface XmlValue
int hashCode()
hashCode
in interface XmlValue
boolean equals(Object o)
equals
in interface XmlValue
Object clone()
clone
in interface XmlValue
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |