|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
| Nested Class Summary | |
static interface |
XmlData.Condition
XmlData.Condition has just one method that checks whether XmlData satisfies a condition. |
| Method Summary | |
XmlData |
addKid(XmlData kid)
Adds a kid to the set of kids. |
void |
addKids(java.util.Collection kids)
Adds all XmlData elements from given Collection to the set of kids, skipping elements that are not XmlData. |
boolean |
castKids(java.lang.String type,
java.lang.Class clazz)
Casts kids of specified type to a specified class (actually replacing them with the new instances). |
void |
cleanAttributes()
cleans attributes map Just removes all the attributes |
java.lang.Object |
clone()
Clones XmlData, same thing as deepCopy. |
boolean |
equals(java.lang.Object other)
Compares contents with other Object |
java.util.Collection |
getAllKids()
Gets a collection of all kids of XmlData. |
java.lang.String |
getAttribute(java.lang.String name)
Gets the value of a specified attribute. |
java.lang.String |
getAttribute(java.lang.String name,
java.lang.String defaultValue)
Gets the value of a specified attribute; if there is none, returns default value. |
java.util.Map |
getAttributes()
Gets a Map of attributes. |
java.lang.String |
getId()
Gets the id of XmlData, which is the value of attribute "id". |
XmlData |
getKid(int position)
Gets a kid at specified position. |
XmlData |
getKid(java.lang.String type)
Gets a kid of specified type, if any. |
XmlData |
getKid(java.lang.String type,
java.lang.String id)
Gets a kid having specified type and specified id. |
XmlData |
getKid(java.lang.String type,
java.lang.String attribute,
java.lang.String value)
Gets a kid of specified type that has an attribute with a specified value. |
java.lang.String |
getKidAttribute(java.lang.String type,
java.lang.String attribute)
Gets the value of specified attribute of a kid of specified type, if any |
int |
getKidCount(java.lang.String type)
Gets the number of kids of specified type. |
java.util.Collection |
getKids(java.lang.String type)
Gets a Collection of kids of specified type. |
java.lang.String |
getKidValue(java.lang.String type)
Gets the value of a kid of specified type, if any. |
java.lang.String |
getName()
Gets the name of XmlData, which is the value of attribute "name". |
java.lang.String |
getType()
Gets XmlData type, which is just a String. |
java.lang.String |
getValue()
Gets a value of XmlData, which is just a String. |
XmlData |
getXmlContent()
Gets the contents of this XmlData (probably, itself). |
void |
removeKid(XmlData kid)
Removes a kid from the set of kids. |
java.util.Collection |
removeKids(java.lang.String type)
Removes all kids of given type. |
void |
replaceKid(XmlData oldKid,
XmlData newKid)
Replaces a kid with another kid. |
XmlData |
selectTree(XmlData.Condition condition)
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
Sets an attribute value. |
void |
setAttributes(org.xml.sax.AttributeList attributes)
Sets attributes from an AttributeList. |
void |
setAttributes(java.util.Map attributes)
Sets attributes from a Map, name -> value. |
void |
setAttributes(java.lang.String[] attributes)
Sets attributes from an array of name-value pairs. |
void |
setKidValue(java.lang.String type,
java.lang.String value)
Sets the value of a kid of specified type, creating it if necessary. |
XmlData |
setValue(java.lang.String v)
Sets the value of XmlData. |
void |
setXmlContent(XmlData org)
Sets the contents from another XmlData. |
| Method Detail |
public boolean equals(java.lang.Object other)
other - Object
public void setXmlContent(XmlData org)
org - original XmlDatapublic XmlData getXmlContent()
public java.lang.Object clone()
public void cleanAttributes()
public void setAttribute(java.lang.String name,
java.lang.String value)
name - attribute namevalue - attribute valuepublic void setAttributes(java.lang.String[] attributes)
attributes - a String array consisting of name-value pairs.public void setAttributes(org.xml.sax.AttributeList attributes)
attributes - AttributeListpublic void setAttributes(java.util.Map attributes)
attributes - a Map, attributeName -> attributeValue.public java.util.Map getAttributes()
public java.lang.String getType()
public java.lang.String getValue()
public XmlData setValue(java.lang.String v)
v - new value for XmlData
public java.lang.String getAttribute(java.lang.String name)
name - attribute name
public java.lang.String getAttribute(java.lang.String name,
java.lang.String defaultValue)
name - attribute namedefaultValue -
public java.lang.String getName()
public java.lang.String getId()
public java.util.Collection getAllKids()
public java.util.Collection getKids(java.lang.String type)
type - type of the kids to choose
public int getKidCount(java.lang.String type)
type -
public XmlData getKid(int position)
position - position of the kid to retrieve, starting with 0;
public XmlData getKid(java.lang.String type)
type - type of the kid to chose
public java.lang.String getKidValue(java.lang.String type)
type -
public void setKidValue(java.lang.String type,
java.lang.String value)
type - value -
public java.lang.String getKidAttribute(java.lang.String type,
java.lang.String attribute)
type - Stringattribute - String
public XmlData getKid(java.lang.String type,
java.lang.String attribute,
java.lang.String value)
type - type of the kid to chooseattribute - attribute namevalue - attribute value
public XmlData getKid(java.lang.String type,
java.lang.String id)
type - kid typeid - kid id
public XmlData addKid(XmlData kid)
kid - kid to add
public void removeKid(XmlData kid)
kid - kid to remove
public void replaceKid(XmlData oldKid,
XmlData newKid)
oldKid - kid to removenewKid - kid to insert in its placepublic void addKids(java.util.Collection kids)
kids - public java.util.Collection removeKids(java.lang.String type)
type - type of kids to remove
public XmlData selectTree(XmlData.Condition condition)
public boolean castKids(java.lang.String type,
java.lang.Class clazz)
type - type of the kids to castclazz - class to cast to
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||