|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.merlotxml.util.xml.GrammarComplexType
Provides access to the grammar for an element. This class is extended by xerces.DTDGrammarComplexTypeImpl and xerces.SchemaGrammarComplexTypeImpl.
Nested Class Summary | |
protected class |
GrammarComplexType.ListComparator
Sorts objects according to their positions in another list. |
Field Summary | |
protected java.util.Vector |
_attributes
The possible attributes that are defined for this element. |
protected java.util.Hashtable |
_namedAttributes
GrammarSimpleType objects hashed by name |
protected GrammarSimpleType |
_simpleContent
The definition for the node value, or #PCDATA, of this element. |
protected int |
debugLevel
Utility to minimise the output during debugging. |
static long |
totalDurationIsEachAttributeValid
|
static long |
totalDurationIsLocationValid
|
static long |
totalDurationIsSimpleContentValid
|
Constructor Summary | |
GrammarComplexType()
|
Method Summary | |
protected void |
debug(int level,
java.lang.String msg)
Utility for debugging. |
GrammarSimpleType |
getAttribute(java.lang.String name)
Gets a named attribute. |
GrammarSimpleType[] |
getAttributes()
Gets all the defined attributes. |
abstract GrammarComplexType |
getChild(java.lang.String name)
Gets a locally defined element by name. |
protected java.lang.String[] |
getChildNodeNames(org.w3c.dom.Node el)
Returns the node names of all the current children of the element. |
protected java.lang.String[] |
getChildNodeNamesWithoutText(org.w3c.dom.Node el)
Returns the node names of all children of this node, except for the children that are #text, #comment, or pi_node nodes. |
abstract GrammarComplexType[] |
getChildren()
Gets all the children defined within the scope of this parent. |
abstract java.lang.String |
getDocumentation()
Gets the value of the |
java.lang.String |
getFirstMissingChildName(org.w3c.dom.Element el)
|
protected int |
getIndexWithoutTextNodes(org.w3c.dom.Node el,
int index)
Recalculates what a child position would have been if there weren't any text nodes. |
GrammarComplexType[] |
getInsertableElements(org.w3c.dom.Node node)
Gets all the possible insertable elements that are valid somewhere between the current children of the node. |
GrammarComplexType[] |
getInsertableElements(org.w3c.dom.Node node,
int index)
Gets all the child complex types that may be inserted as children of the node at the given position. |
int |
getInsertPosition(org.w3c.dom.Node parent,
java.lang.String childElementName)
Gets the position where a child named childElementName may be inserted. |
boolean |
getIsComplete(org.w3c.dom.Element el)
|
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. |
abstract boolean |
getIsNillable()
Means whether an attribute xsi:nil='true' may be inserted into the XML file. |
abstract 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. |
abstract int |
getMaxOccurs()
Gets the maximum number of instances of this type of element that are allowed. |
abstract int |
getMinOccurs()
Gets the valid minimum number of instances of this type of element. |
abstract java.lang.String |
getName()
Gets the name of this complex type. |
protected java.lang.String[] |
getNames(GrammarComplexType[] complexTypes)
Convenience method to get an array of names from an array of complex types. |
abstract GrammarComplexType |
getParentComplexType(org.w3c.dom.Element el)
|
protected int |
getPositionAmongPeers(org.w3c.dom.Node parent,
org.w3c.dom.Node child)
Gets the position of the child among its peers under the parent. |
GrammarSimpleType |
getSimpleContent()
Gets the GrammarSimpleType that defines the simple content (#PCDATA) of this element. |
abstract boolean |
isEmptyType()
|
abstract boolean |
isMixedType()
|
abstract void |
resetValidation(org.w3c.dom.Element el)
|
java.lang.String |
toString()
|
protected java.lang.String |
toString(java.lang.String[] strings)
Convenience method for debugging. |
protected java.lang.String |
toString(java.util.Vector strings)
Convenience method for debugging. |
abstract int |
validate(org.w3c.dom.Element el)
Validates the element in terms of its position in the structure of the document. |
protected abstract int |
validate(java.lang.String[] candidateNodeNames)
Validates the candidate node names for their position in the structure. |
protected java.lang.String[] |
whatCanGoHere(java.lang.String[] currentChildElements,
int insertPosition)
The possible elements that could be inserted at this position, given the current children. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Vector _attributes
protected java.util.Hashtable _namedAttributes
protected GrammarSimpleType _simpleContent
protected int debugLevel
public static long totalDurationIsEachAttributeValid
public static long totalDurationIsSimpleContentValid
public static long totalDurationIsLocationValid
Constructor Detail |
public GrammarComplexType()
Method Detail |
public GrammarSimpleType getAttribute(java.lang.String name)
name
- The name of the attribute.
public GrammarSimpleType[] getAttributes()
public abstract GrammarComplexType getChild(java.lang.String name)
name
- The name of the child element.
public abstract GrammarComplexType[] getChildren()
public abstract GrammarComplexType getParentComplexType(org.w3c.dom.Element el)
public abstract java.lang.String getDocumentation()
public int getInsertPosition(org.w3c.dom.Node parent, java.lang.String childElementName)
parent
- The parent to hold this child.childElementName
- The node name of the child.
public GrammarComplexType[] getInsertableElements(org.w3c.dom.Node node, int index)
node
- The parent node.index
- The zero-based position where a child node is to be
inserted.
public GrammarComplexType[] getInsertableElements(org.w3c.dom.Node node)
node
- The parent node.
public boolean getIsEachAttributeValid(org.w3c.dom.Element el)
el
- The element for which all attributes must be checked.
public abstract boolean getIsSimpleContentAllowed()
public boolean getIsSimpleContentValid(org.w3c.dom.Element el)
el
- The element to be validated.
public boolean getIsLocationValid(org.w3c.dom.Element el)
el
- The element to be validated.
public boolean getIsComplete(org.w3c.dom.Element el)
public java.lang.String getFirstMissingChildName(org.w3c.dom.Element el)
public abstract void resetValidation(org.w3c.dom.Element el)
public abstract boolean getIsNillable()
For DTDs always returns false.
For Schemas, returns whether nillable has been set to true for this element.
public abstract int getMaxOccurs()
public abstract int getMinOccurs()
public abstract java.lang.String getName()
public GrammarSimpleType getSimpleContent()
public abstract int validate(org.w3c.dom.Element el)
el
- The element to be validated for structure.
protected void debug(int level, java.lang.String msg)
level
- 0=no debugging, 1 little bit, 2 more, etc.msg
- The message to print.protected java.lang.String[] getChildNodeNames(org.w3c.dom.Node el)
el
- Description of Parameter
protected java.lang.String[] getChildNodeNamesWithoutText(org.w3c.dom.Node el)
el
- The parent element.
protected int getIndexWithoutTextNodes(org.w3c.dom.Node el, int index)
el
- The parent element.index
- The index of the child element.
protected java.lang.String[] getNames(GrammarComplexType[] complexTypes)
complexTypes
- Description of Parameter
protected int getPositionAmongPeers(org.w3c.dom.Node parent, org.w3c.dom.Node child)
parent
- The parent node.child
- The child node.
protected java.lang.String toString(java.lang.String[] strings)
strings
- Description of Parameter
protected java.lang.String toString(java.util.Vector strings)
strings
- Description of Parameter
public java.lang.String toString()
protected abstract int validate(java.lang.String[] candidateNodeNames)
candidateNodeNames
- Description of Parameter
protected java.lang.String[] whatCanGoHere(java.lang.String[] currentChildElements, int insertPosition)
currentChildElements
- The current children node names.insertPosition
- The zero-based position where a new child is
to be inserted.
public abstract boolean isEmptyType()
public abstract boolean isMixedType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |