|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DOMWrapper
DOMWrapper implements a Wrapper around the Element class from any DOM-style XML parser. The wrapper is used to isolate ElementParser, ElementDef, and all ElementDef subclasses from the specifics of the underlying XML parser.
Field Summary | |
---|---|
static int |
CDATA
CDATA is a type of DOM Element representing a piece of text embedded in a CDATA section, for example, <![CDATA[Some text]]> . |
static int |
COMMENT
COMMENT is a type of DOM Element representing an XML comment. |
static int |
ELEMENT
ELEMENT is a type of DOM Element representing a named tag, possibly containing attributes, child elements, and text. |
static int |
FREETEXT
FREETEXT is a type of DOM Element representing a piece of text (but not a CDATA section). |
static int |
UNKNOWN
UNKNOWN is used for DOM Element types unsupported by the wrapper. |
Method Summary | |
---|---|
String |
getAttribute(String attrName)
Returns the value of the attribute with the given attrName. |
String[] |
getAttributeNames()
Returns a list of attribute names. |
DOMWrapper[] |
getChildren()
Returns all children of this element, including TEXT elements, as an array of DOMWrappers. |
DOMWrapper[] |
getElementChildren()
Returns all element children of this element as an array of DOMWrappers. |
Location |
getLocation()
Returns the location of this element. |
String |
getTagName()
Returns the tag name of this element, or null for TEXT elements. |
String |
getText()
Returns a flattened representation of the text inside thie element. |
int |
getType()
Returns the type of this element/node. |
String |
toXML()
Returns this node serialized as XML. |
Field Detail |
---|
static final int UNKNOWN
static final int FREETEXT
Some text
. FREETEXT
elements always have a tag name of NULL and have no children. It
maps to a TextDef
.
static final int ELEMENT
ElementDef
(or a generated class derived from it), or a GenericDef
.
static final int COMMENT
CommentDef
.
static final int CDATA
<![CDATA[Some text]]>
.
CDATA elements always have a tag name of NULL and have no children. It
maps to a CdataDef
.
Method Detail |
---|
int getType()
FREETEXT
, ELEMENT
, COMMENT
,
CDATA
.
String getTagName()
String getAttribute(String attrName)
String[] getAttributeNames()
String getText()
String toXML()
DOMWrapper[] getChildren()
DOMWrapper[] getElementChildren()
Location getLocation()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |