|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jutil.xml.message.DefaultElement
public class DefaultElement
| Field Summary | |
|---|---|
protected java.util.Map |
attributes
|
protected java.util.List |
children
|
protected java.lang.String |
name
|
protected java.lang.String |
value
|
| Constructor Summary | |
|---|---|
DefaultElement()
|
|
DefaultElement(Message message,
java.lang.String name)
|
|
DefaultElement(Message message,
java.lang.String name,
java.lang.String value)
|
|
DefaultElement(java.lang.String name)
|
|
DefaultElement(java.lang.String name,
java.lang.String value)
|
|
| Method Summary | |
|---|---|
void |
addChild(Element child)
Add a new child Element |
Element |
createElement(java.lang.String name)
|
Element |
createElement(java.lang.String element,
java.lang.String value)
|
java.lang.String |
getAttribute(java.lang.String attribute)
Return the value of specified attribute. |
java.lang.String |
getAttribute(java.lang.String attribute,
java.lang.String defaultValue)
Returns the value of the attribute specified by its name as a String, or the default value if no attribute by
that name exists or is empty. |
boolean |
getAttributeAsBoolean(java.lang.String attribute)
Return the boolean value of the specified parameter contained
in this node. |
boolean |
getAttributeAsBoolean(java.lang.String attribute,
boolean defaultValue)
Returns the value of the attribute specified by its name as a boolean, or the default value if no attribute by
that name exists or is empty. |
double |
getAttributeAsDouble(java.lang.String attribute)
Return the double value of the specified attribute contained
in this node. |
double |
getAttributeAsDouble(java.lang.String attribute,
double defaultValue)
Returns the value of the attribute specified by its name as a double, or the default value if no attribute by
that name exists or is empty. |
float |
getAttributeAsFloat(java.lang.String attribute)
Return the float value of the specified parameter contained
in this node. |
float |
getAttributeAsFloat(java.lang.String attribute,
float defaultValue)
Returns the value of the attribute specified by its name as a float, or the default value if no attribute by
that name exists or is empty. |
int |
getAttributeAsInteger(java.lang.String attribute)
Return the int value of the specified attribute contained
in this node. |
int |
getAttributeAsInteger(java.lang.String attribute,
int defaultValue)
Returns the value of the attribute specified by its name as a int, or the default value if no attribute by
that name exists or is empty. |
long |
getAttributeAsLong(java.lang.String attribute)
Returns the value of the attribute specified by its name as a long. |
long |
getAttributeAsLong(java.lang.String attribute,
long defaultValue)
Returns the value of the attribute specified by its name as a long, or the default value if no attribute by
that name exists or is empty. |
java.lang.String[] |
getAttributeNames()
Return an array of all attribute names. |
Element |
getChild(java.lang.String child)
Return a new Element instance encapsulating the
specified child node. |
Element |
getChild(java.lang.String child,
boolean create)
Return a new Element instance encapsulating the
specified child node. |
Element[] |
getChildren()
Return an Element[]
|
Element[] |
getChildren(java.lang.String child)
Return an Element[] containing all
node children with the specified name. |
java.lang.String |
getName()
Return the name of the element |
java.lang.String |
getValue()
Return the value of the element |
java.lang.String |
getValue(java.lang.String defaultValue)
Return the value of the element |
Version |
getVersion()
Overide the superclass getVersion() to return this sub classe's Version |
void |
readExternal(java.io.ObjectInput in)
|
boolean |
removeChild(Element child)
|
boolean |
removeChildren(java.lang.String child)
|
void |
setAttribute(java.lang.String name,
java.lang.String attribute)
Add a new XMLAttribute |
void |
setName(java.lang.String name)
Set the name of the Element |
void |
setValue(java.lang.String value)
Set the value of the Element |
void |
writeExternal(java.io.ObjectOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String name
protected java.lang.String value
protected java.util.Map attributes
protected java.util.List children
| Constructor Detail |
|---|
public DefaultElement()
public DefaultElement(Message message,
java.lang.String name)
public DefaultElement(Message message,
java.lang.String name,
java.lang.String value)
public DefaultElement(java.lang.String name)
public DefaultElement(java.lang.String name,
java.lang.String value)
| Method Detail |
|---|
public java.lang.String getName()
getName in interface Elementpublic void setName(java.lang.String name)
Element
setName in interface Elementname - The name Stringpublic java.lang.String getValue()
getValue in interface Elementpublic java.lang.String getValue(java.lang.String defaultValue)
getValue in interface Elementpublic void setValue(java.lang.String value)
Element
setValue in interface Elementvalue - The value Stringpublic void addChild(Element child)
Element
addChild in interface Elementchild - The child Element.public Element getChild(java.lang.String child)
Element instance encapsulating the
specified child node.
getChild in interface Elementchild - The name of the child node.
public Element getChild(java.lang.String child,
boolean create)
Element instance encapsulating the
specified child node.
getChild in interface Elementchild - The name of the child node.create - Boolean flag if true create new ElementThe name of the child node.
public boolean removeChild(Element child)
removeChild in interface Elementpublic Element[] getChildren()
Element[]
getChildren in interface Element return new Element[0];public Element[] getChildren(java.lang.String child)
Element[] containing all
node children with the specified name.
getChildren in interface Elementchild - The name of the children to get.
return new Element[0];public boolean removeChildren(java.lang.String child)
removeChildren in interface Elementpublic java.lang.String[] getAttributeNames()
getAttributeNames in interface Element
public void setAttribute(java.lang.String name,
java.lang.String attribute)
XMLAttribute
setAttribute in interface Elementattribute - The attribute name.value - The attribute value.public java.lang.String getAttribute(java.lang.String attribute)
getAttribute in interface Elementattribute - The name of the attribute you ask the value of.
public int getAttributeAsInteger(java.lang.String attribute)
throws AttributeNotFoundException,
ValueParseException
int value of the specified attribute contained
in this node.
getAttributeAsInteger in interface Elementattribute - The name of the attribute you ask the value of.
AttributeNotFoundException - If no attribute with that name exists.
NumberParseException - or if conversion to int fails.
ValueParseException
public long getAttributeAsLong(java.lang.String attribute)
throws AttributeNotFoundException,
ValueParseException
long.
getAttributeAsLong in interface Elementattribute - The name of the attribute you ask the value of.
AttributeNotFoundException - If no attribute with that name exists.
ValueParseException - or if conversion to long fails.
public float getAttributeAsFloat(java.lang.String attribute)
throws AttributeNotFoundException,
ValueParseException
float value of the specified parameter contained
in this node.
getAttributeAsFloat in interface Elementattribute - The name of the attribute you ask the value of.
AttributeNotFoundException - If no attribute with that name exists.
ValueParseException - or if conversion to float fails.
public double getAttributeAsDouble(java.lang.String attribute)
throws AttributeNotFoundException,
ValueParseException
double value of the specified attribute contained
in this node.
getAttributeAsDouble in interface Elementname - The name of the attribute you ask the value of.
AttributeNotFoundException - If no attribute with that name exists.
NumberParseException - or if conversion to double fails.
ValueParseException
public boolean getAttributeAsBoolean(java.lang.String attribute)
throws AttributeNotFoundException,
ValueParseException
boolean value of the specified parameter contained
in this node.
getAttributeAsBoolean in interface Elementattribute - The name of the attribute you ask the value of.
AttributeNotFoundException - If no attribute with that name exists.
ValueParseException - or if conversion to boolean fails.
public java.lang.String getAttribute(java.lang.String attribute,
java.lang.String defaultValue)
String, or the default value if no attribute by
that name exists or is empty.
getAttribute in interface Elementattribute - The name of the attribute you ask the value of.defaultValue - The default value desired.
public int getAttributeAsInteger(java.lang.String attribute,
int defaultValue)
int, or the default value if no attribute by
that name exists or is empty.
getAttributeAsInteger in interface Elementattribute - The name of the attribute you ask the value of.defaultValue - The default value desired.
public long getAttributeAsLong(java.lang.String attribute,
long defaultValue)
long, or the default value if no attribute by
that name exists or is empty.
getAttributeAsLong in interface Elementattribute - The name of the attribute you ask the value of.defaultValue - The default value desired.
public float getAttributeAsFloat(java.lang.String attribute,
float defaultValue)
float, or the default value if no attribute by
that name exists or is empty.
getAttributeAsFloat in interface Elementattribute - The name of the attribute you ask the value of.defaultValue - The default value desired.
public double getAttributeAsDouble(java.lang.String attribute,
double defaultValue)
double, or the default value if no attribute by
that name exists or is empty.
getAttributeAsDouble in interface Elementname - The name of the attribute you ask the value of.defaultValue - The default value desired.
public boolean getAttributeAsBoolean(java.lang.String attribute,
boolean defaultValue)
boolean, or the default value if no attribute by
that name exists or is empty.
getAttributeAsBoolean in interface Elementattribute - The name of the attribute you ask the value of.defaultValue - The default value desired.
public final Element createElement(java.lang.String name)
createElement in interface Element
public final Element createElement(java.lang.String element,
java.lang.String value)
createElement in interface Element
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundExceptionpublic Version getVersion()
getVersion in interface VersionedObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||