public abstract class ContainerElementBase extends NestingElementBase
Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList |
m_attributeComponents
Child components defining attributes (created during validation,
contains subset of child components defining attributes).
|
private java.util.ArrayList |
m_contentComponents
Child components defining content (created during validation, contains
subset of child components defining element or character data content).
|
private IComponent |
m_idChild
Child component that contributes an ID (
null if none). |
private boolean |
m_inClassify
Flag for child classification in progress.
|
private java.lang.String |
m_label
Label for this structure definition.
|
private ObjectAttributes |
m_objectAttrs
Object attributes information for nesting.
|
private StructureAttributes |
m_structureAttrs
Structure attributes information for nesting.
|
private java.lang.String |
m_using
Label for structure to be used as definition.
|
static StringArray |
s_allowedAttributes
Enumeration of allowed attribute names
|
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
Modifier | Constructor and Description |
---|---|
protected |
ContainerElementBase(int type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkCompatibleChildren(ValidationContext vctx,
IClass type,
java.util.ArrayList children)
Check that child components are of types compatible with the container
object type.
|
protected void |
classifyComponents(ValidationContext vctx)
Classify child components as contributing attributes, content, or both.
|
java.util.ArrayList |
getAttributeComponents()
Get list of child components contributing attribute items to this
container element.
|
IClass |
getChildObjectType()
Get class passed to child components.
|
java.util.ArrayList |
getContentComponents()
Get list of child components contributing content items to this
container element.
|
IClass |
getCreateClass()
Get new instance creation class information.
|
java.lang.String |
getCreateType()
Get type to be used for creating new instance.
|
IClassItem |
getFactory()
Get factory method information.
|
java.lang.String |
getFactoryName()
Get factory method name.
|
IComponent |
getId()
Get ID property child.
|
java.lang.String |
getLabel()
Get label for this definition.
|
IClass |
getMarshaller()
Get marshaller class information.
|
java.lang.String |
getMarshallerName()
Get marshaller class name.
|
abstract IClass |
getObjectType()
Get class linked to binding element.
|
IClassItem |
getPostset()
Get post-set method information.
|
java.lang.String |
getPostsetName()
Get post-set method name.
|
IClassItem |
getPreget()
Get pre-get method information.
|
java.lang.String |
getPregetName()
Get pre-get method name.
|
IClassItem |
getPreset()
Get pre-set method information.
|
java.lang.String |
getPresetName()
Get pre-set method name.
|
IClass |
getUnmarshaller()
Get unmarshaller class information.
|
java.lang.String |
getUnmarshallerName()
Get unmarshaller class name.
|
java.lang.String |
getUsing()
Get label for definition to be used.
|
abstract boolean |
hasObject()
Check if this container defines a context object.
|
boolean |
isAllowRepeats()
Check if repeated child elements are allowed.
|
boolean |
isChoice()
Check if child components are a choice.
|
protected boolean |
isClassified()
Check for child components classified.
|
boolean |
isFlexible()
Get flexible flag.
|
boolean |
isNillable()
Check if nillable object.
|
boolean |
isOrdered()
Check if child components are ordered.
|
void |
prevalidate(ValidationContext vctx)
Prevalidate element information.
|
void |
setAllowRepeats(boolean ignore)
Set repeated child elements allowed flag.
|
void |
setChoice(boolean choice)
Set child components choice flag.
|
protected void |
setComponents(java.util.ArrayList attribs,
java.util.ArrayList contents)
Set child attribute and content components directly.
|
void |
setCreateType(java.lang.String name)
Set new instance type class name.
|
void |
setFactoryName(java.lang.String name)
Set factory method name.
|
void |
setFlexible(boolean flexible)
Set flexible flag.
|
void |
setIdChild(IComponent child,
ValidationContext vctx)
Set ID property child.
|
void |
setLabel(java.lang.String label)
Set label for this definition.
|
void |
setMarshallerName(java.lang.String name)
Set marshaller class name.
|
void |
setNillable(boolean nillable)
Set nillable flag.
|
void |
setOrdered(boolean ordered)
Set child components ordered flag.
|
void |
setPostsetName(java.lang.String name)
Set post-set method name.
|
void |
setPregetName(java.lang.String name)
Set pre-get method name.
|
void |
setPresetName(java.lang.String name)
Set pre-set method name.
|
void |
setUnmarshallerName(java.lang.String name)
Set unmarshaller class name.
|
void |
setUsing(java.lang.String label)
Set label for definition to be used.
|
void |
validate(ValidationContext vctx)
Validate element information.
|
protected void |
verifyConstruction(ValidationContext vctx,
IClass type)
Check that there's a way to construct an instance of an object class for
input bindings.
|
addChild, childIterator, children, getDefaultStyle, getDefinitions, getStyle, getStyleName, setDefinitions, setStyleName
getComment, name, setComment, toString, type, validateAttributes
public static final StringArray s_allowedAttributes
private ObjectAttributes m_objectAttrs
private StructureAttributes m_structureAttrs
private java.lang.String m_label
private java.lang.String m_using
private IComponent m_idChild
null
if none).private boolean m_inClassify
private java.util.ArrayList m_contentComponents
private java.util.ArrayList m_attributeComponents
protected ContainerElementBase(int type)
type
- element type codepublic java.lang.String getLabel()
public void setLabel(java.lang.String label)
label
- label for this definitionpublic java.lang.String getUsing()
public void setUsing(java.lang.String label)
label
- label for definition to be usedpublic java.util.ArrayList getContentComponents()
public java.util.ArrayList getAttributeComponents()
public abstract boolean hasObject()
true
if defines context object,
false
if notpublic abstract IClass getObjectType()
public IClass getChildObjectType()
public final void setIdChild(IComponent child, ValidationContext vctx)
child
- child defining the ID propertyvctx
- validation contextpublic IComponent getId()
public java.lang.String getFactoryName()
null
if none)public IClassItem getFactory()
prevalidate(ValidationContext)
.null
if none)public void setFactoryName(java.lang.String name)
name
- fully qualified class and method name for object factorypublic java.lang.String getPresetName()
null
if none)public IClassItem getPreset()
prevalidate(ValidationContext)
.null
if none)public void setPresetName(java.lang.String name)
name
- member method name to be called before unmarshallingpublic java.lang.String getPostsetName()
null
if none)public IClassItem getPostset()
prevalidate(ValidationContext)
.null
if none)public void setPostsetName(java.lang.String name)
name
- member method name to be called after unmarshallingpublic java.lang.String getPregetName()
null
if none)public IClassItem getPreget()
prevalidate(ValidationContext)
.null
if none)public void setPregetName(java.lang.String name)
name
- member method name to be called before marshallingpublic java.lang.String getMarshallerName()
null
if none)public IClass getMarshaller()
prevalidate(ValidationContext)
.null
if none)public void setMarshallerName(java.lang.String name)
name
- class name to be used for marshallingpublic java.lang.String getUnmarshallerName()
null
if none)public IClass getUnmarshaller()
prevalidate(ValidationContext)
.null
if none)public void setUnmarshallerName(java.lang.String name)
name
- class name to be used for unmarshallingpublic boolean isNillable()
public void setNillable(boolean nillable)
nillable
- flagpublic java.lang.String getCreateType()
null
if none)public IClass getCreateClass()
prevalidate(ValidationContext)
.null
if
none)public void setCreateType(java.lang.String name)
name
- class name to be used for creating new instancepublic boolean isFlexible()
public void setFlexible(boolean flexible)
flexible
- public boolean isOrdered()
true
if ordered, false
if notpublic void setOrdered(boolean ordered)
ordered
- true
if ordered, false
if notpublic boolean isChoice()
true
if choice, false
if notpublic void setChoice(boolean choice)
choice
- true
if choice, false
if notpublic boolean isAllowRepeats()
true
if repeats allowed, false
if notpublic void setAllowRepeats(boolean ignore)
ignore
- true
if repeated child elements to be allowed,
false
if notprotected void verifyConstruction(ValidationContext vctx, IClass type)
prevalidate(ValidationContext)
.vctx
- validation contexttype
- constructed object typeprotected void checkCompatibleChildren(ValidationContext vctx, IClass type, java.util.ArrayList children)
vctx
- validation contexttype
- structure object typechildren
- list of child components to be checkedprotected boolean isClassified()
true
if classified, false
if notprotected void classifyComponents(ValidationContext vctx)
vctx
- protected void setComponents(java.util.ArrayList attribs, java.util.ArrayList contents)
attribs
- contents
- public void prevalidate(ValidationContext vctx)
ElementBase
prevalidate
in class NestingElementBase
vctx
- validation contextpublic void validate(ValidationContext vctx)
ElementBase
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.validate
in class NestingElementBase
vctx
- validation context