Package org.jibx.binding.model
Class NestingElementBase
java.lang.Object
org.jibx.binding.model.ElementBase
org.jibx.binding.model.NestingElementBase
- Direct Known Subclasses:
BindingElement,ContainerElementBase,IncludeElement,InputElement,OutputElement,SplitElement
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 Summary
FieldsModifier and TypeFieldDescriptionprivate ArrayListList of child elements.private DefinitionContextDefinition context for this nesting (created by validation).private NestingAttributesValue style attribute information.static final StringArrayEnumeration of allowed attribute namesFields inherited from class org.jibx.binding.model.ElementBase
BINDING_ELEMENT, COLLECTION_ELEMENT, ELEMENT_NAMES, FORMAT_ELEMENT, INCLUDE_ELEMENT, INPUT_ELEMENT, MAPPING_ELEMENT, NAMESPACE_ELEMENT, OUTPUT_ELEMENT, SPLIT_ELEMENT, STRUCTURE_ELEMENT, TEMPLATE_ELEMENT, VALUE_ELEMENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdd child element.final IteratorGet iterator for child elements.final ArrayListchildren()Get list of child elements.intGet default style value for child components.final DefinitionContextGet definition context.intgetStyle()Get style value set on this nesting element.Get style name set on this nesting element.voidprevalidate(ValidationContext vctx) Prevalidate element information.(package private) voidSet definition context.voidsetStyleName(String name) Set style name on this nesting element.voidvalidate(ValidationContext vctx) Validate element information.Methods inherited from class org.jibx.binding.model.ElementBase
getComment, name, setComment, toString, type, validateAttributes
-
Field Details
-
s_allowedAttributes
Enumeration of allowed attribute names -
m_nestingAttrs
Value style attribute information. -
m_defContext
Definition context for this nesting (created by validation). -
m_children
List of child elements.
-
-
Constructor Details
-
NestingElementBase
protected NestingElementBase(int type) Constructor.- Parameters:
type- element type code
-
-
Method Details
-
addChild
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
Get list of child elements.- Returns:
- list of child elements (never
null)
-
childIterator
Get iterator for child elements.- Returns:
- iterator for child elements
-
getDefinitions
Get definition context. This method may only be called after validation.- Returns:
- definition context, or
nullif no definition context for this element
-
setDefinitions
Set definition context.- Parameters:
ctx- definition context to be set
-
getStyleName
Get style name set on this nesting element.- Returns:
- style string value (
nullif 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 (
-1if undefined at this level)
-
setStyleName
Set style name on this nesting element.- Parameters:
name- style name (nullto 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 (
-1if not defined at this level)
-
prevalidate
Description copied from class:ElementBasePrevalidate 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:
prevalidatein classElementBase- Parameters:
vctx- validation context
-
validate
Description copied from class:ElementBaseValidate element information. The validation step is used for checking the interactions between elements, such as name references to other elements. TheElementBase.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:
validatein classElementBase- Parameters:
vctx- validation context
-