Top Description Inners Fields Constructors Methods
com.sun.msv.grammar.xmlschema

public Class ElementDeclExp

extends ReferenceExp
Class Inheritance
Imports
java.util.Vector, com.sun.msv.grammar.ChoiceExp, .ElementExp, .Expression, .NameClass, .ReferenceExp, .SimpleNameClass, com.sun.msv.grammar.util.ExpressionWalker

Element declaration.

the inherited exp field holds an expression that also matches to substituted element declarations.

The body field contains an expression that matches only to this element declaration without no substituted element decls.

Element Declaration Schema Component Properties

This table shows the mapping between "element declaration schema component properties" (which is defined in the spec) and corresponding method/field of this class.

Property of the spec method/field of this class
name The name field.
target namespace the getTargetNamespace() method.
type definition getTypeDefinition() method.
scope To be implemented
value constraint To be implemented. Accessible through the body field.
nillable the isNillable field.
identity constraints The identityConstraints field of the XSElementExp, which in turn can be obtained throught the body field.
substitution group affiliation The substitutionAffiliation field.
substitution group exclusion The finalValue field.
disallowed substitution The block field.
abstract the isAbstract() method.
annotation Unaccessible. This information is removed during the parsing phase.

Abstractness

The exp field and the self field are very similar. In fact, the only difference is that the former is affected by the abstract property, while the latter isn't.

So if it has to be affected by the abstract property (like referencing a complex type as the element body), you should use the exp field. If you don't want to be affected by the abstract property (like referencing a complex type as the base type of another complex type), then you should refer to the body field.

Author
Kohsuke KAWAGUCHI

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final int
public int
block

The disallowed substitution property of this schema component, implemented as a bit field.

public final ReferenceExp
body

The expression that represents the "body" of this expression.

private ElementDeclExp.XSElementExp
public static final int
public int
finalValue

The substitution group exclusions property of this schema component, implemented as a bit field.

public boolean
isNillable

gets the nillable property of this component as specified in the spec.

public final XMLSchemaSchema
parent

parent XMLSchemaSchema object to which this object belongs.

public static final int
private static final long
public static final int
public ElementDeclExp
public final ReferenceExp
substitutions

choices of all elements that can validly substitute this element.

Inherited from com.sun.msv.grammar.ReferenceExp:
expname

Constructor Summary

AccessConstructor and Description
public
ElementDeclExp(XMLSchemaSchema schema, String typeLocalName)

Method Summary

Modifier and TypeMethod and Description
public Expression
getContentModel()

gets the pattern that represents the content model of this element declaration.

public ElementDeclExp.XSElementExp
public final String
getTargetNamespace()

gets the target namespace property of this component as specified in the spec.

public XMLSchemaTypeExp
getTypeDefinition()

gets the type definition property of this schema component.

public boolean

Returns:

true if this method is abstract.
isAbstract
()

checks if this element declaration is abstract.

public boolean
isDefined()

Overrides com.sun.msv.grammar.ReferenceExp.isDefined.

checks if this ReferenceExp is properly defined.
public boolean

Returns:

true if this component is global. false if this component is local.
isGlobal
()

gets the scope property of this component as specified in the spec.

public boolean
public boolean
public void
setAbstract(boolean isAbstract)

public void
Inherited from com.sun.msv.grammar.ReferenceExp:
calcEpsilonReducibilitycalcHashCodeequalsvisitvisitvisitvisit

Field Detail

ALLback to summary
public static final int ALL
blockback to summary
public int block

The disallowed substitution property of this schema component, implemented as a bit field.

a bit-wise OR of RESTRICTION, EXTENSION, and SUBSTITUTION.

bodyback to summary
public final ReferenceExp body

The expression that represents the "body" of this expression. Usually, this refers to XSElementExp, but not necessarily.

elementback to summary
private ElementDeclExp.XSElementExp element
EXTENSIONback to summary
public static final int EXTENSION
finalValueback to summary
public int finalValue

The substitution group exclusions property of this schema component, implemented as a bit field.

a bit-wise OR of RESTRICTION and EXTENSION.

isNillableback to summary
public boolean isNillable

gets the nillable property of this component as specified in the spec.

