|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<java.lang.String,java.lang.String>
xmlwise.XmlElementAttributes
public class XmlElementAttributes
This is a hash map containing all attributes of a single element.
Aside from the hash map methods, it also has convenience methods for extracting integers, booleans and doubles.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary | |
---|---|
XmlElementAttributes(org.w3c.dom.Element element)
Creates an object given an Element object. |
Method Summary | |
---|---|
boolean |
getBoolean(java.lang.String attribute)
Get an boolean attribute. |
double |
getDouble(java.lang.String attribute)
Get a double attribute. |
int |
getInt(java.lang.String attribute)
Get an integer attribute. |
java.lang.String |
toXml()
Renders the content of the attributes as Xml. |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public XmlElementAttributes(org.w3c.dom.Element element)
element
- the element to read from.Method Detail |
---|
public int getInt(java.lang.String attribute) throws XmlParseException
attribute
- the name of the attribute.
XmlParseException
- if we fail to parse this attribute as an int, or the attribute is missing.public double getDouble(java.lang.String attribute) throws XmlParseException
attribute
- the name of the attribute.
XmlParseException
- if we fail to parse this attribute as an double, or the attribute is missing.public boolean getBoolean(java.lang.String attribute) throws XmlParseException
"true", "yes" and "y" are all interpreted as true. (Case-independent)
"false", "no" and "no" are all interpreted at false. (Case-independent)
attribute
- the name of the attribute.
XmlParseException
- if the attribute value does match true or false as defined, or the attribute is missing.public java.lang.String toXml()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |