public class GenericDef extends ElementDef
GenericDef
is a ElementDef
whose attributes and
children are stored in collections, not generated members. It is convenient
for building XML documents, but is not strongly typed.Constructor and Description |
---|
GenericDef(String tagName) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(NodeDef element) |
void |
display(PrintWriter out,
int indent)
Outputs this node to any PrintWriter,
in a formatted fashion with automatic indenting.
|
void |
displayXML(XMLOutput out,
int indent)
Outputs this element definition in XML to any XMLOutput.
|
Object |
getAttribute(String key) |
NodeDef[] |
getChildren()
Returns the children of this node.
|
String |
getName()
Returns the tag name of this element, or null for TEXT elements.
|
int |
getType()
Returns the type of this element.
|
void |
setAttribute(String key,
Object value) |
addChildren, clone, constructElement, constructElement, deepCopy, diff, displayAttribute, displayAttributeDiff, displayDiff, displayElement, displayElementArray, displayElementArrayDiff, displayElementDiff, displayIndent, displayString, displayStringArray, displayStringArrayDiff, displayStringDiff, displayXML, displayXMLElement, displayXMLElementArray, displayXMLString, displayXMLStringArray, equals, getElementChildren, getElementClass, getLocation, getMixedChildren_new, getMixedChildren, getText, getWrapper, hashCode, toCompactXML, toString, toXML, verifyEqual
public GenericDef(String tagName)
public void display(PrintWriter out, int indent)
NodeDef
out
- the PrintWriter to which to write this NodeDef.indent
- the indentation level for the printout.public void displayXML(XMLOutput out, int indent)
NodeDef
displayXML
in interface NodeDef
displayXML
in class ElementDef
out
- the XMLOutput class to display the XMLpublic int getType()
NodeDef
DOMWrapper.getType()
.getType
in interface NodeDef
getType
in class ElementDef
public String getName()
getName
in interface NodeDef
getName
in class ElementDef
public void addChild(NodeDef element)
addChild
in class ElementDef
public NodeDef[] getChildren()
NodeDef
getChildren
in interface NodeDef
getChildren
in class ElementDef
public void setAttribute(String key, Object value)
public Object getAttribute(String key)