de.ispsoft.jaxme.generator.dtd
Class DTDElement

java.lang.Object
  extended byde.ispsoft.jaxme.generator.dtd.DTDObject
      extended byde.ispsoft.jaxme.generator.dtd.DTDElement
All Implemented Interfaces:
java.lang.Cloneable

public class DTDElement
extends DTDObject
implements java.lang.Cloneable

Stores one element declaration from the DTD.

Version:
$Id: DTDElement.java,v 1.2 2003/05/21 03:30:19 joe Exp $
Author:
Jochen Wiedmann

Field Summary
static int TYPE_ANY
          A valid DTDElement type: ANY
static int TYPE_CHOICE
          A valid DTDElement type: Choice
static int TYPE_EMPTY
          A valid DTDElement type: EMPTY
static int TYPE_PCDATA
          A valid DTDElement type: #PCDATA
static int TYPE_SEQUENCE
          A valid DTDElement type: Sequence
 
Constructor Summary
DTDElement(java.lang.String pName, java.lang.String pModel)
          Constructor for DTDElement.
 
Method Summary
 void addAttribute(DTDAttribute pAttr)
          Adds an attribute to the element.
 void addAttributes(java.util.List pElements)
          Adds the attributes to the element.
 void addChild(DTDElement pChild)
          Adds an element to the list of childs.
 void clearAttributes()
          Clears the elements attribute list.
 void clearChilds()
          Clears the elements child list.
protected  DTDElement cloneMe()
           
 java.util.Iterator getAttributes()
          Returns an iterator to the attribute list.
 java.util.Iterator getChilds()
          Returns an iterator to the child list.
 java.lang.String getModel()
          Returns the model as a string.
 int getType()
          Returns the element type.
 boolean isAttribute()
          Returns whether this object is an Attribute.
protected  void parseChilds(java.util.List pElements, java.lang.String pSeparator)
          Parses the child list.
 void parseModel()
          Parses the model to determine the element type.
 void parseModel(java.util.List pElements)
          Parses the model in order to build the list of childs.
 void setType(int pType)
          Sets the element type.
 
Methods inherited from class de.ispsoft.jaxme.generator.dtd.DTDObject
getMaxOccurs, getMinOccurs, getName, setMaxOccurs, setMinOccurs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_PCDATA

public static final int TYPE_PCDATA

A valid DTDElement type: #PCDATA

See Also:
Constant Field Values

TYPE_ANY

public static final int TYPE_ANY

A valid DTDElement type: ANY

See Also:
Constant Field Values

TYPE_EMPTY

public static final int TYPE_EMPTY

A valid DTDElement type: EMPTY

See Also:
Constant Field Values

TYPE_SEQUENCE

public static final int TYPE_SEQUENCE

A valid DTDElement type: Sequence

See Also:
Constant Field Values

TYPE_CHOICE

public static final int TYPE_CHOICE

A valid DTDElement type: Choice

See Also:
Constant Field Values
Constructor Detail

DTDElement

public DTDElement(java.lang.String pName,
                  java.lang.String pModel)
Constructor for DTDElement.

Method Detail

getModel

public java.lang.String getModel()

Returns the model as a string.


getType

public int getType()

Returns the element type.


setType

public void setType(int pType)

Sets the element type.


addAttribute

public void addAttribute(DTDAttribute pAttr)

Adds an attribute to the element.


getAttributes

public java.util.Iterator getAttributes()

Returns an iterator to the attribute list.


clearAttributes

public void clearAttributes()

Clears the elements attribute list.


addChild

public void addChild(DTDElement pChild)

Adds an element to the list of childs.


getChilds

public java.util.Iterator getChilds()

Returns an iterator to the child list.


clearChilds

public void clearChilds()

Clears the elements child list.


parseChilds

protected void parseChilds(java.util.List pElements,
                           java.lang.String pSeparator)
                    throws SchemaException

Parses the child list.

Throws:
SchemaException

addAttributes

public void addAttributes(java.util.List pElements)

Adds the attributes to the element.


parseModel

public void parseModel()
                throws SchemaException

Parses the model to determine the element type. No child or attribute lists are built.

Throws:
SchemaException

parseModel

public void parseModel(java.util.List pElements)
                throws SchemaException

Parses the model in order to build the list of childs.

Parameters:
pElements - List of DTDElement objects
Throws:
SchemaException

isAttribute

public final boolean isAttribute()
Description copied from class: DTDObject

Returns whether this object is an Attribute.

Specified by:
isAttribute in class DTDObject

cloneMe

protected DTDElement cloneMe()