public abstract class TemplateElementBase extends ContainerElementBase
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
m_className
Name of handled class.
|
private java.util.ArrayList |
m_extensionTypes
Templates or mappings that can be used in place of this one (as
substitution group using mapping, or xsi:type with template).
|
private IClass |
m_handledClass
Handled class information.
|
protected java.util.ArrayList |
m_topChildren
List of child elements.
|
static StringArray |
s_allowedAttributes
Enumeration of allowed attribute names
|
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 and Description |
---|
TemplateElementBase(int type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addExtensionType(TemplateElementBase ext)
Add template or mapping which derives from this one.
|
void |
addTopChild(java.lang.Object child)
Add top-level child element.
|
java.lang.String |
getClassName()
Get mapped class name.
|
java.util.ArrayList |
getExtensionTypes()
Get templates or mappings which derive from this one.
|
IClass |
getHandledClass()
Get handled class information.
|
IClass |
getObjectType()
Get class linked to binding element.
|
IClass |
getType() |
boolean |
hasObject()
Check if this container defines a context object.
|
abstract boolean |
isDefaultTemplate()
Check if default template for type.
|
boolean |
isImplicit() |
boolean |
isOptional() |
void |
prevalidate(ValidationContext vctx)
Prevalidate element information.
|
void |
setClassName(java.lang.String name)
Set mapped class name.
|
java.util.Iterator |
topChildIterator()
Get iterator for top-level child elements.
|
java.util.ArrayList |
topChildren()
Get list of top-level child elements.
|
void |
validate(ValidationContext vctx)
Validate element information.
|
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
addChild, childIterator, children, getDefaultStyle, getDefinitions, getStyle, getStyleName, setDefinitions, setStyleName
getComment, name, setComment, toString, type, validateAttributes
public static final StringArray s_allowedAttributes
private java.lang.String m_className
private IClass m_handledClass
protected java.util.ArrayList m_topChildren
private java.util.ArrayList m_extensionTypes
public TemplateElementBase(int type)
type
- element type codepublic void setClassName(java.lang.String name)
name
- mapped class namepublic java.lang.String getClassName()
public IClass getHandledClass()
protected void addExtensionType(TemplateElementBase ext)
ext
- derived template or mapping informationpublic java.util.ArrayList getExtensionTypes()
public abstract boolean isDefaultTemplate()
true
if default for type, false
if notpublic void addTopChild(java.lang.Object child)
child
- element to be added as child of this elementpublic java.util.ArrayList topChildren()
null
if nonepublic java.util.Iterator topChildIterator()
public boolean isOptional()
public IClass getType()
public boolean isImplicit()
public boolean hasObject()
ContainerElementBase
hasObject
in class ContainerElementBase
true
if defines context object,
false
if notpublic IClass getObjectType()
ContainerElementBase
getObjectType
in class ContainerElementBase
public void prevalidate(ValidationContext vctx)
ElementBase
prevalidate
in class ContainerElementBase
vctx
- validation contextpublic void validate(ValidationContext vctx)
ElementBase
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.validate
in class ContainerElementBase
vctx
- validation context