Package org.jibx.schema.elements
Class ElementElement
- java.lang.Object
-
- org.jibx.schema.elements.SchemaBase
-
- org.jibx.schema.elements.OpenAttrBase
-
- org.jibx.schema.elements.AnnotatedBase
-
- org.jibx.schema.elements.ElementElement
-
- All Implemented Interfaces:
IArity,IComponent,INamed,IReference
public class ElementElement extends AnnotatedBase implements IArity, INamed, IReference
<element> element definition. The same code is used for both global and local element definitions, with the differences checked during validation. TODO: implement common base class for attribute and element?- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description static intEXTENSION_BLOCKstatic intEXTENSION_FINALstatic intRESTRICTION_BLOCKstatic intRESTRICTION_FINALstatic org.jibx.util.StringArrays_allowedAttributesList of allowed attribute names.static org.jibx.runtime.EnumSets_blockValuesstatic org.jibx.runtime.EnumSets_derivationValuesstatic intSUBSTITUTION_BLOCK-
Fields inherited from class org.jibx.schema.elements.SchemaBase
ALL_TYPE, ANNOTATION_TYPE, ANY_TYPE, ANYATTRIBUTE_TYPE, APPINFO_TYPE, ATTRIBUTE_TYPE, ATTRIBUTEGROUP_TYPE, CHOICE_TYPE, COMPLEXCONTENT_TYPE, COMPLEXTYPE_TYPE, DOCUMENTATION_TYPE, ELEMENT_MASKS, ELEMENT_NAMES, ELEMENT_TYPE, ENUMERATION_TYPE, EXTENSION_TYPE, FIELD_TYPE, FRACTIONDIGITS_TYPE, GROUP_TYPE, IMPORT_TYPE, INCLUDE_TYPE, KEY_TYPE, KEYREF_TYPE, LENGTH_TYPE, LIST_TYPE, MAXEXCLUSIVE_TYPE, MAXINCLUSIVE_TYPE, MAXLENGTH_TYPE, MINEXCLUSIVE_TYPE, MININCLUSIVE_TYPE, MINLENGTH_TYPE, NOTATION_TYPE, PATTERN_TYPE, REDEFINE_TYPE, RESTRICTION_TYPE, SCHEMA_TYPE, SELECTOR_TYPE, SEQUENCE_TYPE, SIMPLECONTENT_TYPE, SIMPLETYPE_TYPE, TOTALDIGITS_TYPE, UNION_TYPE, UNIQUE_TYPE, WHITESPACE_TYPE
-
Fields inherited from interface org.jibx.schema.IComponent
SCHEMA_NAMESPACE
-
-
Constructor Summary
Constructors Constructor Description ElementElement()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AllEnumSetgetBlock()Get 'block' attribute.StringgetDefault()Get 'default' attribute value.org.jibx.runtime.QNamegetEffectiveQName()Get effective qualified name for element (whether defined directly, or by reference).AllEnumSetgetFinal()Get 'final' attribute.StringgetFixed()Get 'fixed' attribute value.intgetForm()Get 'form' attribute type code.StringgetFormText()Get 'form' attribute name value.FilteredSegmentListgetIdentityConstraintList()Get list of identity constraint child elements.CountgetMaxOccurs()Get 'maxOccurs' attribute value.CountgetMinOccurs()Get 'minOccurs' attribute value.StringgetName()Get 'name' attribute value.org.jibx.runtime.QNamegetQName()Get qualified name set directly on element.org.jibx.runtime.QNamegetRef()Get 'ref' attribute value.ElementElementgetReference()Get the referenced element declaration.org.jibx.runtime.QNamegetSubstitutionGroup()Get 'substitutionGroup' attribute value.org.jibx.runtime.QNamegetType()Get 'type' attribute value.CommonTypeDefinitiongetTypeDefinition()Get type definition.booleanisAbstract()Check 'abstract' attribute value.booleanisInlineType()Check if the element uses an inline type definition.booleanisNillable()Check 'nillable' attribute value.protected voidpreset(org.jibx.runtime.IUnmarshallingContext ictx)Pre-set method to be called by data binding while parsing element start tag.voidprevalidate(ValidationContext vctx)Prevalidate component information.voidsetAbstract(boolean abs)Set 'abstract' attribute value.voidsetDefault(String dflt)Set the 'default' attribute value.voidsetFixed(String fixed)Set 'fixed' attribute value.voidsetForm(int type)Set 'form' attribute type code.voidsetMaxOccurs(Count count)Set 'maxOccurs' attribute value.voidsetMinOccurs(Count count)Get 'maxOccurs' attribute value.voidsetName(String name)Set 'name' attribute value.voidsetNillable(boolean nil)Set 'nillable' attribute value.voidsetRef(org.jibx.runtime.QName ref)Set 'ref' attribute value.voidsetSubstitutionGroup(org.jibx.runtime.QName qname)Set 'substitutionGroup' attribute value.voidsetType(org.jibx.runtime.QName type)Set 'type' attribute value.voidsetTypeDefinition(CommonTypeDefinition def)Set type definition (either inline, or as reference).voidvalidate(ValidationContext vctx)Validate component information.-
Methods inherited from class org.jibx.schema.elements.AnnotatedBase
getAnnotation, getId, setAnnotation, setId
-
Methods inherited from class org.jibx.schema.elements.OpenAttrBase
addExtraAttribute, clearExtraAttributes, compactChildren, detachChild, getChild, getChildCount, getChildIterator, getChildrenWritable, getExtraAttributes, preget, replaceChild, validateAttributes
-
Methods inherited from class org.jibx.schema.elements.SchemaBase
addNamespaceDeclaration, bit, clearNamespaceDeclarations, getExtension, getNamespaceDeclarations, getParent, getSchema, isGlobal, name, readNamespaces, setExtension, setParent, type, validateAttributes, writeNamespaces
-
-
-
-
Field Detail
-
s_allowedAttributes
public static final org.jibx.util.StringArray s_allowedAttributes
List of allowed attribute names.
-
EXTENSION_BLOCK
public static final int EXTENSION_BLOCK
- See Also:
- Constant Field Values
-
RESTRICTION_BLOCK
public static final int RESTRICTION_BLOCK
- See Also:
- Constant Field Values
-
SUBSTITUTION_BLOCK
public static final int SUBSTITUTION_BLOCK
- See Also:
- Constant Field Values
-
s_blockValues
public static final org.jibx.runtime.EnumSet s_blockValues
-
EXTENSION_FINAL
public static final int EXTENSION_FINAL
- See Also:
- Constant Field Values
-
RESTRICTION_FINAL
public static final int RESTRICTION_FINAL
- See Also:
- Constant Field Values
-
s_derivationValues
public static final org.jibx.runtime.EnumSet s_derivationValues
-
-
Method Detail
-
preset
protected void preset(org.jibx.runtime.IUnmarshallingContext ictx) throws org.jibx.runtime.JiBXExceptionDescription copied from class:SchemaBasePre-set method to be called by data binding while parsing element start tag. The base class implementation just sets the parent element link and reads in any extra namespaces defined on the element. Subclasses which override this implementation must call the base implementation during their processing.- Overrides:
presetin classSchemaBase- Parameters:
ictx- unmarshalling context- Throws:
org.jibx.runtime.JiBXException- on error
-
getType
public org.jibx.runtime.QName getType()
Get 'type' attribute value.- Returns:
- type (
nullif not set)
-
setType
public void setType(org.jibx.runtime.QName type)
Set 'type' attribute value. Note that this method should only be used prior to validation, since it will only set the type name and not link the actual type information.- Parameters:
type- (nullif not set)
-
getDefault
public String getDefault()
Get 'default' attribute value.- Returns:
- default (
nullif not set)
-
setDefault
public void setDefault(String dflt)
Set the 'default' attribute value.- Parameters:
dflt- (nullif not set)
-
getFixed
public String getFixed()
Get 'fixed' attribute value.- Returns:
- fixed (
nullif not set)
-
setFixed
public void setFixed(String fixed)
Set 'fixed' attribute value.- Parameters:
fixed- (nullif not set)
-
isAbstract
public boolean isAbstract()
Check 'abstract' attribute value.- Returns:
- abstract attribute value
-
setAbstract
public void setAbstract(boolean abs)
Set 'abstract' attribute value.- Parameters:
abs- abstract attribute value
-
isNillable
public boolean isNillable()
Check 'nillable' attribute value.- Returns:
- nillable attribute value (
nullif not set)
-
setNillable
public void setNillable(boolean nil)
Set 'nillable' attribute value.- Parameters:
nil- nillable attribute value (nullif not set)
-
getFinal
public AllEnumSet getFinal()
Get 'final' attribute.- Returns:
- final
-
getBlock
public AllEnumSet getBlock()
Get 'block' attribute.- Returns:
- block
-
getSubstitutionGroup
public org.jibx.runtime.QName getSubstitutionGroup()
Get 'substitutionGroup' attribute value.- Returns:
- substitutionGroup (
nullif not set)
-
setSubstitutionGroup
public void setSubstitutionGroup(org.jibx.runtime.QName qname)
Set 'substitutionGroup' attribute value.- Parameters:
qname- (nullif not set)
-
getReference
public ElementElement getReference()
Get the referenced element declaration. This method is only usable after validation.- Returns:
- referenced element definition, or
nullif not a reference
-
getQName
public org.jibx.runtime.QName getQName()
Get qualified name set directly on element. This method is only usable after prevalidation.
-
getEffectiveQName
public org.jibx.runtime.QName getEffectiveQName()
Get effective qualified name for element (whether defined directly, or by reference). This method is only usable after prevalidation.- Returns:
- qname
-
isInlineType
public boolean isInlineType()
Check if the element uses an inline type definition.- Returns:
trueif inline,falseif not
-
getTypeDefinition
public CommonTypeDefinition getTypeDefinition()
Get type definition. This returns the actual type definition for the element, irrespective of whether the element uses an element reference, a type reference, or an inline type definition. It is only usable after validation.- Returns:
- type definition (
nullif empty type definition)
-
setTypeDefinition
public void setTypeDefinition(CommonTypeDefinition def)
Set type definition (either inline, or as reference).- Parameters:
def- inline type definition
-
getIdentityConstraintList
public FilteredSegmentList getIdentityConstraintList()
Get list of identity constraint child elements.- Returns:
- list
-
getName
public String getName()
Get 'name' attribute value.- Specified by:
getNamein interfaceINamed- Returns:
- name
- See Also:
DefRefAttributeGroup.getName()
-
getRef
public org.jibx.runtime.QName getRef()
Get 'ref' attribute value.- Specified by:
getRefin interfaceIReference- Returns:
- ref
- See Also:
DefRefAttributeGroup.getRef()
-
setName
public void setName(String name)
Set 'name' attribute value.- Parameters:
name- attribute value- See Also:
DefRefAttributeGroup.setName(java.lang.String)
-
setRef
public void setRef(org.jibx.runtime.QName ref)
Set 'ref' attribute value.- Parameters:
ref- attribute value- See Also:
DefRefAttributeGroup.setRef(org.jibx.runtime.QName)
-
getForm
public int getForm()
Get 'form' attribute type code.- Returns:
- form attribute type code
- See Also:
FormChoiceAttribute.getForm()
-
getFormText
public String getFormText()
Get 'form' attribute name value.- Returns:
- form attribute name value
- See Also:
FormChoiceAttribute.getFormText()
-
setForm
public void setForm(int type)
Set 'form' attribute type code.- Parameters:
type- code- See Also:
FormChoiceAttribute.setForm(int)
-
getMaxOccurs
public Count getMaxOccurs()
Get 'maxOccurs' attribute value.- Specified by:
getMaxOccursin interfaceIArity- Returns:
- count
- See Also:
OccursAttributeGroup.getMaxOccurs()
-
getMinOccurs
public Count getMinOccurs()
Get 'minOccurs' attribute value.- Specified by:
getMinOccursin interfaceIArity- Returns:
- count
- See Also:
OccursAttributeGroup.getMinOccurs()
-
setMaxOccurs
public void setMaxOccurs(Count count)
Set 'maxOccurs' attribute value.- Specified by:
setMaxOccursin interfaceIArity- Parameters:
count- attribute value- See Also:
OccursAttributeGroup.setMaxOccurs(org.jibx.schema.types.Count)
-
setMinOccurs
public void setMinOccurs(Count count)
Get 'maxOccurs' attribute value.- Specified by:
setMinOccursin interfaceIArity- Parameters:
count- Count- See Also:
OccursAttributeGroup.setMinOccurs(org.jibx.schema.types.Count)
-
prevalidate
public void prevalidate(ValidationContext vctx)
Description copied from class:SchemaBasePrevalidate component information. The prevalidation step is used to check isolated aspects of a component, such as the settings for enumerated values. This empty base class implementation should be overridden by each subclass that requires prevalidation handling.- Specified by:
prevalidatein interfaceIComponent- Overrides:
prevalidatein classAnnotatedBase- Parameters:
vctx- validation context
-
validate
public void validate(ValidationContext vctx)
Description copied from class:SchemaBaseValidate component information. The validation step is used for checking the interactions between components, such as name references to other components. TheSchemaBase.prevalidate(org.jibx.schema.validation.ValidationContext)method will always be called for every component in the schema definition before this method is called for any component. This empty base class implementation should be overridden by each subclass that requires validation handling.- Specified by:
validatein interfaceIComponent- Overrides:
validatein classSchemaBase- Parameters:
vctx- validation context
-
-