|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Element
Represents a XML element holding necessary information for reading XML data.
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. |
Method Detail |
---|
void addAttribute(Attribute a)
a
- the attribute to addjava.lang.String getAttribute(java.lang.String name)
name
.
name
- name of attribute to get attribute value
null
if no such attributejava.lang.String getCharacterData()
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.
null
if no data availablejava.lang.String getName()
boolean hasAttribute(java.lang.String name)
name
- attribute name
true
if an attribute with the given name is associated with
this element, false
otherwiseboolean isEmptyElementTag()
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 getCharacterData()
.
true
if empty element with empty element tag,
false
otherwisevoid setCharacterData(java.lang.String data)
If new character data is set, the empty element tag is set false
.
data
- character data of this element, null
for no datavoid setEmptyElementTag(boolean empty)
If empty element tag is used, this element also has no content.
empty
- true
if empty element, false
otherwise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |