org.jibx.binding.model
Class StringAttributes

java.lang.Object
  extended by org.jibx.binding.model.AttributeBase
      extended by org.jibx.binding.model.StringAttributes

public class StringAttributes
extends AttributeBase

Model component for string attribute group in binding definition.

Author:
Dennis M. Sosnoski

Field Summary
private static java.lang.String[] DESERIALIZER_SIGNATURES
           
private static java.lang.String ENUM_VALUE_METHOD_SIGNATURE
           
private  FormatElement m_baseFormat
          Base format for conversions.
private  java.lang.Object m_default
          Default value object.
private  java.lang.String m_defaultText
          Default value text.
private  IClassItem m_deserializerItem
          Deserializer method (or constructor from string) information.
private  java.lang.String m_deserializerName
          Deserializer fully qualified class and method name.
private  IClassItem m_enumValueItem
          Method used to get text representation of an enum.
private  java.lang.String m_enumValueName
          Enum value method name.
private  java.lang.String m_formatName
          Referenced format name.
private  QName m_formatQName
          Format qualified name.
private  IClassItem m_serializerItem
          Serializer method (or toString equivalent) information.
private  java.lang.String m_serializerName
          Serializer fully qualified class and method name.
private  IClass m_typeClass
          Value type class.
static StringArray s_allowedAttributes
          Enumeration of allowed attribute names
private static java.lang.String[] SERIALIZER_SIGNATURE_VARIANTS
           
private static java.lang.Class[] STRING_CONSTRUCTOR_ARGUMENT_CLASSES
           
private static java.lang.String STRING_CONSTRUCTOR_SIGNATURE
           
 
Constructor Summary
StringAttributes()
          Default constructor.
 
Method Summary
 FormatElement getBaseFormat()
          Get base format information.
 java.lang.Object getDefault()
          Get default value.
 java.lang.String getDefaultText()
          Get default value text.
 IClassItem getDeserializer()
          Get deserializer method information.
 java.lang.String getDeserializerName()
          Get deserializer name.
 IClassItem getEnumValue()
          Get enum value method information.
 java.lang.String getEnumValueName()
          Get enum value method name.
 java.lang.String getFormatName()
          Get base format name.
 QName getFormatQName()
          Get format qualified name.
private  java.lang.String getQualifiedFormat(IMarshallingContext ictx)
          JiBX access method to get format label as qualified name.
 IClassItem getSerializer()
          Get serializer method information.
 java.lang.String getSerializerName()
          Get serializer name.
 IClass getType()
          Get value type.
 void prevalidate(ValidationContext vctx)
          Prevalidate attribute information.
 void setDefaultText(java.lang.String value)
          Set default value text.
 void setDeserializerName(java.lang.String name)
          Set deserializer method name.
 void setEnumValueName(java.lang.String name)
          Set enum value method name.
 void setFormatName(java.lang.String name)
          Set base format name.
 void setFormatQName(QName qname)
          Set format qualified name.
private  void setQualifiedFormat(java.lang.String label, IUnmarshallingContext ictx)
          JiBX access method to set format label as qualified name.
 void setSerializerName(java.lang.String name)
          Set serializer method name.
 void setType(IClass type)
          Set value type.
 
Methods inherited from class org.jibx.binding.model.AttributeBase
validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_allowedAttributes

public static final StringArray s_allowedAttributes
Enumeration of allowed attribute names


SERIALIZER_SIGNATURE_VARIANTS

private static final java.lang.String[] SERIALIZER_SIGNATURE_VARIANTS

DESERIALIZER_SIGNATURES

private static final java.lang.String[] DESERIALIZER_SIGNATURES

ENUM_VALUE_METHOD_SIGNATURE

private static final java.lang.String ENUM_VALUE_METHOD_SIGNATURE
See Also:
Constant Field Values

STRING_CONSTRUCTOR_SIGNATURE

private static final java.lang.String STRING_CONSTRUCTOR_SIGNATURE
See Also:
Constant Field Values

STRING_CONSTRUCTOR_ARGUMENT_CLASSES

private static final java.lang.Class[] STRING_CONSTRUCTOR_ARGUMENT_CLASSES

m_formatName

private java.lang.String m_formatName
Referenced format name.


m_formatQName

private QName m_formatQName
Format qualified name.


m_defaultText

private java.lang.String m_defaultText
Default value text.


m_serializerName

private java.lang.String m_serializerName
Serializer fully qualified class and method name.


