Package org.eigenbase.xom

# Class GenericDef

java.lang.Object
org.eigenbase.xom.ElementDef
org.eigenbase.xom.GenericDef

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `NodeDef`

public class GenericDef extends ElementDef
A `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.

Since:
  3 October, 2001
Version:
  $Id: //open/util/resgen/src/org/eigenbase/xom/GenericDef.java#3 $
Author:
  jhyde
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`GenericDef(String tagName)`

## Method Summary

Modifier and Type
Method
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)`

### Methods inherited from class org.eigenbase.xom.ElementDef

`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, getMixedChildren_new, getText, getWrapper, hashCode, toCompactXML, toString, toXML, verifyEqual`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### GenericDef

public GenericDef(String tagName)

## Method Details

### display

public void display(PrintWriter out, int indent)
Description copied from interface: `NodeDef`
Outputs this node to any PrintWriter, in a formatted fashion with automatic indenting.

Parameters:
  `out` - the PrintWriter to which to write this NodeDef.
  `indent` - the indentation level for the printout.

### displayXML

public void displayXML(XMLOutput out, int indent)
Description copied from interface: `NodeDef`
Outputs this element definition in XML to any XMLOutput.

Specified by:
  `displayXML` in interface `NodeDef`
Overrides:
  `displayXML` in class `ElementDef`
Parameters:
  `out` - the XMLOutput class to display the XML

### getType

public int getType()
Description copied from interface: `NodeDef`
Returns the type of this element. Values are as for `DOMWrapper.getType()`.

Specified by:
  `getType` in interface `NodeDef`
Overrides:
  `getType` in class `ElementDef`

### getName

public String getName()
Returns the tag name of this element, or null for TEXT elements.

Specified by:
  `getName` in interface `NodeDef`
Overrides:
  `getName` in class `ElementDef`

### addChild

public void addChild(NodeDef element)

Overrides:
  `addChild` in class `ElementDef`

### getChildren

public NodeDef[] getChildren()
Description copied from interface: `NodeDef`
Returns the children of this node.

Specified by:
  `getChildren` in interface `NodeDef`
Overrides:
  `getChildren` in class `ElementDef`

### setAttribute

public void setAttribute(String key, Object value)

### getAttribute

public Object getAttribute(String key)