Class ElementDeclExp

All Implemented Interfaces:
Serializable

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 ReferenceExp.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 ElementDeclExp.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
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • setElementExp

      public void setElementExp(ElementDeclExp.XSElementExp exp)
    • getElementExp

      public ElementDeclExp.XSElementExp getElementExp()
    • 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.
    • 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.
    • 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.

    • isAbstract

      public boolean isAbstract()
      checks if this element declaration is abstract.
      Returns:
      true if this method is abstract.
    • setAbstract

      public void setAbstract(boolean isAbstract)
    • isSubstitutionBlocked

      public boolean isSubstitutionBlocked()
    • isRestrictionBlocked

      public boolean isRestrictionBlocked()
    • getTypeDefinition

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

      public boolean isDefined()
      Description copied from class: ReferenceExp
      checks if this ReferenceExp is properly defined. this method is used to detect undeclared definitions. Derived classes can override this method.
      Overrides:
      isDefined in class ReferenceExp