Class 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 Detail

      • s_allowedAttributes

        public static final org.jibx.util.StringArray s_allowedAttributes
        List of allowed attribute names.
      • s_blockValues

        public static final org.jibx.runtime.EnumSet s_blockValues
      • s_derivationValues

        public static final org.jibx.runtime.EnumSet s_derivationValues
    • Constructor Detail

      • ElementElement

        public ElementElement()
        Constructor.
    • Method Detail

      • preset

        protected void preset​(org.jibx.runtime.IUnmarshallingContext ictx)
                       throws org.jibx.runtime.JiBXException
        Description copied from class: SchemaBase
        Pre-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:
        preset in class SchemaBase
        Parameters:
        ictx - unmarshalling context
        Throws:
        org.jibx.runtime.JiBXException - on error
      • getType

        public org.jibx.runtime.QName getType()
        Get 'type' attribute value.
        Returns:
        type (null if 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 - (null if not set)
      • getDefault

        public String getDefault()
        Get 'default' attribute value.
        Returns:
        default (null if not set)
      • setDefault

        public void setDefault​(String dflt)
        Set the 'default' attribute value.
        Parameters:
        dflt - (null if not set)
      • getFixed

        public String getFixed()
        Get 'fixed' attribute value.
        Returns:
        fixed (null if not set)
      • setFixed

        public void setFixed​(String fixed)
        Set 'fixed' attribute value.
        Parameters:
        fixed - (null if 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 (null if not set)
      • setNillable

        public void setNillable​(boolean nil)
        Set 'nillable' attribute value.
        Parameters:
        nil - nillable attribute value (null if 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 (null if not set)
      • setSubstitutionGroup

        public void setSubstitutionGroup​(org.jibx.runtime.QName qname)
        Set 'substitutionGroup' attribute value.
        Parameters:
        qname - (null if not set)
      • getReference

        public ElementElement getReference()
        Get the referenced element declaration. This method is only usable after validation.
        Returns:
        referenced element definition, or null if not a reference
      • getQName

        public org.jibx.runtime.QName getQName()
        Get qualified name set directly on element. This method is only usable after prevalidation.
        Specified by:
        getQName in interface INamed
        Returns:
        qname (null if a reference)
      • 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:
        true if inline, false if 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 (null if 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
      • prevalidate

        public void prevalidate​(ValidationContext vctx)
        Description copied from class: SchemaBase
        Prevalidate 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:
        prevalidate in interface IComponent
        Overrides:
        prevalidate in class AnnotatedBase
        Parameters:
        vctx - validation context
      • validate

        public void validate​(ValidationContext vctx)
        Description copied from class: SchemaBase
        Validate component information. The validation step is used for checking the interactions between components, such as name references to other components. The SchemaBase.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:
        validate in interface IComponent
        Overrides:
        validate in class SchemaBase
        Parameters:
        vctx - validation context