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
public abstract class MappingElementBase extends TemplateElementBase
Model component for mapping element of binding definition. Subclasses are used for mappings in normal or precompiled bindings.- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringm_extendsNameName of mapped class extended by this mapping.private booleanm_isAbstractAbstract mapping flag.private NameAttributesm_nameAttrsName attributes information for nesting.private QNamem_typeQNameType qualified name (defaults to fully-qualified class name in no-namespace namespace).static StringArrays_allowedAttributesEnumeration of allowed attribute names-
Fields 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 Constructor Description MappingElementBase(int type)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetExtendsName()Get name of mapped class extended by this one.java.lang.StringgetName()Get name.NameAttributesgetNameAttributes()Get name attributes.NamespaceElementgetNamespace()Get effective namespace information.java.lang.StringgetPrefix()Get specified namespace prefix.private java.lang.StringgetQualifiedTypeName(IMarshallingContext ictx)JiBX access method to get mapping type name as qualified name.java.lang.StringgetTypeName()Get type name.QNamegetTypeQName()Get type qualified name.java.lang.StringgetUri()Get specified namespace URI.booleanisAbstract()Check for abstract mapping.booleanisDefaultTemplate()Check 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(java.lang.String name)Set name of mapped class extended by this one.voidsetName(java.lang.String name)Set name.voidsetPrefix(java.lang.String prefix)Set namespace prefix.private voidsetQualifiedTypeName(java.lang.String text, IUnmarshallingContext ictx)JiBX access method to set mapping type name as qualified name.voidsetTypeName(java.lang.String name)Set type name.voidsetTypeQName(QName qname)Set type qualified name.voidsetUri(java.lang.String uri)Set 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, 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 Detail
-
s_allowedAttributes
public static final StringArray s_allowedAttributes
Enumeration of allowed attribute names
-
m_isAbstract
private boolean m_isAbstract
Abstract mapping flag.
-
m_nameAttrs
private NameAttributes m_nameAttrs
Name attributes information for nesting.
-
m_extendsName
private java.lang.String m_extendsName
Name of mapped class extended by this mapping.
-
m_typeQName
private QName m_typeQName
Type qualified name (defaults to fully-qualified class name in no-namespace namespace).
-
-
Method Detail
-
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
public java.lang.String getTypeName()
Get type name.- Returns:
- type name
-
setTypeName
public void setTypeName(java.lang.String name)
Set type name.- Parameters:
name- type name
-
getTypeQName
public QName getTypeQName()
Get type qualified name.- Returns:
- type qualified name
-
setTypeQName
public void setTypeQName(QName qname)
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
public NameAttributes getNameAttributes()
Get name attributes. This is provided for use with the name attributes as a hash key.- Returns:
- name attributes structure
-
getName
public java.lang.String getName()
Get name.- 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.- 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
-
preSet
private void preSet(IUnmarshallingContext uctx) throws JiBXException
Make sure all attributes are defined.- Parameters:
uctx- unmarshalling context- Throws:
JiBXException- on unmarshalling error
-
setExtendsName
public void setExtendsName(java.lang.String name)
Set name of mapped class extended by this one.- Parameters:
name-
-
getExtendsName
public java.lang.String getExtendsName()
Get name of mapped class extended by this one.- Returns:
- name
-
setQualifiedTypeName
private void setQualifiedTypeName(java.lang.String text, IUnmarshallingContext ictx) throws JiBXExceptionJiBX 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
private java.lang.String getQualifiedTypeName(IMarshallingContext ictx) throws JiBXException
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
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 classTemplateElementBase- 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 classTemplateElementBase- Parameters:
vctx- validation context
-
-