Package org.eigenbase.xom

## Class MetaDef.Element

- java.lang.Object
- - org.eigenbase.xom.ElementDef
  - - org.eigenbase.xom.MetaDef.Element

All Implemented Interfaces:
  `java.io.Serializable`, `java.lang.Cloneable`, `MetaDef.Definition`, `MetaDef.FullDefinition`, `NodeDef`

Enclosing class:
  MetaDef

    public static class MetaDef.Element
    extends ElementDef
    implements MetaDef.FullDefinition

An Element Definition defines a basic entity of the meta model. Elements are containers for two types of data: attributes and content. Attributes are simple name/value pairs which may take on the full range of Java types. Content consists of other Elements and Strings, either appearing alone or as arrays.

See Also:
  Serialized Form

### Field Summary

Fields
`java.lang.Boolean` `_abstract`
`java.lang.String` `_class`
`static java.lang.String[]` `_contentModel_values` Allowable values for `contentModel`.
`DOMWrapper` `_def`
`MetaDef.Any` `any`
`MetaDef.Attribute[]` `attributes` This array defines all attributes to appear within this class or element.
`MetaDef.CData` `cdata`
`java.lang.String` `code` This element allows arbitrary Java Code to be attached to any class or element.
`MetaDef.Content[]` `content` This array defines all content (objects and arrays) to appear within this class or element.
`java.lang.String` `contentModel`
`java.lang.String` `doc` Doc tags allow documentation to be added to any definition.
`java.lang.String` `dtdName`
`java.lang.Boolean` `keepDef`
`java.lang.String` `type`

### Constructor Summary

Constructors
`Element()`
`Element​(DOMWrapper _def)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `display​(java.io.PrintWriter _out, int _indent)` Outputs this node to any PrintWriter, in a formatted fashion with automatic indenting.
`boolean` `displayDiff​(ElementDef _other, java.io.PrintWriter _out, int _indent)` The displayDiff function compares this element definition against another, compiling a message containing all diffs.
`void` `displayXML​(XMLOutput _out, int _indent)` Outputs this element definition in XML to any XMLOutput.
`java.lang.String` `getName()` Returns the name of this node's tag.

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

`addChild, addChildren, clone, constructElement, constructElement, deepCopy, diff, displayAttribute, displayAttributeDiff, displayElement, displayElementArray, displayElementArrayDiff, displayElementDiff, displayIndent, displayString, displayStringArray, displayStringArrayDiff, displayStringDiff, displayXML, displayXMLElement, displayXMLElementArray, displayXMLString, displayXMLStringArray, equals, getChildren, getElementChildren, getElementClass, getLocation, getMixedChildren, getMixedChildren_new, getText, getType, getWrapper, hashCode, toCompactXML, toString, toXML, verifyEqual`

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

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

### Methods inherited from interface org.eigenbase.xom.NodeDef

`getChildren, getLocation, getText, getType, getWrapper`

### Field Detail

#### _contentModel_values

    public static final java.lang.String[] _contentModel_values

Allowable values for `contentModel`.

#### contentModel

    public java.lang.String contentModel

#### keepDef

    public java.lang.Boolean keepDef

#### type

    public java.lang.String type

#### _class

    public java.lang.String _class

#### dtdName

    public java.lang.String dtdName

#### _abstract

    public java.lang.Boolean _abstract

#### _def

    public DOMWrapper _def

#### doc

    public java.lang.String doc

Doc tags allow documentation to be added to any definition. The documentation will automatically appear in all physical forms of this model, including dtds, java classes, and the xsl transformation.

#### attributes

    public MetaDef.Attribute[] attributes

This array defines all attributes to appear within this class or element.

#### content

    public MetaDef.Content[] content

This array defines all content (objects and arrays) to appear within this class or element. The interpretation of this array depends on the element's defined content model.

#### any

    public MetaDef.Any any

#### cdata

    public MetaDef.CData cdata

#### code

    public java.lang.String code

This element allows arbitrary Java Code to be attached to any class or element. Code sections are not verified until the final .java class is compiled and should be used sparingly.

### Constructor Detail

#### Element

    public Element()

#### Element

    public Element​(DOMWrapper _def)
            throws XOMException

Throws:
  `XOMException`

### Method Detail

#### getName

    public java.lang.String getName()

Description copied from interface: `NodeDef`
Returns the name of this node's tag.

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

#### display

    public void display​(java.io.PrintWriter _out,
                        int _indent)

Description copied from interface: `NodeDef`
Outputs this node to any PrintWriter, in a formatted fashion with automatic indenting.

Specified by:
  `display` in interface `NodeDef`
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

#### displayDiff

    public boolean displayDiff​(ElementDef _other,
                               java.io.PrintWriter _out,
                               int _indent)

Description copied from class: `ElementDef`
The displayDiff function compares this element definition against another, compiling a message containing all diffs. It is used internally by the equals(), diff(), and verifyEquals() functions.

Overrides:
  `displayDiff` in class `ElementDef`
Parameters:
  `_other` - the ElementDef to which to compare this element.
  `_out` - a PrintWriter to which to display any discovered differences, or null if just doing an equality check (and no diff report is needed).
  `_indent` - the current indentation level (used for nice display of diffs).
Returns:
  true if this and other match exactly, false if not.