Package org.jibx.binding.model
Class CollectionElement
- java.lang.Object
-
- org.jibx.binding.model.ElementBase
-
- org.jibx.binding.model.NestingElementBase
-
- org.jibx.binding.model.ContainerElementBase
-
- org.jibx.binding.model.StructureElementBase
-
- org.jibx.binding.model.CollectionElement
-
- All Implemented Interfaces:
IComponent
public class CollectionElement extends StructureElementBase
Model component for collection element of binding definition.- Version:
- 1.0
- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description static StringArrays_allowedAttributesEnumeration of allowed attribute names-
Fields 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 Constructor Description CollectionElement()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IClassItemgetAddMethodItem()Get add method information.StringgetAddMethodName()Get add method name.IClassgetChildObjectType()Get class passed to child components.IClassgetItemTypeClass()Get item type information.StringgetItemTypeName()Get item type name.IClassItemgetIterMethodItem()Get iterator method information.StringgetIterMethodName()Get iterator method name.IClassItemgetLoadMethodItem()Get load method information.StringgetLoadMethodName()Get load method name.IClassItemgetSizeMethodItem()Get size method information.StringgetSizeMethodName()Get size method name.IClassItemgetStoreMethodItem()Get store method information.StringgetStoreMethodName()Get store method name.booleanhasAttribute()Check for attribute definition.booleanhasContent()Check for content definition.booleanhasObject()Check for object present.voidprevalidate(ValidationContext vctx)Prevalidate element information.voidsetAddMethodName(String name)Set add method name.booleansetIdChild(IComponent child)Set ID property.voidsetItemTypeName(String type)Set item type name.voidsetIterMethodName(String name)Set iterator method name.voidsetLoadMethodName(String name)Set load method name.voidsetSizeMethodName(String name)Set size method name.voidsetStoreMethodName(String name)Set store method name.voidvalidate(ValidationContext vctx)Validate element information.-
Methods inherited from class org.jibx.binding.model.StructureElementBase
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
-
Methods inherited from class org.jibx.binding.model.ContainerElementBase
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
-
Methods inherited from class org.jibx.binding.model.NestingElementBase
addChild, childIterator, children, getDefaultStyle, getDefinitions, getStyle, getStyleName, setStyleName
-
Methods inherited from class org.jibx.binding.model.ElementBase
getComment, name, setComment, toString, type, validateAttributes
-
-
-
-
Field Detail
-
s_allowedAttributes
public static final StringArray s_allowedAttributes
Enumeration of allowed attribute names
-
-
Method Detail
-
getItemTypeName
public String getItemTypeName()
Get item type name.- Returns:
- item type name (or
nullif none)
-
setItemTypeName
public void setItemTypeName(String type)
Set item type name.- Parameters:
type- item type name (ornullif none)
-
getItemTypeClass
public IClass getItemTypeClass()
Get item type information. This call is only meaningful after validation.- Returns:
- item type information
-
getAddMethodName
public String getAddMethodName()
Get add method name.- Returns:
- add method name (or
nullif none)
-
setAddMethodName
public void setAddMethodName(String name)
Set add method name.- Parameters:
name- add method name (ornullif none)
-
getAddMethodItem
public IClassItem getAddMethodItem()
Get add method information. This call is only meaningful after validation.- Returns:
- add method information (or
nullif none)
-
getIterMethodName
public String getIterMethodName()
Get iterator method name.- Returns:
- iterator method name (or
nullif none)
-
setIterMethodName
public void setIterMethodName(String name)
Set iterator method name.- Parameters:
name- iterator method name (ornullif none)
-
getIterMethodItem
public IClassItem getIterMethodItem()
Get iterator method information. This call is only meaningful after validation.- Returns:
- iterator method information (or
nullif none)
-
getLoadMethodName
public String getLoadMethodName()
Get load method name.- Returns:
- load method name (or
nullif none)
-
setLoadMethodName
public void setLoadMethodName(String name)
Set load method name.- Parameters:
name- load method name (ornullif none)
-
getLoadMethodItem
public IClassItem getLoadMethodItem()
Get load method information. This call is only meaningful after validation.- Returns:
- load method information (or
nullif none)
-
getSizeMethodName
public String getSizeMethodName()
Get size method name.- Returns:
- size method name (or
nullif none)
-
setSizeMethodName
public void setSizeMethodName(String name)
Set size method name.- Parameters:
name- size method name (ornullif none)
-
getSizeMethodItem
public IClassItem getSizeMethodItem()
Get size method information. This call is only meaningful after validation.- Returns:
- size method information (or
nullif none)
-
getStoreMethodName
public String getStoreMethodName()
Get store method name.- Returns:
- store method name (or
nullif none)
-
setStoreMethodName
public void setStoreMethodName(String name)
Set store method name.- Parameters:
name- store method name (ornullif none)
-
getStoreMethodItem
public IClassItem getStoreMethodItem()
Get store method information. This call is only meaningful after validation.- Returns:
- store method information (or
nullif none)
-
setIdChild
public boolean setIdChild(IComponent child)
Set ID property. This is never supported for an object coming from a collection.- Parameters:
child- child defining the ID property- Returns:
trueif successful,falseif ID already defined
-
hasObject
public boolean hasObject()
Check for object present. Alwaystruefor collection.- Overrides:
hasObjectin classStructureElementBase- Returns:
true
-
hasAttribute
public boolean hasAttribute()
Check for attribute definition. Alwaysfalsefor collection.- Specified by:
hasAttributein interfaceIComponent- Overrides:
hasAttributein classStructureElementBase- Returns:
false
-
hasContent
public boolean hasContent()
Check for content definition. Alwaystruefor collection.- Specified by:
hasContentin interfaceIComponent- Overrides:
hasContentin classStructureElementBase- Returns:
true
-
getChildObjectType
public IClass getChildObjectType()
Description copied from class:ContainerElementBaseGet class passed to child components. This call is only meaningful after validation.- Overrides:
getChildObjectTypein classContainerElementBase- Returns:
- information for class linked by binding
-
prevalidate
public void prevalidate(ValidationContext vctx)
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 classStructureElementBase- Parameters:
vctx- validation context
-
validate
public void validate(ValidationContext vctx)
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 classStructureElementBase- Parameters:
vctx- validation context
-
-