oracle.xml.parser.v2

## Class ElementDecl

- java.lang.Object
- - oracle.xml.parser.v2.XMLNode
  - - oracle.xml.parser.v2.ElementDecl

All Implemented Interfaces:
  java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, EventTarget, Node, NodeEditVAL

    public class ElementDecl
    extends XMLNode
    implements java.io.Serializable, java.io.Externalizable

This class represents an element declaration in a DTD.

See Also:
  Serialized Form

### Field Summary

Fields
`static byte` `ANY` Element content type - Children can be any element
`static int` `ASTERISK` ContentModelParseTreeNode type - "*" node (has one children)
`static int` `COMMA` ContentModelParseTreeNode type - "," node (has two children)
`static int` `ELEMENT` ContentModelParseTreeNode type - 'leaf' node (has no children)
`static byte` `ELEMENTS` Element content type - Children can be elements as per Content Model
`static byte` `EMPTY` Element content type - No Children
`static byte` `MIXED` Element content type - Children can be PCDATA & elements as per CM
`static int` `OR` ContentModelParseTreeNode type - "|" node (has two children)
`static int` `PLUS` ContentModelParseTreeNode type - "+" node (has one children)
`static int` `QMARK` ContentModelParseTreeNode type - "?"

### Fields inherited from class oracle.xml.parser.v2.XMLNode

`ATTRDECL, Auto_Events, capturing, DOMAttrModified, DOMCharacterDataModified, DOMNodeInserted, DOMNodeInsertedIntoDocument, DOMNodeRemoved, DOMNodeRemovedFromDocument, DOMSubtreeModified, ELEMENTDECL, KEPT_NODE, NAMESPACE_NODE, noncapturing, RANGE_DELETE_EVENT, RANGE_DELETETEXT_EVENT, RANGE_INSERT_EVENT, RANGE_INSERTTEXT_EVENT, RANGE_REPLACE_EVENT, RANGE_SETTEXT_EVENT, TRAVERSAL_DELETE_EVENT, TRAVERSAL_REPLACE_EVENT, XMLDECL_NODE`

### Fields inherited from interface org.w3c.dom.Node

`ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE`

### Fields inherited from interface org.w3c.dom.validation.NodeEditVAL

`VAL_FALSE, VAL_INCOMPLETE, VAL_NS_WF, VAL_SCHEMA, VAL_TRUE, VAL_UNKNOWN, VAL_WF`

### Constructor Summary

Constructors
Constructor and Description
`ElementDecl()` Default constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.util.Vector` `expectedElements(Element e)` Returns vector of element names that can be appended to the element.
`AttrDecl` `findAttrDecl(java.lang.String name)` Gets an attribute declaration object or null if not found
`NamedNodeMap` `getAttrDecls()` Gets an enumeration of attribute declarations
`java.util.Vector` `getContentElements()` Returns Vector of elements that can be appended to this element
`int` `getContentType()` Returns content model of element
`java.lang.String` `getNodeName()` Gets the name of this node, depending on its type
`short` `getNodeType()` Gets a code representing the type of the underlying object
`Node` `getParseTree()` Returns the root node of Content Model Parse Tree.
`void` `readExternal(java.io.ObjectInput inArg)` This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly.
`boolean` `validateContent(Element e)` Validates the content of a element node.
`void` `writeExternal(java.io.ObjectOutput outArg)` This method saves the state of the object by creating a binray compressed stream with information about this object.

### Methods inherited from class oracle.xml.parser.v2.XMLNode

`addEventListener, addText, appendChild, canAppendChild, canInsertBefore, canRemoveChild, canReplaceChild, cloneNode, dispatchEvent, equals, getAttributes, getChildNodes, getColumnNumber, getDebugMode, getDefaultValue, getEnumeratedValues, getFirstChild, getFirstChildAsOffset, getLastChild, getLineNumber, getLocalName, getNamespaceURI, getNextSibling, getNextSiblingAsOffset, getNodeValue, getNodeValueAsBinaryStream, getNodeValueAsBinaryStream, getNodeValueAsCharacterStream, getNodeValueAsCharacterStream, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getPrimitiveTypeId, getProperty, getSystemId, getText, getXMLError, hasAttributes, hasChildNodes, hashCode, insertBefore, isDocumentFlag, isNodeFlag, isSupported, nodeValidity, normalize, print, print, print, print, removeChild, removeEventListener, replaceChild, reportSAXEvents, resetNodeFlag, selectNodes, selectNodes, selectSingleNode, selectSingleNode, setDebugInfo, setNodeFlag, setNodeFlag, setNodeFlag, setNodeValue, setNodeValueAsBinaryStream, setNodeValueAsBinaryStream, setNodeValueAsCharacterStream, setNodeValueAsCharacterStream, setPrefix, setProperty, transformNode, valueOf, valueOf, xdbGetNodeId`

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

`getClass, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### EMPTY

    public static final byte EMPTY

