Class ElementBase

  • Direct Known Subclasses:
    FormatElement, NamespaceElement, NestingElementBase, ValueElement

    public abstract class ElementBase
    extends Object
    Base class for all element structures in binding definition model. This just provides the linkages for the binding definition tree structure and related validation hooks.
    Version:
    1.0
    Author:
    Dennis M. Sosnoski
    • Constructor Detail

      • ElementBase

        protected ElementBase​(int type)
        Constructor.
        Parameters:
        type - element type code
    • Method Detail

      • type

        public final int type()
        Get element type.
        Returns:
        type code for this element
      • name

        public final String name()
        Get element name.
        Returns:
        type code for this element
      • getComment

        public final String getComment()
        Get element comment.
        Returns:
        comment for this element
      • setComment

        public final void setComment​(String text)
        Set element comment.
        Parameters:
        text - comment for this element
      • validateAttributes

        protected void validateAttributes​(org.jibx.runtime.IUnmarshallingContext ictx,
                                          StringArray attrs)
        Validate attributes of element. This is designed to be called during unmarshalling as part of the pre-set method processing when a subclass instance is being created.
        Parameters:
        ictx - unmarshalling context
        attrs - attributes array
      • prevalidate

        public void prevalidate​(ValidationContext vctx)
        Prevalidate element information. The prevalidation step is used to check isolated aspects of an element, such as the settings for enumerated values on the element and attributes. This empty base class implementation should be overridden by each subclass that requires prevalidation handling.
        Parameters:
        vctx - validation context
      • validate

        public void validate​(ValidationContext vctx)
        Validate element information. The validation step is used for checking the interactions between elements, such as name references to other elements. The 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.
        Parameters:
        vctx - validation context
      • toString

        public String toString()
        Simple text representation of binding definition element. This uses the element name, along with position information if present.
        Overrides:
        toString in class Object
        Returns:
        text representation