Package org.jibx.binding.model
Class MappingElementBase
java.lang.Object
org.jibx.binding.model.ElementBase
org.jibx.binding.model.NestingElementBase
org.jibx.binding.model.ContainerElementBase
org.jibx.binding.model.TemplateElementBase
org.jibx.binding.model.MappingElementBase
- Direct Known Subclasses:
MappingElement
,PrecompiledMappingElement
Model component for mapping element of binding definition. Subclasses
are used for mappings in normal or precompiled bindings.
- Author:
- Dennis M. Sosnoski
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Name of mapped class extended by this mapping.private boolean
Abstract mapping flag.private NameAttributes
Name attributes information for nesting.private QName
Type qualified name (defaults to fully-qualified class name in no-namespace namespace).static final StringArray
Enumeration of allowed attribute namesFields inherited from class org.jibx.binding.model.TemplateElementBase
m_topChildren
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 -
Method Summary
Modifier and TypeMethodDescriptionGet name of mapped class extended by this one.getName()
Get name.Get name attributes.Get effective namespace information.Get specified namespace prefix.private String
JiBX access method to get mapping type name as qualified name.Get type name.Get type qualified name.getUri()
Get specified namespace URI.boolean
Check for abstract mapping.boolean
Check if this is a default template.private void
preSet
(IUnmarshallingContext uctx) Make sure all attributes are defined.void
prevalidate
(ValidationContext vctx) Prevalidate element information.void
setAbstract
(boolean abs) Set abstract mapping.void
setExtendsName
(String name) Set name of mapped class extended by this one.void
Set name.void
Set namespace prefix.private void
setQualifiedTypeName
(String text, IUnmarshallingContext ictx) JiBX access method to set mapping type name as qualified name.void
setTypeName
(String name) Set type name.void
setTypeQName
(QName qname) Set type qualified name.void
Set namespace URI.void
validate
(ValidationContext vctx) Validate element information.Methods inherited from class org.jibx.binding.model.TemplateElementBase
addExtensionType, addTopChild, getClassName, getExtensionTypes, getHandledClass, getObjectType, getType, hasObject, isImplicit, isOptional, setClassName, topChildIterator, topChildren
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_isAbstract
private boolean m_isAbstractAbstract mapping flag. -
m_nameAttrs
Name attributes information for nesting. -
m_extendsName
Name of mapped class extended by this mapping. -
m_typeQName
Type qualified name (defaults to fully-qualified class name in no-namespace namespace).
-
-
Constructor Details
-
MappingElementBase
public MappingElementBase(int type) Constructor.- Parameters:
type
- element type code
-
-
Method Details
-
isAbstract
public boolean isAbstract()Check for abstract mapping.- Returns:
true
if abstract,false
if not
-
setAbstract
public void setAbstract(boolean abs) Set abstract mapping.- Parameters:
abs
-true
if abstract,false
if not
-
getTypeName
Get type name.- Returns:
- type name
-
setTypeName
Set type name.- Parameters:
name
- type name
-
getTypeQName
Get type qualified name.- Returns:
- type qualified name
-
setTypeQName
Set type qualified name.- Parameters:
qname
- type qualified name
-
isDefaultTemplate
public boolean isDefaultTemplate()Check if this is a default template.- Specified by:
isDefaultTemplate
in classTemplateElementBase
- Returns:
true
if default,false
if not
-
getNameAttributes
Get name attributes. This is provided for use with the name attributes as a hash key.- Returns:
- name attributes structure
-
getName
Get name.- Returns:
- name text
-
setName
Set name.- Parameters:
name
- text for name
-
getUri
Get specified namespace URI.- 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
-
preSet
Make sure all attributes are defined.- Parameters:
uctx
- unmarshalling context- Throws:
JiBXException
- on unmarshalling error
-
setExtendsName
Set name of mapped class extended by this one.- Parameters:
name
-
-
getExtendsName
Get name of mapped class extended by this one.- Returns:
- name
-
setQualifiedTypeName
JiBX access method to set mapping type name as qualified name.- Parameters:
text
- mapping name text (null
if none)ictx
- unmarshalling context- Throws:
JiBXException
- on deserialization error
-
getQualifiedTypeName
JiBX access method to get mapping type name as qualified name.- Parameters:
ictx
- marshalling context- Returns:
- mapping type name text (
null
if none) - Throws:
JiBXException
- on deserialization error
-
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 classTemplateElementBase
- 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 classTemplateElementBase
- Parameters:
vctx
- validation context
-