com.sun.msv.grammar.xmlschema

Class ElementDeclExp

public class ElementDeclExp extends ReferenceExp

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 {@link #name} field.
target namespace the {@link #getTargetNamespace()} method.
type definition {@link #getTypeDefinition()} method.
scope To be implemented
value constraint To be implemented. Accessible through the {@link #body} field.
nillable the {@link #isNillable} field.
identity constraints The identityConstraints field of the {@link XSElementExp}, which in turn can be obtained throught the {@link #body} field.
substitution group affiliation The {@link #substitutionAffiliation} field.
substitution group exclusion The {@link #finalValue} field.
disallowed substitution The {@link #block} field.
abstract the {@link #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 Class Summary
classElementDeclExp.XSElementExp
XML Schema version of {@link ElementExp}.
Field Summary
static intALL
intblock
The disallowed substitution property of this schema component, implemented as a bit field.
ReferenceExpbody
The expression that represents the "body" of this expression.
static intEXTENSION
intfinalValue
The substitution group exclusions property of this schema component, implemented as a bit field.
booleanisNillable
gets the nillable property of this component as specified in the spec.
XMLSchemaSchemaparent
parent XMLSchemaSchema object to which this object belongs.
static intRESTRICTION
ElementDeclExpsubstitutionAffiliation
ReferenceExpsubstitutions
choices of all elements that can validly substitute this element.
static intSUBSTITUTION
Constructor Summary
ElementDeclExp(XMLSchemaSchema schema, String typeLocalName)
Method Summary
ExpressiongetContentModel()
gets the pattern that represents the content model of this element declaration.
ElementDeclExp.XSElementExpgetElementExp()
StringgetTargetNamespace()
gets the target namespace property of this component as specified in the spec.
XMLSchemaTypeExpgetTypeDefinition()
gets the type definition property of this schema component.
booleanisAbstract()
checks if this element declaration is abstract.
booleanisDefined()
booleanisGlobal()
gets the scope property of this component as specified in the spec.
booleanisRestrictionBlocked()
booleanisSubstitutionBlocked()
voidsetAbstract(boolean isAbstract)
voidsetElementExp(ElementDeclExp.XSElementExp exp)

Field Detail

ALL

public static final int ALL

block

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.

body

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

EXTENSION

public static final int EXTENSION

finalValue

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.

isNillable

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

parent

public final XMLSchemaSchema parent
parent XMLSchemaSchema object to which this object belongs.

RESTRICTION

public static final int RESTRICTION

substitutionAffiliation

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

substitutions

public final ReferenceExp substitutions
choices of all elements that can validly substitute this element.

SUBSTITUTION

public static final int SUBSTITUTION

Constructor Detail

ElementDeclExp

public ElementDeclExp(XMLSchemaSchema schema, String typeLocalName)

Method Detail

getContentModel

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.

getElementExp

public ElementDeclExp.XSElementExp getElementExp()

getTargetNamespace

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.

getTypeDefinition

public XMLSchemaTypeExp getTypeDefinition()
gets the type definition property of this schema component.

isAbstract

public boolean isAbstract()
checks if this element declaration is abstract.

Returns: true if this method is abstract.

isDefined

public boolean isDefined()

isGlobal

public boolean isGlobal()
gets the scope property of this component as specified in the spec.

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

isRestrictionBlocked

public boolean isRestrictionBlocked()

isSubstitutionBlocked

public boolean isSubstitutionBlocked()

setAbstract

public void setAbstract(boolean isAbstract)

setElementExp

public void setElementExp(ElementDeclExp.XSElementExp exp)