oracle.xml.parser.v2
Class ElementDecl

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

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

This class represents an element declaration in a DTD.

See Also:
Serialized Form

Field Summary
TypeField
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 int ELEMENT_DECLARED
           
static byte ELEMENTS
          Element content type - Children can be elements as per Content Model
static byte EMPTY
          Element content type - No Children
static int ID_ATTR_DECL
           
static byte MIXED
          Element content type - Children can be PCDATA & elements as per Content Model
static int OR
          ContentModelParseTreeNode type - "|" node (has two children)
static int PLUS
          ContentModelParseTreeNode type - "+" node (has one children)
static int QMARK
          ContentModelParseTreeNode type - "?" node (has one children)
 
Fields inherited from class oracle.xml.parser.v2.XMLNode
ATTRDECL, Auto_Events, capturing, DOMAttrModified, DOMCharacterDataModified, DOMNodeInserted, DOMNodeInsertedIntoDocument, DOMNodeRemoved, DOMNodeRemovedFromDocument, DOMSubtreeModified, ELEMENTDECL, 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 oracle.xml.comp.CXMLConstants
ATTR_DEF, ATTR_TOKEN, ATTRDECL_DEF, CDATA_DEF, CHAR_DEF, COMMENT_DEF, CXML_VERSION, cXMLFILE, cXMLFILE_LEN, DEBUG, DTD_DEF, ELEMENTDECL_DEF, END, ENTITY_DEF, ENTITYREF_DEF, META_ID_MAX, names, NOTATION_DEF, NS_DEF, NULLSTR, PI_DEF, PREFIX_DEF, TAG_DEF, TAG_TOKEN, TOKEN_ONLY, XMLDECL_DEF
 
Constructor Summary
ElementDecl()
          Default constructor.
 
Method Summary
TypeMethod
 Node cloneNode(boolean deep)
          Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
 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 the Element Decl.
 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.
 void readExternal(oracle.xml.io.XMLObjectInput in, oracle.xml.comp.CXMLContext cxmlContext)
          This method reads the ElementDecl content
 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, appendChild, dispatchEvent, getAttributes, getChildNodes, getColumnNumber, getDebugMode, getFirstChild, getLastChild, getLineNumber, getLocalName, getNamespace, getNamespaceURI, getNextSibling, getNodeLocalName, getNodePrefix, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getProperty, getSystemId, getText, hasAttributes, hasChildNodes, insertBefore, isNodeFlag, isSupported, normalize, print, print, print, readChildNodes, removeChild, removeEventListener, replaceChild, reportSAXEvents, resetNodeFlag, selectNodes, selectNodes, selectNodes, selectSingleNode, selectSingleNode, setDebugInfo, setNodeFlag, setNodeValue, setPrefix, setProperty, supports, transformNode, valueOf, valueOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final byte EMPTY
Element content type - No Children

ANY

public static final byte ANY
Element content type - Children can be any element

MIXED

public static final byte MIXED
Element content type - Children can be PCDATA & elements as per Content Model

ELEMENTS

public static final byte ELEMENTS
Element content type - Children can be elements as per Content Model

ELEMENT

public static final int ELEMENT
ContentModelParseTreeNode type - 'leaf' node (has no children)

OR

public static final int OR
ContentModelParseTreeNode type - "|" node (has two children)

COMMA

public static final int COMMA
ContentModelParseTreeNode type - "," node (has two children)

QMARK

public static final int QMARK
ContentModelParseTreeNode type - "?" node (has one children)

ASTERISK

public static final int ASTERISK
ContentModelParseTreeNode type - "*" node (has one children)

PLUS

public static final int PLUS
ContentModelParseTreeNode type - "+" node (has one children)

ELEMENT_DECLARED

public static final int ELEMENT_DECLARED

ID_ATTR_DECL

public static final int ID_ATTR_DECL
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

getNodeName

public java.lang.String getNodeName()
Gets the name of the Element Decl.
Overrides:
getNodeName in class XMLNode
Returns:
name of the node

getNodeType

public short getNodeType()
Gets a code representing the type of the underlying object
Overrides:
getNodeType in class XMLNode
Returns:
type of the 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

cloneNode

public Node cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent ( parentNode returns null.).
Cloning an Element copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text node. Cloning any other type of node simply returns a copy of this node.
Overrides:
cloneNode in class XMLNode
Parameters:
deep - If true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an Element).
Returns:
The duplicate node.

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:
out - 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:
in - 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

readExternal

public void readExternal(oracle.xml.io.XMLObjectInput in,
                         oracle.xml.comp.CXMLContext cxmlContext)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
This method reads the ElementDecl content
Overrides:
readExternal in class XMLNode
Parameters:
in - XMLObjectInput the input stream
cxmlContent - the serialization object content information
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