public class CollectionElement extends StructureElementBase
hasProperty
Modifier and Type | Field and Description |
---|---|
private IClassItem |
m_addMethodItem
Add method information.
|
private java.lang.String |
m_addMethodName
Add method name.
|
private IClass |
m_itemTypeClass
Item type information.
|
private java.lang.String |
m_itemTypeName
Item type name.
|
private IClassItem |
m_iterMethodItem
Iterator method information.
|
private java.lang.String |
m_iterMethodName
Iterator method name.
|
private IClassItem |
m_loadMethodItem
Load method information.
|
private java.lang.String |
m_loadMethodName
Load method name.
|
private IClassItem |
m_sizeMethodItem
Size method information.
|
private java.lang.String |
m_sizeMethodName
Size method name.
|
private IClassItem |
m_storeMethodItem
Store method information.
|
private java.lang.String |
m_storeMethodName
Store method name.
|
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
Constructor and Description |
---|
CollectionElement()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
checkCollectionChildren(ValidationContext vctx,
IClass type,
java.util.ArrayList children)
Check that child components are of types compatible with the collection
item-type.
|
private void |
checkOrderedChildren(ValidationContext vctx,
java.util.ArrayList children)
Check children of ordered collection for consistency.
|
private void |
checkUnorderedChildren(ValidationContext vctx,
java.util.ArrayList children)
Check children of unordered collection for consistency.
|
IClassItem |
getAddMethodItem()
Get add method information.
|
java.lang.String |
getAddMethodName()
Get add method name.
|
IClass |
getChildObjectType()
Get class passed to child components.
|
IClass |
getItemTypeClass()
Get item type information.
|
java.lang.String |
getItemTypeName()
Get item type name.
|
IClassItem |
getIterMethodItem()
Get iterator method information.
|
java.lang.String |
getIterMethodName()
Get iterator method name.
|
IClassItem |
getLoadMethodItem()
Get load method information.
|
java.lang.String |
getLoadMethodName()
Get load method name.
|
IClassItem |
getSizeMethodItem()
Get size method information.
|
java.lang.String |
getSizeMethodName()
Get size method name.
|
IClassItem |
getStoreMethodItem()
Get store method information.
|
java.lang.String |
getStoreMethodName()
Get store method name.
|
boolean |
hasAttribute()
Check for attribute definition.
|
boolean |
hasContent()
Check for content definition.
|
boolean |
hasObject()
Check for object present.
|
private void |
preSet(IUnmarshallingContext uctx)
Make sure all attributes are defined.
|
void |
prevalidate(ValidationContext vctx)
Prevalidate element information.
|
void |
setAddMethodName(java.lang.String name)
Set add method name.
|
boolean |
setIdChild(IComponent child)
Set ID property.
|
void |
setItemTypeName(java.lang.String type)
Set item type name.
|
void |
setIterMethodName(java.lang.String name)
Set iterator method name.
|
void |
setLoadMethodName(java.lang.String name)
Set load method name.
|
void |
setSizeMethodName(java.lang.String name)
Set size method name.
|
void |
setStoreMethodName(java.lang.String name)
Set store method name.
|
void |
validate(ValidationContext vctx)
Validate element information.
|
getDeclaredType, getField, getFieldName, getFlag, getGet, getGetName, getGetType, getName, getNamespace, getObjectType, getPrefix, getSet, getSetName, getSetType, getTest, getTestName, getType, getUri, getUsage, getUsageName, hasName, hasProperty, isFlagOnly, isImplicit, isOptional, setDeclaredType, setFieldName, setFlagName, setGetName, setName, setPrefix, setSetName, setTestName, setUri, setUsage, setUsageName
checkCompatibleChildren, classifyComponents, getAttributeComponents, getContentComponents, getCreateClass, getCreateType, getFactory, getFactoryName, getId, getLabel, getMarshaller, getMarshallerName, getPostset, getPostsetName, getPreget, getPregetName, getPreset, getPresetName, getUnmarshaller, getUnmarshallerName, getUsing, isAllowRepeats, isChoice, isClassified, isFlexible, isNillable, isOrdered, setAllowRepeats, setChoice, setComponents, setCreateType, setFactoryName, setFlexible, setIdChild, setLabel, setMarshallerName, setNillable, setOrdered, setPostsetName, setPregetName, setPresetName, setUnmarshallerName, setUsing, verifyConstruction
addChild, childIterator, children, getDefaultStyle, getDefinitions, getStyle, getStyleName, setDefinitions, setStyleName
getComment, name, setComment, toString, type, validateAttributes
public static final StringArray s_allowedAttributes
private java.lang.String m_loadMethodName
private java.lang.String m_sizeMethodName
private java.lang.String m_storeMethodName
private java.lang.String m_addMethodName
private java.lang.String m_iterMethodName
private java.lang.String m_itemTypeName
private IClassItem m_loadMethodItem
private IClassItem m_sizeMethodItem
private IClassItem m_storeMethodItem
private IClassItem m_addMethodItem
private IClassItem m_iterMethodItem
private IClass m_itemTypeClass
public java.lang.String getItemTypeName()
null
if none)public void setItemTypeName(java.lang.String type)
type
- item type name (or null
if none)public IClass getItemTypeClass()
public java.lang.String getAddMethodName()
null
if none)public void setAddMethodName(java.lang.String name)
name
- add method name (or null
if none)public IClassItem getAddMethodItem()
null
if none)public java.lang.String getIterMethodName()
null
if none)public void setIterMethodName(java.lang.String name)
name
- iterator method name (or null
if none)public IClassItem getIterMethodItem()
null
if none)public java.lang.String getLoadMethodName()
null
if none)public void setLoadMethodName(java.lang.String name)
name
- load method name (or null
if none)public IClassItem getLoadMethodItem()
null
if none)public java.lang.String getSizeMethodName()
null
if none)public void setSizeMethodName(java.lang.String name)
name
- size method name (or null
if none)public IClassItem getSizeMethodItem()
null
if none)public java.lang.String getStoreMethodName()
null
if none)public void setStoreMethodName(java.lang.String name)
name
- store method name (or null
if none)public IClassItem getStoreMethodItem()
null
if none)public boolean setIdChild(IComponent child)
child
- child defining the ID propertytrue
if successful, false
if ID
already definedpublic boolean hasObject()
true
for collection.hasObject
in class StructureElementBase
true
public boolean hasAttribute()
false
for collection.hasAttribute
in interface IComponent
hasAttribute
in class StructureElementBase
false
public boolean hasContent()
true
for collection.hasContent
in interface IComponent
hasContent
in class StructureElementBase
true
public IClass getChildObjectType()
ContainerElementBase
getChildObjectType
in class ContainerElementBase
private void preSet(IUnmarshallingContext uctx) throws JiBXException
uctx
- unmarshalling contextJiBXException
- on unmarshalling errorpublic void prevalidate(ValidationContext vctx)
ElementBase
prevalidate
in class StructureElementBase
vctx
- validation contextprivate boolean checkCollectionChildren(ValidationContext vctx, IClass type, java.util.ArrayList children)
vctx
- validation contexttype
- collection item typechildren
- list of child components to be checkedtrue
if only child is a <value> element with
type, false
if notprivate void checkUnorderedChildren(ValidationContext vctx, java.util.ArrayList children)
vctx
- validation contextchildren
- list of child componentsprivate void checkOrderedChildren(ValidationContext vctx, java.util.ArrayList children)
vctx
- validation contextchildren
- list of child componentspublic 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 StructureElementBase
vctx
- validation context