|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.xml.def.DefaultElement
public class DefaultElement
Default implementation of XML element.
Constructor Summary | |
---|---|
DefaultElement(java.lang.String name)
Creates a new element name . |
Method Summary | |
---|---|
void |
addAttribute(Attribute a)
Adds a new attribute associated with this element. |
java.lang.String |
getAttribute(java.lang.String name)
Returns the value of the attribute with name . |
java.lang.String |
getCharacterData()
Returns the character data contained in this element. |
java.lang.String |
getName()
Returns the name of this element, the element type. |
boolean |
hasAttribute(java.lang.String name)
Returns whether an attribute with the given name is associated with this element. |
boolean |
isEmptyElementTag()
Returns whether this element uses an empty element tag to indicate an empty element. |
void |
setCharacterData(java.lang.String data)
Sets the character data contained in this element. |
void |
setEmptyElementTag(boolean empty)
Determines if this element uses an empty element tag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultElement(java.lang.String name)
name
.
name
- name of element, the element's typeMethod Detail |
---|
public final void addAttribute(Attribute a)
Element
addAttribute
in interface Element
a
- the attribute to addpublic final java.lang.String getAttribute(java.lang.String name)
Element
name
.
getAttribute
in interface Element
name
- name of attribute to get attribute value
null
if no such attributepublic final java.lang.String getCharacterData()
Element
Character data is the element's content without markup. No formatting is done on
character data.
Put it more simple, character data is the actual value information (in textual
format) of an element.
getCharacterData
in interface Element
null
if no data availablepublic final java.lang.String getName()
Element
getName
in interface Element
public boolean hasAttribute(java.lang.String name)
Element
hasAttribute
in interface Element
name
- attribute name
true
if an attribute with the given name is associated with
this element, false
otherwisepublic final boolean isEmptyElementTag()
Element
An element with no content is said to be empty. An empty element tag is of the form
'<' Name (S Attribute)* S? '/>'
, with S being
space. Note that if this method returns false
, it does not imply
this element has any content, returned by Element.getCharacterData()
.
isEmptyElementTag
in interface Element
true
if empty element with empty element tag,
false
otherwisepublic final void setCharacterData(java.lang.String data)
Element
If new character data is set, the empty element tag is set false
.
setCharacterData
in interface Element
data
- character data of this element, null
for no datapublic final void setEmptyElementTag(boolean empty)
Element
If empty element tag is used, this element also has no content.
setEmptyElementTag
in interface Element
empty
- true
if empty element, false
otherwise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |