Matra DTD Parser 0.8b

com.conradroche.matra.decl
Class ElementType

java.lang.Object
  |
  +--com.conradroche.matra.decl.ElementType

public class ElementType
extends Object

Class to hold an Element Type declaration.


Constructor Summary
ElementType()
          Element constructor comment.
ElementType(String content)
          ElementType constructor.
 
Method Summary
 AttList getAttList()
          Returns the attribute list for this element type.
 String[] getAttributeNames()
          Returns the attribute names for the attributes of this element type.
 String getChildOptionality(String childName)
          Returns the cardinality for a child in the content spec of this element type.
 ElementType[] getChildren()
          Returns the child element types for this Element Type.
 String[] getChildrenNames()
          Returns the names of the child element types for this element type.
 String getName()
          Returns the name of this element type.
 String[] getParentNames()
          Returns the parent element names.
 boolean hasChildren()
          Checks if this element type has any children.
 boolean isAnyContentModel()
          Checks if the content model of this element type is ANY.
 boolean isEmptyContentModel()
          Checks if the content model of this element type is empty.
 void load(Hashtable elementList, Hashtable AttributeList)
          Loads the data for this element type.
 void setAttList(AttList attlist)
          Sets the attribute list for this elemen type.
 void setAttributeNames(String[] newAttributeNames)
          Sets the attribute names for this element type.
 void setChildren(ElementType[] newChildren)
          Sets the child elements for this element type.
 void setChildrenNames(String[] newChildrenNames)
          Sets the child element names.
 void setName(String newName)
          Sets the name for this element type.
 void setParentNames(String[] newParentNames)
          Sets the parent element names.
 String toString()
          Returns a DTD String representation for this element type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ElementType

public ElementType()
Element constructor comment.

ElementType

public ElementType(String content)
            throws DTDException
ElementType constructor.
Parameters:
content - The element type declaration.
Throws:
DTDException - if syntax error is encountered.
Method Detail

getAttList

public AttList getAttList()
Returns the attribute list for this element type.
Returns:
The attribute list.
See Also:
setAttList(com.conradroche.matra.decl.AttList)

getAttributeNames

public String[] getAttributeNames()
Returns the attribute names for the attributes of this element type.
Returns:
The attribute names.
See Also:
setAttributeNames(java.lang.String[])

getChildOptionality

public String getChildOptionality(String childName)
Returns the cardinality for a child in the content spec of this element type.
Parameters:
childName - The name of the child element.
Returns:
The child's cardinality.

getChildren

public ElementType[] getChildren()
Returns the child element types for this Element Type.
Returns:
The child element types.
See Also:
setChildren(com.conradroche.matra.decl.ElementType[])

getChildrenNames

public String[] getChildrenNames()
Returns the names of the child element types for this element type.
Returns:
The names of the child element.
See Also:
setChildrenNames(java.lang.String[])

getName

public String getName()
Returns the name of this element type.
Returns:
The element type name.
See Also:
setName(java.lang.String)

getParentNames

public String[] getParentNames()
Returns the parent element names.
Returns:
The parent element names.
See Also:
setParentNames(java.lang.String[])

hasChildren

public boolean hasChildren()
Checks if this element type has any children.
Returns:
true if this element type has any children; false otherwise.

isAnyContentModel

public boolean isAnyContentModel()
Checks if the content model of this element type is ANY.
Returns:
true if the content model is ANY; false otherwise.

isEmptyContentModel

public boolean isEmptyContentModel()
Checks if the content model of this element type is empty.
Returns:
true if the content model is empty; false otherwise.

load

public void load(Hashtable elementList,
                 Hashtable AttributeList)
Loads the data for this element type.
Parameters:
elementList - The list of all element types in this DTD.
AttributeList - The list of all attributes for this element type.

setAttList

public void setAttList(AttList attlist)
Sets the attribute list for this elemen type.
Parameters:
attlist - The attribute list.
See Also:
getAttList()

setAttributeNames

public void setAttributeNames(String[] newAttributeNames)
Sets the attribute names for this element type.
Parameters:
newAttributeNames - The attribute names.
See Also:
getAttributeNames()

setChildren

public void setChildren(ElementType[] newChildren)
Sets the child elements for this element type.
Parameters:
newChildren - The child elements.
See Also:
getChildren()

setChildrenNames

public void setChildrenNames(String[] newChildrenNames)
Sets the child element names.
Parameters:
newChildrenNames - The child element names.
See Also:
getChildrenNames()

setName

public void setName(String newName)
Sets the name for this element type.
Parameters:
newName - The element name.
See Also:
getName()

setParentNames

public void setParentNames(String[] newParentNames)
Sets the parent element names.
Parameters:
newParentNames - The parent element names.
See Also:
getParentNames()

toString

public String toString()
Returns a DTD String representation for this element type.
Overrides:
toString in class Object
Returns:
DTD String for this element type.

Matra DTD Parser 0.8b