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 StringName of mapped class extended by this mapping.private booleanAbstract mapping flag.private NameAttributesName attributes information for nesting.private QNameType qualified name (defaults to fully-qualified class name in no-namespace namespace).static final StringArrayEnumeration of allowed attribute namesFields inherited from class org.jibx.binding.model.TemplateElementBase
m_topChildrenFields 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 StringJiBX access method to get mapping type name as qualified name.Get type name.Get type qualified name.getUri()Get specified namespace URI.booleanCheck for abstract mapping.booleanCheck if this is a default template.private voidpreSet(IUnmarshallingContext uctx) Make sure all attributes are defined.voidprevalidate(ValidationContext vctx) Prevalidate element information.voidsetAbstract(boolean abs) Set abstract mapping.voidsetExtendsName(String name) Set name of mapped class extended by this one.voidSet name.voidSet namespace prefix.private voidsetQualifiedTypeName(String text, IUnmarshallingContext ictx) JiBX access method to set mapping type name as qualified name.voidsetTypeName(String name) Set type name.voidsetTypeQName(QName qname) Set type qualified name.voidSet namespace URI.voidvalidate(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, topChildrenMethods 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, verifyConstructionMethods inherited from class org.jibx.binding.model.NestingElementBase
addChild, childIterator, children, getDefaultStyle, getDefinitions, getStyle, getStyleName, setDefinitions, setStyleNameMethods 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:
trueif abstract,falseif not
-
setAbstract
public void setAbstract(boolean abs) Set abstract mapping.- Parameters:
abs-trueif abstract,falseif 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:
isDefaultTemplatein classTemplateElementBase- Returns:
trueif default,falseif 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 (
nullif not set)
-
setUri
Set namespace URI.- Parameters:
uri- namespace URI (nullif not set)
-
getPrefix
Get specified namespace prefix.- Returns:
- namespace prefix (
nullif not set)
-
setPrefix
Set namespace prefix.- Parameters:
prefix- namespace prefix (nullif 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 (nullif 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 (
nullif none) - Throws:
JiBXException- on deserialization error
-
prevalidate
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 classTemplateElementBase- Parameters:
vctx- validation context
-
validate
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 classTemplateElementBase- Parameters:
vctx- validation context
-