Package org.jibx.binding.model
Class StructureElementBase
- java.lang.Object
-
- org.jibx.binding.model.ElementBase
-
- org.jibx.binding.model.NestingElementBase
-
- org.jibx.binding.model.ContainerElementBase
-
- org.jibx.binding.model.StructureElementBase
-
- All Implemented Interfaces:
IComponent
- Direct Known Subclasses:
CollectionElement,StructureElement
public abstract class StructureElementBase extends ContainerElementBase implements IComponent
Model component for elements that define the binding structure for an object property. This is the base class for structure and collection elements.- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description private booleanm_collectionItemFlag for child of collection element (only meaningful after prevalidation).private NameAttributesm_nameAttrsName attributes information for nesting.private PropertyAttributesm_propertyAttrsProperty attributes information for nesting.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 Modifier Constructor Description protectedStructureElementBase(int type)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDeclaredType()Get declared type name.IClassItemgetField()Get field information.java.lang.StringgetFieldName()Get field name.IClassItemgetFlag()Get flag method information.IClassItemgetGet()Get get method information.java.lang.StringgetGetName()Get get method name.IClassgetGetType()Get type for value loaded to stack.java.lang.StringgetName()Get name.NamespaceElementgetNamespace()Get effective namespace information.IClassgetObjectType()Get class linked to binding element.java.lang.StringgetPrefix()Get specified namespace prefix.IClassItemgetSet()Get set method information.java.lang.StringgetSetName()Get set method name.IClassgetSetType()Get type for value stored from stack.IClassItemgetTest()Get test method information.java.lang.StringgetTestName()Get test method name.IClassgetType()Get value type information.java.lang.StringgetUri()Get specified namespace URI.intgetUsage()Get usage value.java.lang.StringgetUsageName()Get usage name.booleanhasAttribute()Check if component defines one or more attribute values of the containing element.booleanhasContent()Check if component defines one or more elements or text values as children of the containing element.booleanhasName()Check if component has a name.booleanhasObject()Check if this container defines a context object.booleanhasProperty()Check if property is defined.booleanisFlagOnly()Check if property is flag only.booleanisImplicit()Check if this value implicitly uses the containing object.booleanisOptional()Check if component is an optional item.voidprevalidate(ValidationContext vctx)Prevalidate element information.voidsetDeclaredType(java.lang.String type)Set declared type name.voidsetFieldName(java.lang.String field)Set field name.voidsetFlagName(java.lang.String flag)Set flag method name.voidsetGetName(java.lang.String get)Set get method name.voidsetName(java.lang.String name)Set name.voidsetPrefix(java.lang.String prefix)Set namespace prefix.voidsetSetName(java.lang.String set)Set set method name.voidsetTestName(java.lang.String test)Set test method name.voidsetUri(java.lang.String uri)Set namespace URI.voidsetUsage(int use)Set usage value.voidsetUsageName(java.lang.String name)Set usage name.voidvalidate(ValidationContext vctx)Validate element information.-
Methods inherited from class org.jibx.binding.model.ContainerElementBase
checkCompatibleChildren, classifyComponents, getAttributeComponents, getChildObjectType, 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, setDefinitions, 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
-
m_propertyAttrs
private PropertyAttributes m_propertyAttrs
Property attributes information for nesting.
-
m_nameAttrs
private NameAttributes m_nameAttrs
Name attributes information for nesting.
-
m_collectionItem
private boolean m_collectionItem
Flag for child of collection element (only meaningful after prevalidation).
-
-
Method Detail
-
getName
public java.lang.String getName()
Get name.- Specified by:
getNamein interfaceIComponent- Returns:
- name text
-
setName
public void setName(java.lang.String name)
Set name.- Parameters:
name- text for name
-
getUri
public java.lang.String getUri()
Get specified namespace URI.- Specified by:
getUriin interfaceIComponent- Returns:
- namespace URI (
nullif not set)
-
setUri
public void setUri(java.lang.String uri)
Set namespace URI.- Parameters:
uri- namespace URI (nullif not set)
-
getPrefix
public java.lang.String getPrefix()
Get specified namespace prefix.- Returns:
- namespace prefix (
nullif not set)
-
setPrefix
public void setPrefix(java.lang.String prefix)
Set namespace prefix.- Parameters:
prefix- namespace prefix (nullif not set)
-
getNamespace
public NamespaceElement getNamespace()
Get effective namespace information. This call is only meaningful after validation.- Returns:
- effective namespace information
-
getUsageName
public java.lang.String getUsageName()
Get usage name.- Returns:
- usage name
-
getUsage
public int getUsage()
Get usage value. This call is only meaningful after a call toprevalidate(ValidationContext).- Returns:
- usage value
-
setUsageName
public void setUsageName(java.lang.String name)
Set usage name.- Parameters:
name- usage name
-
setUsage
public void setUsage(int use)
Set usage value.- Parameters:
use- value
-
hasProperty
public boolean hasProperty()
Check if property is defined. This method is only meaningful after a call toprevalidate(ValidationContext).- Returns:
trueif property defined,falseif not
-
isFlagOnly
public boolean isFlagOnly()
Check if property is flag only. This method is only meaningful after a call toprevalidate(ValidationContext).- Returns:
trueif flag property,falseif not
-
getDeclaredType
public java.lang.String getDeclaredType()
Get declared type name.- Returns:
- type name (or
nullif none)
-
setDeclaredType
public void setDeclaredType(java.lang.String type)
Set declared type name.- Parameters:
type- name (ornullif none)
-
getFieldName
public java.lang.String getFieldName()
Get field name.- Returns:
- field name (or
nullif none)
-
getField
public IClassItem getField()
Get field information. This call is only meaningful after a call toprevalidate(ValidationContext).- Returns:
- field information (or
nullif none)
-
setFieldName
public void setFieldName(java.lang.String field)
Set field name.- Parameters:
field- field name (ornullif none)
-
getTestName
public java.lang.String getTestName()
Get test method name.- Returns:
- test method name (or
nullif none)
-
getTest
public IClassItem getTest()
Get test method information. This call is only meaningful after a call toprevalidate(ValidationContext).- Returns:
- test method information (or
nullif none)
-
setTestName
public void setTestName(java.lang.String test)
Set test method name.- Parameters:
test- test method name (ornullif none)
-
getFlag
public IClassItem getFlag()
Get flag method information. This call is only meaningful after a call toprevalidate(ValidationContext).- Returns:
- flag method information (or
nullif none)
-
setFlagName
public void setFlagName(java.lang.String flag)
Set flag method name.- Parameters:
flag- flag method name (ornullif none)
-
getGetName
public java.lang.String getGetName()
Get get method name.- Returns:
- get method name (or
nullif none)
-
getGet
public IClassItem getGet()
Get get method information. This call is only meaningful after a call toprevalidate(ValidationContext).- Returns:
- get method information (or
nullif none)
-
getGetType
public IClass getGetType()
Get type for value loaded to stack. This call is only meaningful after a call toprevalidate(ValidationContext).- Returns:
- get value type (or
nullif none)
-
setGetName
public void setGetName(java.lang.String get)
Set get method name.- Parameters:
get- get method name (ornullif none)
-
getSetName
public java.lang.String getSetName()
Get set method name.- Returns:
- set method name (or
nullif none)
-
getSet
public IClassItem getSet()
Get set method information. This call is only meaningful after a call toprevalidate(ValidationContext).- Returns:
- set method information (or
nullif none)
-
getSetType
public IClass getSetType()
Get type for value stored from stack. This call is only meaningful after a call toprevalidate(ValidationContext).- Returns:
- set value type (or
nullif none)
-
setSetName
public void setSetName(java.lang.String set)
Set set method name.- Parameters:
set- set method name (ornullif none)
-
isImplicit
public boolean isImplicit()
Check if this value implicitly uses the containing object. This call is only meaningful after a call toprevalidate(ValidationContext).- Specified by:
isImplicitin interfaceIComponent- Returns:
trueif using the containing object,falseif own value
-
isOptional
public boolean isOptional()
Description copied from interface:IComponentCheck if component is an optional item.- Specified by:
isOptionalin interfaceIComponent- Returns:
trueif optional,falseif required
-
hasObject
public boolean hasObject()
Description copied from class:ContainerElementBaseCheck if this container defines a context object.- Specified by:
hasObjectin classContainerElementBase- Returns:
trueif defines context object,falseif not
-
hasAttribute
public boolean hasAttribute()
Description copied from interface:IComponentCheck if component defines one or more attribute values of the containing element. This method is only valid after validation.- Specified by:
hasAttributein interfaceIComponent- Returns:
trueif one or more attribute values defined for containing element,falseif not
-
hasContent
public boolean hasContent()
Description copied from interface:IComponentCheck if component defines one or more elements or text values as children of the containing element. This method is only valid after validation.- Specified by:
hasContentin interfaceIComponent- Returns:
trueif one or more content values defined for containing element,falseif not
-
hasName
public boolean hasName()
Description copied from interface:IComponentCheck if component has a name.- Specified by:
hasNamein interfaceIComponent- Returns:
trueif component has a name,falseif not
-
getType
public IClass getType()
Description copied from interface:IComponentGet value type information. This call is only meaningful after prevalidation.- Specified by:
getTypein interfaceIComponent- Returns:
- type information
-
getObjectType
public IClass getObjectType()
Description copied from class:ContainerElementBaseGet class linked to binding element. This call is only meaningful after validation.- Specified by:
getObjectTypein 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 classContainerElementBase- 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 classContainerElementBase- Parameters:
vctx- validation context
-
-