Class AttributeElement

    • Field Detail

      • s_allowedAttributes

        public static final StringArray s_allowedAttributes
        List of allowed attribute names.
      • s_useValues

        public static final EnumSet s_useValues
      • m_inlineTypeList

        private final FilteredSegmentList m_inlineTypeList
        Filtered list of inline type definition elements (zero or one only).
      • m_type

        private QName m_type
        'type' attribute value.
      • m_useType

        private int m_useType
        'use' attribute value type code.
      • m_default

        private java.lang.String m_default
        'default' attribute value.
      • m_fixed

        private java.lang.String m_fixed
        'fixed' attribute value.
      • m_refElement

        private AttributeElement m_refElement
        Attribute definition (from 'ref' attribute - null if none).
      • m_typeDefinition

        private CommonTypeDefinition m_typeDefinition
        Simple type definition (from 'type' attribute, or inline definition - null if none).
      • m_qname

        private QName m_qname
        Qualified name.
    • Constructor Detail

      • AttributeElement

        public AttributeElement()
        Constructor.
    • Method Detail

      • clearType

        private void clearType()
        Clear any type information. This method is only visible for internal use, to be called in the process of setting new type information.
      • preset

        protected void preset​(IUnmarshallingContext ictx)
                       throws 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:
        JiBXException - on error
      • getType

        public QName getType()
        Get 'type' attribute value.
        Returns:
        type (null if not set)
      • setType

        public void setType​(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 java.lang.String getDefault()
        Get 'default' attribute value.
        Returns:
        default (null if not set)
      • setDefault

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

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

        public void setFixed​(java.lang.String fixed)
        Set 'fixed' attribute value.
        Parameters:
        fixed - (null if not set)
      • getUse

        public int getUse()
        Get 'use' attribute type code.
        Returns:
        type code applied to this attribute
      • setUse

        public void setUse​(int code)
        Set 'use' attribute type code.
        Parameters:
        code - (-1 to unset)
      • getUseText

        public java.lang.String getUseText()
        Get 'use' attribute text.
        Returns:
        text (null if not set)
      • setUseText

        private void setUseText​(java.lang.String text,
                                IUnmarshallingContext ictx)
        Set 'use' attribute text. This method is provided only for use when unmarshalling.
        Parameters:
        text -
        ictx -
      • getQName

        public QName getQName()
        Get qualified name set directly on attribute. This method is only usable after prevalidation.
        Specified by:
        getQName in interface INamed
        Returns:
        qname (null if a reference)
      • getEffectiveQName

        public QName getEffectiveQName()
        Get effective qualified name for attribute (whether defined directly, or by reference). This method is only usable after prevalidation.
        Returns:
        qname
      • getReference

        public AttributeElement getReference()
        Get the referenced attribute declaration. This method is only usable after validation.
        Returns:
        referenced attribute declaration, or null if not a reference
      • isInlineType

        public boolean isInlineType()
        Check if the attribute 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 attribute, irrespective of whether the attribute uses an attribute reference, a type reference, or an inline type definition. It is only usable after validation.
        Returns:
        type definition
      • setTypeDefinition

        public void setTypeDefinition​(CommonTypeDefinition def)
        Set type definition. If the supplied type definition is a global type it is used by reference; if a local type it is used inline.
        Parameters:
        def - type definition
      • 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