Class StructureElement

  • All Implemented Interfaces:
    IComponent

    public class StructureElement
    extends StructureElementBase
    Model component for structure element of binding definition.
    Author:
    Dennis M. Sosnoski
    • Field Detail

      • s_allowedAttributes

        public static final StringArray s_allowedAttributes
        Enumeration of allowed attribute names
    • Constructor Detail

      • StructureElement

        public StructureElement()
        Default constructor.
    • Method Detail

      • getMapAsName

        public String getMapAsName()
        Get name of mapping type.
        Returns:
        mapping type name (or null if none)
      • setMapAsName

        public void setMapAsName​(String name)
        Set name of mapping type. This method changes the qualified name to match the mapping type.
        Parameters:
        name - mapping type name (or null if none)
      • getMapAsQName

        public org.jibx.runtime.QName getMapAsQName()
        Get qualified name of mapping type.
        Returns:
        mapping qualified type name (or null if none)
      • setMapAsQName

        public void setMapAsQName​(org.jibx.runtime.QName name)
        Set qualified name of mapping type. This method changes the mapping name to match the qualified name.
        Parameters:
        name - mapping qualified type name (or null if none)
      • getEffectiveMapping

        public TemplateElementBase getEffectiveMapping()
        Get actual type mapping. This call is only meaningful after validation.
        Returns:
        actual type mapping (or null if none)
      • hasDirectName

        public boolean hasDirectName()
        Check if this structure defines a name directly.
        Returns:
        true if name defined, false if not
      • hasAttribute

        public boolean hasAttribute()
        Description copied from interface: IComponent
        Check if component defines one or more attribute values of the containing element. This method is only valid after validation.
        Specified by:
        hasAttribute in interface IComponent
        Overrides:
        hasAttribute in class StructureElementBase
        Returns:
        true if one or more attribute values defined for containing element, false if not
      • hasContent

        public boolean hasContent()
        Description copied from interface: IComponent
        Check if component defines one or more elements or text values as children of the containing element. This method is only valid after validation.
        Specified by:
        hasContent in interface IComponent
        Overrides:
        hasContent in class StructureElementBase
        Returns:
        true if one or more content values defined for containing element, false if not
      • classifyComponents

        protected void classifyComponents​(ValidationContext vctx)
        Classify child components as contributing attributes, content, or both. This method is needed to handle on-demand classification during validation. When a child component is another instance of this class, the method calls itself on the child component prior to checking the child component's contribution.
        Overrides:
        classifyComponents in class ContainerElementBase
        Parameters:
        vctx -
      • validate

        public void validate​(ValidationContext vctx)
        Description copied from class: ElementBase
        Validate element information. The validation step is used for checking the interactions between elements, such as name references to other elements. The ElementBase.prevalidate(org.jibx.binding.model.ValidationContext) method will always be called for every element in the binding definition before this method is called for any element. This empty base class implementation should be overridden by each subclass that requires validation handling.
        Overrides:
        validate in class StructureElementBase
        Parameters:
        vctx - validation context