Package org.jibx.binding.model
Class FormatElement
java.lang.Object
org.jibx.binding.model.ElementBase
org.jibx.binding.model.FormatElement
Model component for format element. This element defines conversion to
and from simple unstructured text representations.
- Version:
- 1.0
- Author:
- Dennis M. Sosnoski
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanDefault format for type flag.private StringFormat label.private QNameFormat qualified name.private StringAttributesString attributes information for value.private IClassValue type information.private StringName of value type.static final StringArrayEnumeration of allowed attribute namesFields 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 base format information.Get default value.Get default value text.Get deserializer method information.Get deserializer name.Get enum value method information.Get enum value method name.getLabel()Get format label.getQName()Get format qualified name.private StringJiBX access method to get format label as qualified name.Get serializer method information.Get serializer name.getType()Get value type.Get value type name.booleanCheck if default format for type.private voidpostSet()Set default flag based on whether name supplied or not.private voidpreSet(IUnmarshallingContext uctx) Make sure all attributes are defined.voidprevalidate(ValidationContext vctx) Prevalidate attributes of element in isolation.voidsetDefaultFormat(boolean dflt) Set default format for type.voidsetDefaultText(String value) Set default value text.voidsetDeserializerName(String name) Set deserializer method name.voidsetEnumValueName(String name) Set enum value method name.voidSet format label.voidSet format qualified name.private voidsetQualifiedLabel(String label, IUnmarshallingContext ictx) JiBX access method to set format label as qualified name.voidsetSerializerName(String name) Set serializer method name.voidsetTypeName(String value) Set value type name.voidvalidate(ValidationContext vctx) Validate element information.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_label
Format label. -
m_qname
Format qualified name. -
m_isDefault
private boolean m_isDefaultDefault format for type flag. -
m_typeName
Name of value type. -
m_type
Value type information. -
m_stringAttrs
String attributes information for value.
-
-
Constructor Details
-
FormatElement
public FormatElement()Constructor.
-
-
Method Details
-
getLabel
Get format label.- Returns:
- format label (
nullif none)
-
setLabel
Set format label. This method changes the qualified name to match the label.- Parameters:
label- format label (nullif none)
-
getQName
Get format qualified name.- Returns:
- format qualified name (
nullif none)
-
setQName
Set format qualified name. This method changes the label value to match the qualified name.- Parameters:
qname- format qualified name (nullif none)
-
isDefaultFormat
public boolean isDefaultFormat()Check if default format for type.- Returns:
trueif default for type,falseif not
-
setDefaultFormat
public void setDefaultFormat(boolean dflt) Set default format for type.- Parameters:
dflt-trueif default for type,falseif not
-
getType
Get value type. This method is only usable after a call tovalidate(org.jibx.binding.model.ValidationContext).- Returns:
- default value object
-
getTypeName
Get value type name.- Returns:
- value type name
-
setTypeName
Set value type name.- Parameters:
value- type name
-
getDefaultText
Get default value text.- Returns:
- default value text
-
getDefault
Get default value. This call is only meaningful after validation.- Returns:
- default value object
-
setDefaultText
Set default value text.- Parameters:
value- default value text
-
getEnumValue
Get enum value method information. This method is only usable after a call tovalidate(ValidationContext).- Returns:
- enum value method information (or
nullif none)
-
getEnumValueName
Get enum value method name.- Returns:
- enum value method name (or
nullif none)
-
setEnumValueName
Set enum value method name.- Parameters:
name- enum value method name (nullif none)
-
getSerializerName
Get serializer name.- Returns:
- fully qualified class and method name for serializer (or
nullif none)
-
getSerializer
Get serializer method information. This call is only meaningful after validation.- Returns:
- serializer information (or
nullif none)
-
setSerializerName
Set serializer method name.- Parameters:
name- fully qualified class and method name for serializer
-
getDeserializerName
Get deserializer name.- Returns:
- fully qualified class and method name for deserializer (or
nullif none)
-
getDeserializer
Get deserializer method information. This call is only meaningful after validation.- Returns:
- deserializer information (or
nullif none)
-
setDeserializerName
Set deserializer method name.- Parameters:
name- fully qualified class and method name for deserializer
-
getBaseFormat
Get base format information. This method is only usable after a call tovalidate(org.jibx.binding.model.ValidationContext).- Returns:
- base format element (or
nullif none)
-
setQualifiedLabel
JiBX access method to set format label as qualified name.- Parameters:
label- format label text (nullif none)ictx- unmarshalling context- Throws:
JiBXException- on deserialization error
-
getQualifiedLabel
JiBX access method to get format label as qualified name.- Parameters:
ictx- marshalling context- Returns:
- format label text (
nullif none) - Throws:
JiBXException- on deserialization error
-
preSet
Make sure all attributes are defined.- Parameters:
uctx- unmarshalling context- Throws:
JiBXException- on unmarshalling error
-
postSet
private void postSet()Set default flag based on whether name supplied or not. TODO: use explicit flag for 2.0 -
prevalidate
Prevalidate attributes of element in isolation. Note that this adds the format information to the context, which is necessary because the string attributes for values need to have access to the format information for their own prevalidation. This is the only type of registration which is done during the prevalidation pass.- Overrides:
prevalidatein classElementBase- 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 classElementBase- Parameters:
vctx- validation context
-