Package org.apache.ws.commons.schema
Class XmlSchemaElement
java.lang.Object
org.apache.ws.commons.schema.XmlSchemaObject
org.apache.ws.commons.schema.XmlSchemaAnnotated
org.apache.ws.commons.schema.XmlSchemaParticle
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
FieldsModifier and TypeFieldDescriptionprivate booleanprivate XmlSchemaDerivationMethodAttribute used to block a type derivation.private List<XmlSchemaIdentityConstraint> private StringProvides the default value of the element if its content is a simple type or the element's content is textOnly.private XmlSchemaDerivationMethodprivate Stringprivate XmlSchemaNamedWithFormImplprivate booleanprivate XmlSchemaRef<XmlSchemaElement> private XmlSchemaTypeReturns the type of the element.private QNameQName of a built-in data type defined in this schema or another schema indicated by the specified namespace.private QNameQName of an element that can be a substitute for this element.Fields inherited from class org.apache.ws.commons.schema.XmlSchemaParticle
DEFAULT_MAX_OCCURS, DEFAULT_MIN_OCCURSFields inherited from class org.apache.ws.commons.schema.XmlSchemaObject
lineNumber, linePosition, sourceURI -
Constructor Summary
ConstructorsConstructorDescriptionXmlSchemaElement(XmlSchema parentSchema, boolean topLevel) Creates new XmlSchemaElement -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBlock()Returns a collection of constraints on the element.getFinal()getForm()Get the current form, which may be inherited from the parent schema.getName()Retrieve the name.Retrieve the parent schema.getQName()Get the QName for this object.getRef()The name of this item as it is sent 'over the wire' or stored in an XML file.inthashCode()booleanbooleanbooleanbooleanTrue if this item has a specified form, false if it inherits from the parent schema.booleanbooleanisRef()booleanvoidsetAbstract(boolean isAbstract) voidsetAbstractElement(boolean abstractElement) Set the 'abstract' attribute of this element.voidvoidsetDefaultValue(String defaultValue) voidsetFinal(XmlSchemaDerivationMethod finalDerivationValue) voidsetFinalDerivation(XmlSchemaDerivationMethod finalDerivation) voidsetFixedValue(String fixedValue) voidsetForm(XmlSchemaForm form) Set the schema form.voidSet the name.voidsetNillable(boolean isNillable) voidsetSchemaType(XmlSchemaType schemaType) voidsetSchemaTypeName(QName schemaTypeName) voidsetSubstitutionGroup(QName substitutionGroup) voidsetType(XmlSchemaType type) Methods inherited from class org.apache.ws.commons.schema.XmlSchemaParticle
getMaxOccurs, getMinOccurs, setMaxOccurs, setMinOccursMethods inherited from class org.apache.ws.commons.schema.XmlSchemaAnnotated
getAnnotation, getId, getUnhandledAttributes, setAnnotation, setId, setUnhandledAttributes, toStringMethods inherited from class org.apache.ws.commons.schema.XmlSchemaObject
addMetaInfo, getLineNumber, getLinePosition, getMetaInfoMap, getSourceURI, setLineNumber, setLinePosition, setMetaInfoMap, setSourceURI
-
Field Details
-
block
Attribute used to block a type derivation. -
constraints
-
defaultValue
Provides the default value of the element if its content is a simple type or the element's content is textOnly. -
fixedValue
-
finalDerivation
-
abstractElement
private boolean abstractElement -
nillable
private boolean nillable -
ref
-
schemaType
Returns the type of the element. This can either be a complex type or a simple type. -
schemaTypeName
QName of a built-in data type defined in this schema or another schema indicated by the specified namespace. -
substitutionGroup
QName of an element that can be a substitute for this element. -
namedDelegate
-
-
Constructor Details
-
XmlSchemaElement
Creates new XmlSchemaElement
-
-
Method Details
-
equals
- Overrides:
equalsin classXmlSchemaObject
-
hashCode
public int hashCode()- Overrides:
hashCodein classXmlSchemaObject
-
getConstraints
Returns a collection of constraints on the element. -
getDefaultValue
-
setDefaultValue
-
getBlock
-
setBlock
-
getFinal
-
setFinal
-
getFixedValue
-
setFixedValue
-
isAbstract
public boolean isAbstract() -
setAbstract
public void setAbstract(boolean isAbstract) -
isNillable
public boolean isNillable() -
setNillable
public void setNillable(boolean isNillable) -
getRef
- Specified by:
getRefin interfaceXmlSchemaItemWithRef<XmlSchemaElement>
-
getSchemaType
-
setSchemaType
-
getSchemaTypeName
-
setSchemaTypeName
-
getSubstitutionGroup
-
setSubstitutionGroup
-
setType
- Specified by:
setTypein interfaceTypeReceiver
-
getName
Description copied from interface:XmlSchemaNamedRetrieve the name.- Specified by:
getNamein interfaceXmlSchemaNamed- Returns:
- the local name of this object within its schema.
-
getParent
Description copied from interface:XmlSchemaNamedRetrieve the parent schema.- Specified by:
getParentin interfaceXmlSchemaNamed- Returns:
- the containing schema.
-
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:
getQNamein interfaceXmlSchemaNamed- Returns:
- The qualified name of this object.
- See Also:
-
isAnonymous
public boolean isAnonymous()- Specified by:
isAnonymousin interfaceXmlSchemaNamed- Returns:
- true if this object has no name.
-
isTopLevel
public boolean isTopLevel()- Specified by:
isTopLevelin interfaceXmlSchemaNamed- 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
Description copied from interface:XmlSchemaNamedSet the name. Set to null to render the object anonymous, or to prepare to change it to refer to some other object.- Specified by:
setNamein interfaceXmlSchemaNamed- Parameters:
name- the name.
-
getForm
Description copied from interface:XmlSchemaNamedWithFormGet the current form, which may be inherited from the parent schema. This will never return XmlSchemaForm.NONE.- Specified by:
getFormin interfaceXmlSchemaNamedWithForm- Returns:
-
isFormSpecified
public boolean isFormSpecified()Description copied from interface:XmlSchemaNamedWithFormTrue if this item has a specified form, false if it inherits from the parent schema.- Specified by:
isFormSpecifiedin interfaceXmlSchemaNamedWithForm- Returns:
-
setForm
Description copied from interface:XmlSchemaNamedWithFormSet the schema form.- Specified by:
setFormin interfaceXmlSchemaNamedWithForm- Parameters:
form- Schema form. Pass in XmlSchemaForm.NONE to inherit from the parent schema.
-
getWireName
Description copied from interface:XmlSchemaNamedWithFormThe 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:
getWireNamein interfaceXmlSchemaNamedWithForm- Returns:
-
setFinalDerivation
- Parameters:
finalDerivation- The finalDerivation to set.
-
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:
isRefin interfaceXmlSchemaItemWithRefBase- Returns:
- true if this object has a non-null ref.
-
getTargetQName
- Specified by:
getTargetQNamein interfaceXmlSchemaItemWithRefBase- Returns:
- the Qualified Name of the target of the ref.
-
getRefBase
- Specified by:
getRefBasein interfaceXmlSchemaItemWithRefBase- Returns:
- the non-generic reference object.
-