com.sun.msv.grammar
Class ElementExp

java.lang.Object
  extended by com.sun.msv.grammar.Expression
      extended by com.sun.msv.grammar.ElementExp
All Implemented Interfaces:
NameClassAndExpression, Serializable
Direct Known Subclasses:
AnyOtherElementExp, ElementDeclExp.XSElementExp, ElementPattern, ElementRule, ExternalElementExp

public abstract class ElementExp
extends Expression
implements NameClassAndExpression

Element declaration. For RELAX, this is a base implementation of 'elementRule' declaration. For TREX, this is a base implementation of 'element' pattern. Each grammar must/can provide only one concrete implementation. Therefore, they cannot override visit method.

This class can be extended.

Author:
Kohsuke KAWAGUCHI
See Also:
Serialized Form

Field Summary
 Expression contentModel
          content model of this element declaration.
 boolean ignoreUndeclaredAttributes
          a flag that indicates undeclared attributes should be ignored.
 
Fields inherited from class com.sun.msv.grammar.Expression
anyString, epsilon, nullSet, verifierTag
 
Constructor Summary
ElementExp(Expression contentModel, boolean ignoreUndeclaredAttributes)
           
 
Method Summary
protected  boolean calcEpsilonReducibility()
          computes epsilon reducibility
protected  int calcHashCode()
          Computes the hashCode again.
 boolean equals(Object o)
           
 Expression getContentModel()
           
abstract  NameClass getNameClass()
          obtains a constraint over tag name.
 Object visit(ExpressionVisitor visitor)
           
 boolean visit(ExpressionVisitorBoolean visitor)
           
 Expression visit(ExpressionVisitorExpression visitor)
           
 void visit(ExpressionVisitorVoid visitor)
           
 
Methods inherited from class com.sun.msv.grammar.Expression
getExpandedExp, hashCode, hashCode, hashCode, isEpsilonReducible, peelOccurence, readResolve, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contentModel

public Expression contentModel
content model of this element declaration.


ignoreUndeclaredAttributes

public boolean ignoreUndeclaredAttributes
a flag that indicates undeclared attributes should be ignored.

Constructor Detail

ElementExp

public ElementExp(Expression contentModel,
                  boolean ignoreUndeclaredAttributes)
Method Detail

getContentModel

public final Expression getContentModel()
Specified by:
getContentModel in interface NameClassAndExpression

getNameClass

public abstract NameClass getNameClass()
obtains a constraint over tag name. ElementExp is cannot be shared because NameClass has to be mutable to absorb the difference of RELAX and TREX. In case of TREX, name class will be determined when parsing ElementExp itself. Thus effectively it's immutable. In case of RELAX, name class will be determined when its corresponding Clause object is parsed.

Specified by:
getNameClass in interface NameClassAndExpression

calcHashCode

protected final int calcHashCode()
Description copied from class: Expression
Computes the hashCode again.

This method and the parameter to the constructor has to be the same. This method is used when the object is being read from the stream.

Specified by:
calcHashCode in class Expression

equals

public final boolean equals(Object o)
Specified by:
equals in class Expression

visit

public final Object visit(ExpressionVisitor visitor)
Specified by:
visit in class Expression

visit

public final Expression visit(ExpressionVisitorExpression visitor)
Specified by:
visit in class Expression

visit

public final boolean visit(ExpressionVisitorBoolean visitor)
Specified by:
visit in class Expression

visit

public final void visit(ExpressionVisitorVoid visitor)
Specified by:
visit in class Expression

calcEpsilonReducibility

protected final boolean calcEpsilonReducibility()
Description copied from class: Expression
computes epsilon reducibility

Specified by:
calcEpsilonReducibility in class Expression


MSV