org.jibx.binding.model
Class MappingElementBase

java.lang.Object
  extended by org.jibx.binding.model.ElementBase
      extended by org.jibx.binding.model.NestingElementBase
          extended by org.jibx.binding.model.ContainerElementBase
              extended by org.jibx.binding.model.TemplateElementBase
                  extended by 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
static StringArray s_allowedAttributes
          Enumeration 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
MappingElementBase(int type)
          Constructor.
 
Method Summary
 String getExtendsName()
          Get name of mapped class extended by this one.
 String getName()
          Get name.
 NameAttributes getNameAttributes()
          Get name attributes.
 NamespaceElement getNamespace()
          Get effective namespace information.
 String getPrefix()
          Get specified namespace prefix.
 String getTypeName()
          Get type name.
 QName getTypeQName()
          Get type qualified name.
 String getUri()
          Get specified namespace URI.
 boolean isAbstract()
          Check for abstract mapping.
 boolean isDefaultTemplate()
          Check if this is a default template.
 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 setName(String name)
          Set name.
 void setPrefix(String prefix)
          Set namespace prefix.
 void setTypeName(String name)
          Set type name.
 void setTypeQName(QName qname)
          Set type qualified name.
 void setUri(String uri)
          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, setStyleName
 
Methods inherited from class org.jibx.binding.model.ElementBase
getComment, name, setComment, toString, type, validateAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s_allowedAttributes

public static final StringArray s_allowedAttributes
Enumeration of allowed attribute names

Constructor Detail

MappingElementBase

public MappingElementBase(int type)
Constructor.

Parameters:
type - element type code
Method Detail

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

public String getTypeName()
Get type name.

Returns:
type name

setTypeName

public void setTypeName(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:
isDefaultTemplate in class TemplateElementBase
Returns:
true if default, false if 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 String getName()
Get name.

Returns:
name text

setName

public void setName(String name)
Set name.

Parameters:
name - text for name

getUri

public String getUri()
Get specified namespace URI.

Returns:
namespace URI (null if not set)

setUri

public void setUri(String uri)
Set namespace URI.

Parameters:
uri - namespace URI (null if not set)

getPrefix

public String getPrefix()
Get specified namespace prefix.

Returns:
namespace prefix (null if not set)

setPrefix

public void setPrefix(String prefix)
Set namespace prefix.

Parameters:
prefix - namespace prefix (null if not set)

getNamespace

public NamespaceElement getNamespace()
Get effective namespace information. This call is only meaningful after validation.

Returns:
effective namespace information

setExtendsName

public void setExtendsName(String name)
Set name of mapped class extended by this one.

Parameters:
name -

getExtendsName

public String getExtendsName()
Get name of mapped class extended by this one.

Returns:
name

prevalidate

public void prevalidate(ValidationContext vctx)
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 class TemplateElementBase
Parameters:
vctx - validation context

validate

public void validate(ValidationContext vctx)
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. The ElementBase.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 class TemplateElementBase
Parameters:
vctx - validation context


Copyright © 2005-2011 jibx.org. All Rights Reserved.