org.merlotxml.util.xml.xerces
Class DTDGrammarComplexTypeImpl

java.lang.Object
  extended byorg.merlotxml.util.xml.GrammarComplexType
      extended byorg.merlotxml.util.xml.xerces.DTDGrammarComplexTypeImpl

public class DTDGrammarComplexTypeImpl
extends GrammarComplexType


Nested Class Summary
 
Nested classes inherited from class org.merlotxml.util.xml.GrammarComplexType
GrammarComplexType.ListComparator
 
Field Summary
protected  GrammarComplexType _parentComplexType
          The parent element within which this is defined.
 
Fields inherited from class org.merlotxml.util.xml.GrammarComplexType
_attributes, _namedAttributes, _simpleContent, debugLevel, totalDurationIsEachAttributeValid, totalDurationIsLocationValid, totalDurationIsSimpleContentValid
 
Constructor Summary
DTDGrammarComplexTypeImpl(DTDGrammarDocumentImpl grammarDocument, int elementDeclIndex, org.apache.xerces.impl.dtd.XMLElementDecl elementDecl)
           
 
Method Summary
 GrammarComplexType getChild(java.lang.String name)
          Gets a locally defined element by name.
 GrammarComplexType[] getChildren()
          Gets all the children defined within the scope of this parent.
 java.lang.String getDocumentation()
          Gets the value of the value defined in the Schema.
 boolean getIsEachAttributeValid(org.w3c.dom.Element el)
          Checks the validity of the values of each of the attributes.
 boolean getIsLocationValid(org.w3c.dom.Element el)
          Checks whether this element is in an allowed place in the structure of the document.
 boolean getIsNillable()
          Means whether an attribute xsi:nil='true' may be inserted into the XML file.
 boolean getIsSimpleContentAllowed()
          Determines if the element may contain simple content (#PCDATA).
 boolean getIsSimpleContentValid(org.w3c.dom.Element el)
          Validates the value of the simple content of this element.
 int getMaxOccurs()
          Gets the maximum number of instances of this type of element that are allowed.
 int getMinOccurs()
          Gets the valid minimum number of instances of this type of element.
 java.lang.String getName()
          Gets the name of this complex type.
 GrammarComplexType getParentComplexType(org.w3c.dom.Element el)
           
 boolean isElementValid(org.w3c.dom.Element el)
           
 boolean isEmptyType()
           
 boolean isMixedType()
           
 boolean isValid(org.w3c.dom.Element el)
           
 void resetValidation(org.w3c.dom.Element el)
           
 int validate(org.w3c.dom.Element el)
          Validates the element in terms of its position in the structure of the document.
protected  int validate(java.lang.String[] children)
          Validates the candidate node names for their position in the structure.
 
Methods inherited from class org.merlotxml.util.xml.GrammarComplexType
debug, getAttribute, getAttributes, getChildNodeNames, getChildNodeNamesWithoutText, getFirstMissingChildName, getIndexWithoutTextNodes, getInsertableElements, getInsertableElements, getInsertPosition, getIsComplete, getNames, getPositionAmongPeers, getSimpleContent, toString, toString, toString, whatCanGoHere
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_parentComplexType

protected GrammarComplexType _parentComplexType
The parent element within which this is defined.

Constructor Detail

DTDGrammarComplexTypeImpl

public DTDGrammarComplexTypeImpl(DTDGrammarDocumentImpl grammarDocument,
                                 int elementDeclIndex,
                                 org.apache.xerces.impl.dtd.XMLElementDecl elementDecl)
Method Detail

getChild

public GrammarComplexType getChild(java.lang.String name)
Description copied from class: GrammarComplexType
Gets a locally defined element by name.

Specified by:
getChild in class GrammarComplexType
Parameters:
name - The name of the child element.
Returns:
The child.

getChildren

public GrammarComplexType[] getChildren()
Description copied from class: GrammarComplexType
Gets all the children defined within the scope of this parent.

Specified by:
getChildren in class GrammarComplexType
Returns:
The children.

getParentComplexType

public GrammarComplexType getParentComplexType(org.w3c.dom.Element el)
Specified by:
getParentComplexType in class GrammarComplexType

getDocumentation

public java.lang.String getDocumentation()
Description copied from class: GrammarComplexType
Gets the value of the value defined in the Schema. This is a useful place to store help documentation about each element.

Specified by:
getDocumentation in class GrammarComplexType
Returns:
The documentation value

getIsEachAttributeValid

public boolean getIsEachAttributeValid(org.w3c.dom.Element el)
Description copied from class: GrammarComplexType
Checks the validity of the values of each of the attributes.

Overrides:
getIsEachAttributeValid in class GrammarComplexType
Parameters:
el - The element for which all attributes must be checked.
Returns:
False if any attribute is invalid.

getIsNillable

public boolean getIsNillable()
Description copied from class: GrammarComplexType
Means whether an attribute xsi:nil='true' may be inserted into the XML file.

For DTDs always returns false.

For Schemas, returns whether nillable has been set to true for this element.

Specified by:
getIsNillable in class GrammarComplexType

getIsSimpleContentAllowed

public boolean getIsSimpleContentAllowed()
Description copied from class: GrammarComplexType
Determines if the element may contain simple content (#PCDATA).

Specified by:
getIsSimpleContentAllowed in class GrammarComplexType
Returns:
The isSimpleContentAllowed value

getIsSimpleContentValid

public boolean getIsSimpleContentValid(org.w3c.dom.Element el)
Description copied from class: GrammarComplexType
Validates the value of the simple content of this element. In other words, the value of the #text node below this element is validated.

Overrides:
getIsSimpleContentValid in class GrammarComplexType
Parameters:
el - The element to be validated.
Returns:
The isSimpleContentValid value

getMaxOccurs

public int getMaxOccurs()
Description copied from class: GrammarComplexType
Gets the maximum number of instances of this type of element that are allowed.

Specified by:
getMaxOccurs in class GrammarComplexType
Returns:
The maxOccurs value, or -1 for infinite.

getMinOccurs

public int getMinOccurs()
Description copied from class: GrammarComplexType
Gets the valid minimum number of instances of this type of element.

Specified by:
getMinOccurs in class GrammarComplexType
Returns:
The minOccurs value

getName

public java.lang.String getName()
Description copied from class: GrammarComplexType
Gets the name of this complex type. Might be null if it is an anonymous complex type.

Specified by:
getName in class GrammarComplexType
Returns:
The name value

getIsLocationValid

public boolean getIsLocationValid(org.w3c.dom.Element el)
Description copied from class: GrammarComplexType
Checks whether this element is in an allowed place in the structure of the document.

Overrides:
getIsLocationValid in class GrammarComplexType
Parameters:
el - The element to be validated.
Returns:
The valid value

isValid

public boolean isValid(org.w3c.dom.Element el)

isElementValid

public boolean isElementValid(org.w3c.dom.Element el)

validate

public int validate(org.w3c.dom.Element el)
Description copied from class: GrammarComplexType
Validates the element in terms of its position in the structure of the document.

Specified by:
validate in class GrammarComplexType
Parameters:
el - The element to be validated for structure.
Returns:
The position of the first child that is not valid.

resetValidation

public void resetValidation(org.w3c.dom.Element el)
Specified by:
resetValidation in class GrammarComplexType

isEmptyType

public boolean isEmptyType()
Specified by:
isEmptyType in class GrammarComplexType

isMixedType

public boolean isMixedType()
Specified by:
isMixedType in class GrammarComplexType

validate

protected int validate(java.lang.String[] children)
Description copied from class: GrammarComplexType
Validates the candidate node names for their position in the structure.

Specified by:
validate in class GrammarComplexType
Parameters:
children - Description of Parameter
Returns:
The position of the first child that is not valid.