Class NestingElementBase

java.lang.Object
org.jibx.binding.model.ElementBase
org.jibx.binding.model.NestingElementBase
Direct Known Subclasses:
BindingElement, ContainerElementBase, IncludeElement, InputElement, OutputElement, SplitElement

public abstract class NestingElementBase extends ElementBase
Model component for elements that can contain other component elements. TODO: The list of child elements here conflicts with that in BindingElement; should change the type hierarchy to better reflect usage
Author:
Dennis M. Sosnoski
  • Field Details

    • s_allowedAttributes

      public static final StringArray s_allowedAttributes
      Enumeration of allowed attribute names
    • m_nestingAttrs

      private NestingAttributes m_nestingAttrs
      Value style attribute information.
    • m_defContext

      private DefinitionContext m_defContext
      Definition context for this nesting (created by validation).
    • m_children

      private ArrayList m_children
      List of child elements.
  • Constructor Details

    • NestingElementBase

      protected NestingElementBase(int type)
      Constructor.
      Parameters:
      type - element type code
  • Method Details

    • addChild

      public final void addChild(Object child)
      Add child element. TODO: should be ElementBase argument, but JiBX doesn't allow yet
      Parameters:
      child - element to be added as child of this element
    • children

      public final ArrayList children()
      Get list of child elements.
      Returns:
      list of child elements (never null)
    • childIterator

      public final Iterator childIterator()
      Get iterator for child elements.
      Returns:
      iterator for child elements
    • getDefinitions

      public final DefinitionContext getDefinitions()
      Get definition context. This method may only be called after validation.
      Returns:
      definition context, or null if no definition context for this element
    • setDefinitions

      void setDefinitions(DefinitionContext ctx)
      Set definition context.
      Parameters:
      ctx - definition context to be set
    • getStyleName

      public String getStyleName()
      Get style name set on this nesting element.
      Returns:
      style string value (null if undefined at this level)
    • getStyle

      public int getStyle()
      Get style value set on this nesting element. This call is only meaningful after validation.
      Returns:
      style value (-1 if undefined at this level)
    • setStyleName

      public void setStyleName(String name)
      Set style name on this nesting element.
      Parameters:
      name - style name (null to undefine style at this level)
    • getDefaultStyle

      public int getDefaultStyle()
      Get default style value for child components. This call is only meaningful after validation.
      Returns:
      default style value for child components (-1 if not defined at this level)
    • prevalidate

      public void prevalidate(ValidationContext vctx)
      Description copied from class: ElementBase
      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.
      Overrides:
      prevalidate in class ElementBase
      Parameters:
      vctx - validation context
    • 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 ElementBase
      Parameters:
      vctx - validation context