Class XmlSchemaElement

All Implemented Interfaces:
TypeReceiver, XmlSchemaNamed, XmlSchemaNamedWithForm, XmlSchemaObjectBase, XmlSchemaAllMember, XmlSchemaChoiceMember, XmlSchemaItemWithRef<XmlSchemaElement>, XmlSchemaItemWithRefBase, XmlSchemaSequenceMember

Class for elements, representing xs:element. This class represents both global elements and elements nested inside of types.
  • Field Details

    • block

      Attribute used to block a type derivation.
    • constraints

      private List<XmlSchemaIdentityConstraint> constraints
    • defaultValue

      private String defaultValue
      Provides the default value of the element if its content is a simple type or the element's content is textOnly.
    • fixedValue

      private String fixedValue
    • finalDerivation

      private XmlSchemaDerivationMethod finalDerivation
    • abstractElement

      private boolean abstractElement
    • nillable

      private boolean nillable
    • ref

    • schemaType

      private XmlSchemaType schemaType
      Returns the type of the element. This can either be a complex type or a simple type.
    • schemaTypeName

      private QName schemaTypeName
      QName of a built-in data type defined in this schema or another schema indicated by the specified namespace.
    • substitutionGroup

      private QName substitutionGroup
      QName of an element that can be a substitute for this element.
    • namedDelegate

      private XmlSchemaNamedWithFormImpl namedDelegate
  • Constructor Details

    • XmlSchemaElement

      public XmlSchemaElement(XmlSchema parentSchema, boolean topLevel)
      Creates new XmlSchemaElement
  • Method Details

    • equals

      public boolean equals(Object what)
      Overrides:
      equals in class XmlSchemaObject
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class XmlSchemaObject
    • getConstraints

      public List<XmlSchemaIdentityConstraint> getConstraints()
      Returns a collection of constraints on the element.
    • getDefaultValue

      public String getDefaultValue()
    • setDefaultValue

      public void setDefaultValue(String defaultValue)
    • getBlock

      public XmlSchemaDerivationMethod getBlock()
    • setBlock

      public void setBlock(XmlSchemaDerivationMethod block)
    • getFinal

      public XmlSchemaDerivationMethod getFinal()
    • setFinal

      public void setFinal(XmlSchemaDerivationMethod finalDerivationValue)
    • getFixedValue

      public String getFixedValue()
    • setFixedValue

      public void setFixedValue(String fixedValue)
    • isAbstract

      public boolean isAbstract()
    • setAbstract

      public void setAbstract(boolean isAbstract)
    • isNillable

      public boolean isNillable()
    • setNillable

      public void setNillable(boolean isNillable)
    • getRef

      public XmlSchemaRef<XmlSchemaElement> getRef()
      Specified by:
      getRef in interface XmlSchemaItemWithRef<XmlSchemaElement>
    • getSchemaType

      public XmlSchemaType getSchemaType()
    • setSchemaType

      public void setSchemaType(XmlSchemaType schemaType)
    • getSchemaTypeName

      public QName getSchemaTypeName()
    • setSchemaTypeName

      public void setSchemaTypeName(QName schemaTypeName)
    • getSubstitutionGroup

      public QName getSubstitutionGroup()
    • setSubstitutionGroup

      public void setSubstitutionGroup(QName substitutionGroup)
    • setType

      public void setType(XmlSchemaType type)
      Specified by:
      setType in interface TypeReceiver
    • getName

      public String getName()
      Description copied from interface: XmlSchemaNamed
      Retrieve the name.
      Specified by:
      getName in interface XmlSchemaNamed
      Returns:
      the local name of this object within its schema.
    • getParent

      public XmlSchema getParent()
      Description copied from interface: XmlSchemaNamed
      Retrieve the parent schema.
      Specified by:
      getParent in interface XmlSchemaNamed
      Returns:
      the containing schema.
    • getQName

      public QName getQName()
      Get the QName for this object. This is always the formal name that identifies this item in the schema. If the item has a form (an element or attribute), and the form is 'unqualified', this is not the appropriate QName in an instance document. For those items, the getWiredName method returns the appropriate QName for an instance document.
      Specified by:
      getQName in interface XmlSchemaNamed
      Returns:
      The qualified name of this object.
      See Also:
    • isAnonymous

      public boolean isAnonymous()
      Specified by:
      isAnonymous in interface XmlSchemaNamed
      Returns:
      true if this object has no name.
    • isTopLevel

      public boolean isTopLevel()
      Specified by:
      isTopLevel in interface XmlSchemaNamed
      Returns:
      true if this item is a top-level item of the schema; false if this item is nested inside of some other schema object.
    • setName

      public void setName(String name)
      Description copied from interface: XmlSchemaNamed
      Set the name. Set to null to render the object anonymous, or to prepare to change it to refer to some other object.
      Specified by:
      setName in interface XmlSchemaNamed
      Parameters:
      name - the name.
    • getForm

      public XmlSchemaForm getForm()
      Description copied from interface: XmlSchemaNamedWithForm
      Get the current form, which may be inherited from the parent schema. This will never return XmlSchemaForm.NONE.
      Specified by:
      getForm in interface XmlSchemaNamedWithForm
      Returns:
    • isFormSpecified

      public boolean isFormSpecified()
      Description copied from interface: XmlSchemaNamedWithForm
      True if this item has a specified form, false if it inherits from the parent schema.
      Specified by:
      isFormSpecified in interface XmlSchemaNamedWithForm
      Returns:
    • setForm

      public void setForm(XmlSchemaForm form)
      Description copied from interface: XmlSchemaNamedWithForm
      Set the schema form.
      Specified by:
      setForm in interface XmlSchemaNamedWithForm
      Parameters:
      form - Schema form. Pass in XmlSchemaForm.NONE to inherit from the parent schema.
    • getWireName

      public QName getWireName()
      Description copied from interface: XmlSchemaNamedWithForm
      The name of this item as it is sent 'over the wire' or stored in an XML file. If the form is unqualified, this has "" for a namespaceURI. Otherwise, it is the same as getQName().
      Specified by:
      getWireName in interface XmlSchemaNamedWithForm
      Returns:
    • setFinalDerivation

      public void setFinalDerivation(XmlSchemaDerivationMethod finalDerivation)
      Parameters:
      finalDerivation - The finalDerivation to set.
    • getFinalDerivation

      public XmlSchemaDerivationMethod getFinalDerivation()
      Returns:
      Returns the finalDerivation.
    • setAbstractElement

      public void setAbstractElement(boolean abstractElement)
      Set the 'abstract' attribute of this element.
      Parameters:
      abstractElement -
    • isAbstractElement

      public boolean isAbstractElement()
      Returns:
      true if this element is abstract.
    • isRef

      public boolean isRef()
      Specified by:
      isRef in interface XmlSchemaItemWithRefBase
      Returns:
      true if this object has a non-null ref.
    • getTargetQName

      public QName getTargetQName()
      Specified by:
      getTargetQName in interface XmlSchemaItemWithRefBase
      Returns:
      the Qualified Name of the target of the ref.
    • getRefBase

      public XmlSchemaRefBase getRefBase()
      Specified by:
      getRefBase in interface XmlSchemaItemWithRefBase
      Returns:
      the non-generic reference object.