parentback to summary
public final XMLSchemaSchema parent

parent XMLSchemaSchema object to which this object belongs.

RESTRICTIONback to summary
public static final int RESTRICTION
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.sun.msv.grammar.ReferenceExp.serialVersionUID.

SUBSTITUTIONback to summary
public static final int SUBSTITUTION
substitutionAffiliationback to summary
public ElementDeclExp substitutionAffiliation

The substitution group affiliation property of this component, if any. Otherwise null.

substitutionsback to summary
public final ReferenceExp substitutions

choices of all elements that can validly substitute this element.

Constructor Detail

ElementDeclExpback to summary
public ElementDeclExp(XMLSchemaSchema schema, String typeLocalName)

Method Detail

getContentModelback to summary
public Expression getContentModel()

gets the pattern that represents the content model of this element declaration. This method is just a short cut for self.contentModel.

getElementExpback to summary
public ElementDeclExp.XSElementExp getElementExp()
getTargetNamespaceback to summary
public final String getTargetNamespace()

gets the target namespace property of this component as specified in the spec.

If the property is absent, then this method returns the empty string.

This method is just a shortcut for parent.targetNamespace.

getTypeDefinitionback to summary
public XMLSchemaTypeExp getTypeDefinition()

gets the type definition property of this schema component.

isAbstractback to summary
public boolean isAbstract()

checks if this element declaration is abstract.

Returns:boolean

true if this method is abstract.

isDefinedback to summary
public boolean isDefined()

Overrides com.sun.msv.grammar.ReferenceExp.isDefined.

Doc from com.sun.msv.grammar.ReferenceExp.isDefined.

checks if this ReferenceExp is properly defined. this method is used to detect undeclared definitions. Derived classes can override this method.

isGlobalback to summary
public boolean isGlobal()

gets the scope property of this component as specified in the spec.

Returns:boolean

true if this component is global. false if this component is local.

isRestrictionBlockedback to summary
public boolean isRestrictionBlocked()
isSubstitutionBlockedback to summary
public boolean isSubstitutionBlocked()
setAbstractback to summary
public void setAbstract(boolean isAbstract)
setElementExpback to summary
public void setElementExp(ElementDeclExp.XSElementExp exp)
com.sun.msv.grammar.xmlschema back to summary

public Class ElementDeclExp.XSElementExp

extends ElementExp
Class Inheritance
Annotations
@SuppressWarnings:serial

XML Schema version of ElementExp.
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
public final String
public final SimpleNameClass
public final Vector<Object>
identityConstraints

identity constraints associated to this declaration.

public final ElementDeclExp
Inherited from com.sun.msv.grammar.ElementExp:
contentModelignoreUndeclaredAttributes

Constructor Summary

AccessConstructor and Description
public
XSElementExp(ElementDeclExp parent, SimpleNameClass elementName, Expression contentModel, String defaultValue)

public
XSElementExp(ElementDeclExp parent, SimpleNameClass elementName, Expression contentModel)

Method Summary

Modifier and TypeMethod and Description
public final NameClass
Inherited from com.sun.msv.grammar.ElementExp:
calcEpsilonReducibilitycalcHashCodeequalsgetContentModelvisitvisitvisitvisit

Field Detail

defaultValueback to summary
public final String defaultValue
elementNameback to summary
public final SimpleNameClass elementName
identityConstraintsback to summary
public final Vector<Object> identityConstraints

identity constraints associated to this declaration. When no constraint exists, this field may be null (or empty vector). Items are of derived types of IdentityConstraint class.

These identity constraints are not enforced by the default Verifier implementation.

parentback to summary
public final ElementDeclExp parent

Constructor Detail

XSElementExpback to summary
public XSElementExp(ElementDeclExp parent, SimpleNameClass elementName, Expression contentModel, String defaultValue)
XSElementExpback to summary
public XSElementExp(ElementDeclExp parent, SimpleNameClass elementName, Expression contentModel)

Method Detail

getNameClassback to summary
public final NameClass getNameClass()

Implements abstract com.sun.msv.grammar.ElementExp.getNameClass.

Implements com.sun.msv.grammar.NameClassAndExpression.getNameClass.

Doc from com.sun.msv.grammar.ElementExp.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.