org.apache.ws.commons.schema
Class XmlSchemaElement

java.lang.Object
  extended by org.apache.ws.commons.schema.XmlSchemaObject
      extended by org.apache.ws.commons.schema.XmlSchemaAnnotated
          extended by org.apache.ws.commons.schema.XmlSchemaParticle
              extended by org.apache.ws.commons.schema.XmlSchemaElement
All Implemented Interfaces:
TypeReceiver, XmlSchemaNamed, XmlSchemaNamedWithForm, XmlSchemaObjectBase, XmlSchemaAllMember, XmlSchemaChoiceMember, XmlSchemaItemWithRef<XmlSchemaElement>, XmlSchemaItemWithRefBase, XmlSchemaSequenceMember

public class XmlSchemaElement
extends XmlSchemaParticle
implements TypeReceiver, XmlSchemaNamedWithForm, XmlSchemaChoiceMember, XmlSchemaSequenceMember, XmlSchemaAllMember, XmlSchemaItemWithRef<XmlSchemaElement>

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


Field Summary
 
Fields inherited from class org.apache.ws.commons.schema.XmlSchemaParticle
DEFAULT_MAX_OCCURS, DEFAULT_MIN_OCCURS
 
Constructor Summary
XmlSchemaElement(XmlSchema parentSchema, boolean topLevel)
          Creates new XmlSchemaElement
 
Method Summary
 boolean equals(Object what)
           
 XmlSchemaDerivationMethod getBlock()
           
 List<XmlSchemaIdentityConstraint> getConstraints()
          Returns a collection of constraints on the element.
 String getDefaultValue()
           
 XmlSchemaDerivationMethod getFinal()
           
 XmlSchemaDerivationMethod getFinalDerivation()
           
 String getFixedValue()
           
 XmlSchemaForm getForm()
          Get the current form, which may be inherited from the parent schema.
 String getName()
          Retrieve the name.
 XmlSchema getParent()
          Retrieve the parent schema.
 QName getQName()
          Get the QName for this object.
 XmlSchemaRef<XmlSchemaElement> getRef()
           
 XmlSchemaRefBase getRefBase()
           
 XmlSchemaType getSchemaType()
           
 QName getSchemaTypeName()
           
 QName getSubstitutionGroup()
           
 QName getTargetQName()
           
 QName getWireName()
          The name of this item as it is sent 'over the wire' or stored in an XML file.
 int hashCode()
           
 boolean isAbstract()
           
 boolean isAbstractElement()
           
 boolean isAnonymous()
           
 boolean isFormSpecified()
          True if this item has a specified form, false if it inherits from the parent schema.
 boolean isNillable()
           
 boolean isRef()
           
 boolean isTopLevel()
           
 void setAbstract(boolean isAbstract)
           
 void setAbstractElement(boolean abstractElement)
          Set the 'abstract' attribute of this element.
 void setBlock(XmlSchemaDerivationMethod block)
           
 void setDefaultValue(String defaultValue)
           
 void setFinal(XmlSchemaDerivationMethod finalDerivationValue)
           
 void setFinalDerivation(XmlSchemaDerivationMethod finalDerivation)
           
 void setFixedValue(String fixedValue)
           
 void setForm(XmlSchemaForm form)
          Set the schema form.
 void setName(String name)
          Set the name.
 void setNillable(boolean isNillable)
           
 void setSchemaType(XmlSchemaType schemaType)
           
 void setSchemaTypeName(QName schemaTypeName)
           
 void setSubstitutionGroup(QName substitutionGroup)
           
 void setType(XmlSchemaType type)
           
 
Methods inherited from class org.apache.ws.commons.schema.XmlSchemaParticle
getMaxOccurs, getMinOccurs, setMaxOccurs, setMinOccurs
 
Methods inherited from class org.apache.ws.commons.schema.XmlSchemaAnnotated
getAnnotation, getId, getUnhandledAttributes, setAnnotation, setId, setUnhandledAttributes, toString
 
Methods inherited from class org.apache.ws.commons.schema.XmlSchemaObject
addMetaInfo, getLineNumber, getLinePosition, getMetaInfoMap, getSourceURI, setLineNumber, setLinePosition, setMetaInfoMap, setSourceURI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XmlSchemaElement

public XmlSchemaElement(XmlSchema parentSchema,
                        boolean topLevel)
Creates new XmlSchemaElement

Method Detail

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:
XmlSchemaNamedWithForm.getWireName()

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.


Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.