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 ArrayList
List of child elements.private DefinitionContext
Definition context for this nesting (created by validation).private NestingAttributes
Value style attribute information.static final StringArray
Enumeration 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 void
Add child element.final Iterator
Get iterator for child elements.final ArrayList
children()
Get list of child elements.int
Get default style value for child components.final DefinitionContext
Get definition context.int
getStyle()
Get style value set on this nesting element.Get style name set on this nesting element.void
prevalidate
(ValidationContext vctx) Prevalidate element information.(package private) void
Set definition context.void
setStyleName
(String name) Set style name on this nesting element.void
validate
(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
null
if 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 (
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
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
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 classElementBase
- Parameters:
vctx
- validation context
-
validate
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. 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:
validate
in classElementBase
- Parameters:
vctx
- validation context
-