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
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
FieldsModifier and TypeFieldDescriptionprivate boolean
Flag for child of collection element (only meaningful after prevalidation).private NameAttributes
Name attributes information for nesting.private PropertyAttributes
Property attributes information for nesting.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 TypeMethodDescriptionGet declared type name.getField()
Get field information.Get field name.getFlag()
Get flag method information.getGet()
Get get method information.Get get method name.Get type for value loaded to stack.getName()
Get name.Get effective namespace information.Get class linked to binding element.Get specified namespace prefix.getSet()
Get set method information.Get set method name.Get type for value stored from stack.getTest()
Get test method information.Get test method name.getType()
Get value type information.getUri()
Get specified namespace URI.int
getUsage()
Get usage value.Get usage name.boolean
Check if component defines one or more attribute values of the containing element.boolean
Check if component defines one or more elements or text values as children of the containing element.boolean
hasName()
Check if component has a name.boolean
Check if this container defines a context object.boolean
Check if property is defined.boolean
Check if property is flag only.boolean
Check if this value implicitly uses the containing object.boolean
Check if component is an optional item.void
prevalidate
(ValidationContext vctx) Prevalidate element information.void
setDeclaredType
(String type) Set declared type name.void
setFieldName
(String field) Set field name.void
setFlagName
(String flag) Set flag method name.void
setGetName
(String get) Set get method name.void
Set name.void
Set namespace prefix.void
setSetName
(String set) Set set method name.void
setTestName
(String test) Set test method name.void
Set namespace URI.void
setUsage
(int use) Set usage value.void
setUsageName
(String name) Set usage name.void
validate
(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 Details
-
s_allowedAttributes
Enumeration of allowed attribute names -
m_propertyAttrs
Property attributes information for nesting. -
m_nameAttrs
Name attributes information for nesting. -
m_collectionItem
private boolean m_collectionItemFlag for child of collection element (only meaningful after prevalidation).
-
-
Constructor Details
-
StructureElementBase
protected StructureElementBase(int type) Constructor.- Parameters:
type
- element type code
-
-
Method Details
-
getName
Get name.- Specified by:
getName
in interfaceIComponent
- Returns:
- name text
-
setName
Set name.- Parameters:
name
- text for name
-
getUri
Get specified namespace URI.- Specified by:
getUri
in interfaceIComponent
- Returns:
- namespace URI (
null
if not set)
-
setUri
Set namespace URI.- Parameters:
uri
- namespace URI (null
if not set)
-
getPrefix
Get specified namespace prefix.- Returns:
- namespace prefix (
null
if not set)
-
setPrefix
Set namespace prefix.- Parameters:
prefix
- namespace prefix (null
if not set)
-
getNamespace
Get effective namespace information. This call is only meaningful after validation.- Returns:
- effective namespace information
-
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
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:
true
if property defined,false
if not
-
isFlagOnly
public boolean isFlagOnly()Check if property is flag only. This method is only meaningful after a call toprevalidate(ValidationContext)
.- Returns:
true
if flag property,false
if not
-
getDeclaredType
Get declared type name.- Returns:
- type name (or
null
if none)
-
setDeclaredType
Set declared type name.- Parameters:
type
- name (ornull
if none)
-
getFieldName
Get field name.- Returns:
- field name (or
null
if none)
-
getField
Get field information. This call is only meaningful after a call toprevalidate(ValidationContext)
.- Returns:
- field information (or
null
if none)
-
setFieldName
Set field name.- Parameters:
field
- field name (ornull
if none)
-
getTestName
Get test method name.- Returns:
- test method name (or
null
if none)
-
getTest
Get test method information. This call is only meaningful after a call toprevalidate(ValidationContext)
.- Returns:
- test method information (or
null
if none)
-
setTestName
Set test method name.- Parameters:
test
- test method name (ornull
if none)
-
getFlag
Get flag method information. This call is only meaningful after a call toprevalidate(ValidationContext)
.- Returns:
- flag method information (or
null
if none)
-
setFlagName
Set flag method name.- Parameters:
flag
- flag method name (ornull
if none)
-
getGetName
Get get method name.- Returns:
- get method name (or
null
if none)
-
getGet
Get get method information. This call is only meaningful after a call toprevalidate(ValidationContext)
.- Returns:
- get method information (or
null
if none)
-
getGetType
Get type for value loaded to stack. This call is only meaningful after a call toprevalidate(ValidationContext)
.- Returns:
- get value type (or
null
if none)
-
setGetName
Set get method name.- Parameters:
get
- get method name (ornull
if none)
-
getSetName
Get set method name.- Returns:
- set method name (or
null
if none)
-
getSet
Get set method information. This call is only meaningful after a call toprevalidate(ValidationContext)
.- Returns:
- set method information (or
null
if none)
-
getSetType
Get type for value stored from stack. This call is only meaningful after a call toprevalidate(ValidationContext)
.- Returns:
- set value type (or
null
if none)
-
setSetName
Set set method name.- Parameters:
set
- set method name (ornull
if 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:
isImplicit
in interfaceIComponent
- Returns:
true
if using the containing object,false
if own value
-
isOptional
public boolean isOptional()Description copied from interface:IComponent
Check if component is an optional item.- Specified by:
isOptional
in interfaceIComponent
- Returns:
true
if optional,false
if required
-
hasObject
public boolean hasObject()Description copied from class:ContainerElementBase
Check if this container defines a context object.- Specified by:
hasObject
in classContainerElementBase
- Returns:
true
if defines context object,false
if not
-
hasAttribute
public boolean hasAttribute()Description copied from interface:IComponent
Check if component defines one or more attribute values of the containing element. This method is only valid after validation.- Specified by:
hasAttribute
in interfaceIComponent
- Returns:
true
if one or more attribute values defined for containing element,false
if not
-
hasContent
public boolean hasContent()Description copied from interface:IComponent
Check 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:
hasContent
in interfaceIComponent
- Returns:
true
if one or more content values defined for containing element,false
if not
-
hasName
public boolean hasName()Description copied from interface:IComponent
Check if component has a name.- Specified by:
hasName
in interfaceIComponent
- Returns:
true
if component has a name,false
if not
-
getType
Description copied from interface:IComponent
Get value type information. This call is only meaningful after prevalidation.- Specified by:
getType
in interfaceIComponent
- Returns:
- type information
-
getObjectType
Description copied from class:ContainerElementBase
Get class linked to binding element. This call is only meaningful after validation.- Specified by:
getObjectType
in classContainerElementBase
- Returns:
- information for class linked by binding
-
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 classContainerElementBase
- 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 classContainerElementBase
- Parameters:
vctx
- validation context
-