m_deserializerName

private java.lang.String m_deserializerName
Deserializer fully qualified class and method name.


m_enumValueName

private java.lang.String m_enumValueName
Enum value method name.


m_baseFormat

private FormatElement m_baseFormat
Base format for conversions.


m_typeClass

private IClass m_typeClass
Value type class.


m_default

private java.lang.Object m_default
Default value object.


m_serializerItem

private IClassItem m_serializerItem
Serializer method (or toString equivalent) information.


m_deserializerItem

private IClassItem m_deserializerItem
Deserializer method (or constructor from string) information.


m_enumValueItem

private IClassItem m_enumValueItem
Method used to get text representation of an enum.

Constructor Detail

StringAttributes

public StringAttributes()
Default constructor.

Method Detail

setType

public void setType(IClass type)
Set value type. This needs to be set by the owning element prior to validation. Even though the type is an important part of the string information, it's treated as a separate item of information because it needs to be used as part of the property attributes.

Parameters:
type - value type

getType

public IClass getType()
Get value type.

Returns:
value type

getFormatName

public java.lang.String getFormatName()
Get base format name.

Returns:
referenced base format

setFormatName

public void setFormatName(java.lang.String name)
Set base format name.

Parameters:
name - referenced base format

getFormatQName

public QName getFormatQName()
Get format qualified name.

Returns:
format qualified name (null if none)

setFormatQName

public void setFormatQName(QName qname)
Set format qualified name. This method changes the label value to match the qualified name.

Parameters:
qname - format qualified name (null if none)

getDefaultText

public java.lang.String getDefaultText()
Get default value text.

Returns:
default value text

getDefault

public java.lang.Object getDefault()
Get default value. This method is only usable after a call to AttributeBase.validate(ValidationContext).

Returns:
default value object

setDefaultText

public void setDefaultText(java.lang.String value)
Set default value text.

Parameters:
value - default value text

getSerializerName

public java.lang.String getSerializerName()
Get serializer name.

Returns:
fully qualified class and method name for serializer (or null if none)

getSerializer

public IClassItem getSerializer()
Get serializer method information. This method is only usable after a call to AttributeBase.validate(ValidationContext).

Returns:
serializer information (or null if none)

setSerializerName

public void setSerializerName(java.lang.String name)
Set serializer method name.

Parameters:
name - fully qualified class and method name for serializer

getDeserializerName

public java.lang.String getDeserializerName()
Get deserializer name.

Returns:
fully qualified class and method name for deserializer (or null if none)

getDeserializer

public IClassItem getDeserializer()
Get deserializer method information. This method is only usable after a call to AttributeBase.validate(ValidationContext).

Returns:
deserializer information (or null if none)

setDeserializerName

public void setDeserializerName(java.lang.String name)
Set deserializer method name.

Parameters:
name - fully qualified class and method name for deserializer

getEnumValueName

public java.lang.String getEnumValueName()
Get enum value method name.

Returns:
enum value method name (or null if none)

getEnumValue

public IClassItem getEnumValue()
Get enum value method information. This method is only usable after a call to AttributeBase.validate(ValidationContext).

Returns:
enum value method information (or null if none)

setEnumValueName

public void setEnumValueName(java.lang.String name)
Set enum value method name.

Parameters:
name - enum value method name (null if none)

getBaseFormat

public FormatElement getBaseFormat()
Get base format information. This method is only usable after a call to AttributeBase.validate(ValidationContext).

Returns:
base format element (or null if none)

setQualifiedFormat

private void setQualifiedFormat(java.lang.String label,
                                IUnmarshallingContext ictx)
                         throws JiBXException
JiBX access method to set format label as qualified name.

Parameters:
label - format label text (null if none)
ictx - unmarshalling context
Throws:
JiBXException - on deserialization error

getQualifiedFormat

private java.lang.String getQualifiedFormat(IMarshallingContext ictx)
                                     throws JiBXException
JiBX access method to get format label as qualified name.

Parameters:
ictx - marshalling context
Returns:
format label text (null if none)
Throws:
JiBXException - on deserialization error

prevalidate

public void prevalidate(ValidationContext vctx)
Description copied from class: AttributeBase
Prevalidate attribute information. The prevalidation step is used to check attribute values in isolation, such as the settings for enumerated values and class file information. This empty base class implementation should be overridden by each subclass that requires prevalidation handling.

Overrides:
prevalidate in class AttributeBase
Parameters:
vctx - validation context


Project Web Site