Element content type - No Children

See Also:
  Constant Field Values

#### ANY

    public static final byte ANY

Element content type - Children can be any element

See Also:
  Constant Field Values

#### MIXED

    public static final byte MIXED

Element content type - Children can be PCDATA & elements as per CM

See Also:
  Constant Field Values

#### ELEMENTS

    public static final byte ELEMENTS

Element content type - Children can be elements as per Content Model

See Also:
  Constant Field Values

#### ELEMENT

    public static final int ELEMENT

ContentModelParseTreeNode type - 'leaf' node (has no children)

See Also:
  Constant Field Values

#### OR

    public static final int OR

ContentModelParseTreeNode type - "|" node (has two children)

See Also:
  Constant Field Values

#### COMMA

    public static final int COMMA

ContentModelParseTreeNode type - "," node (has two children)

See Also:
  Constant Field Values

#### QMARK

    public static final int QMARK

ContentModelParseTreeNode type - "?" node (has one children)

See Also:
  Constant Field Values

#### ASTERISK

    public static final int ASTERISK

ContentModelParseTreeNode type - "*" node (has one children)

See Also:
  Constant Field Values

#### PLUS

    public static final int PLUS

ContentModelParseTreeNode type - "+" node (has one children)

See Also:
  Constant Field Values

### Constructor Detail

#### ElementDecl

    public ElementDecl()

Default constructor. Note that this constructor is used only during deserialization/decompression of this DOM node. In order to deserialize this node to construct the DOM node from the serialized/ compressed stream, it is required to create a handle of the object.

### Method Detail

#### getNodeType

    public short getNodeType()

Gets a code representing the type of the underlying object

Specified by:
  `getNodeType` in interface `Node`
Overrides:
  `getNodeType` in class `XMLNode`
Returns:
  type of the node

#### getNodeName

    public java.lang.String getNodeName()

Gets the name of this node, depending on its type

Specified by:
  `getNodeName` in interface `Node`
Overrides:
  `getNodeName` in class `XMLNode`
Returns:
  Name of this node

#### validateContent

    public boolean validateContent(Element e)

Validates the content of a element node.

Returns:
  True if valid, else false

#### expectedElements

    public java.util.Vector expectedElements(Element e)

Returns vector of element names that can be appended to the element.

Parameters:
  `e` - Element
Returns:
  Vector of names

#### getAttrDecls

    public NamedNodeMap getAttrDecls()

Gets an enumeration of attribute declarations

Returns:
  An enumeration of attribute declarations

#### findAttrDecl

    public final AttrDecl findAttrDecl(java.lang.String name)

Gets an attribute declaration object or null if not found

Parameters:
  `name` - Attribute declaration to find
Returns:
  The `AttrDecl` object, or null, if it was not found

#### getContentType

    public int getContentType()

Returns content model of element

Returns:
  The `type` of the element declaration.

#### getContentElements

    public final java.util.Vector getContentElements()

Returns Vector of elements that can be appended to this element

Returns:
  The `Vector` containing the element names.

#### getParseTree

    public final Node getParseTree()

Returns the root node of Content Model Parse Tree. Node.getFirstChild() and Node.getLastChild() return the the parse tree branches. Node.getNodeType() and Node.getNodeName() return the the parse tree node type and name.

Returns:
  The Node containing the Content Model parse tree root node.

#### writeExternal

    public void writeExternal(java.io.ObjectOutput outArg)
                       throws java.io.IOException

This method saves the state of the object by creating a binray compressed stream with information about this object.

Specified by:
  `writeExternal` in interface `java.io.Externalizable`
Overrides:
  `writeExternal` in class `XMLNode`
Parameters:
  `outArg` - The ObjectOutput stream used to write the serialized/ compressed stream.
Throws:
  `java.io.IOException` - is thrown when there is an exception while writing the serialized/compressed stream.

#### readExternal

    public void readExternal(java.io.ObjectInput inArg)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException

This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly.

Specified by:
  `readExternal` in interface `java.io.Externalizable`
Overrides:
  `readExternal` in class `XMLNode`
Parameters:
  `inArg` - the ObjectInput stream used for reading the compressed stream.
Throws:
  `java.io.IOException` - is thrown when there is an error in reading the input stream.
  `java.lang.ClassNotFoundException` - is thrown when the class is not found

Copyright © 2003, 2020, Oracle and/or its affiliates.