Package org.jibx.binding.model
Class StringAttributes
- java.lang.Object
-
- org.jibx.binding.model.AttributeBase
-
- 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
Fields Modifier and Type Field Description static intCOLLAPSE_WHITESPACEprivate static java.lang.String[]DESERIALIZER_SIGNATURESprivate static java.lang.StringENUM_VALUE_METHOD_SIGNATUREprivate FormatElementm_baseFormatBase format for conversions.private java.lang.Objectm_defaultDefault value object.private java.lang.Stringm_defaultTextDefault value text.private IClassItemm_deserializerItemDeserializer method (or constructor from string) information.private java.lang.Stringm_deserializerNameDeserializer fully qualified class and method name.private IClassItemm_enumValueItemMethod used to get text representation of an enum.private java.lang.Stringm_enumValueNameEnum value method name.private java.lang.Stringm_formatNameReferenced format name.private QNamem_formatQNameFormat qualified name.private IClassItemm_serializerItemSerializer method (or toString equivalent) information.private java.lang.Stringm_serializerNameSerializer fully qualified class and method name.private IClassm_typeClassValue type class.private intm_whitespaceIndexActual selected whitespace handling.private java.lang.Stringm_whitespaceNameWhitespace handling name.static intPRESERVE_WHITESPACEstatic intREPLACE_WHITESPACEstatic StringArrays_allowedAttributesEnumeration of allowed attribute namesstatic EnumSets_whitespaceEnumprivate static java.lang.String[]SERIALIZER_SIGNATURE_VARIANTSprivate static java.lang.Class[]STRING_CONSTRUCTOR_ARGUMENT_CLASSESprivate static java.lang.StringSTRING_CONSTRUCTOR_SIGNATUREstatic intTRIM_WHITESPACE
-
Constructor Summary
Constructors Constructor Description StringAttributes()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatElementgetBaseFormat()Get base format information.java.lang.ObjectgetDefault()Get default value.java.lang.StringgetDefaultName()Get whitespace handling type name.java.lang.StringgetDefaultText()Get default value text.IClassItemgetDeserializer()Get deserializer method information.java.lang.StringgetDeserializerName()Get deserializer name.IClassItemgetEnumValue()Get enum value method information.java.lang.StringgetEnumValueName()Get enum value method name.java.lang.StringgetFormatName()Get base format name.QNamegetFormatQName()Get format qualified name.private java.lang.StringgetQualifiedFormat(IMarshallingContext ictx)JiBX access method to get format label as qualified name.IClassItemgetSerializer()Get serializer method information.java.lang.StringgetSerializerName()Get serializer name.IClassgetType()Get value type.voidprevalidate(ValidationContext vctx)Prevalidate attribute information.voidsetDefaultName(java.lang.String name)Set whitespace handling type name.voidsetDefaultText(java.lang.String value)Set default value text.voidsetDeserializerName(java.lang.String name)Set deserializer method name.voidsetEnumValueName(java.lang.String name)Set enum value method name.voidsetFormatName(java.lang.String name)Set base format name.voidsetFormatQName(QName qname)Set format qualified name.private voidsetQualifiedFormat(java.lang.String label, IUnmarshallingContext ictx)JiBX access method to set format label as qualified name.voidsetSerializerName(java.lang.String name)Set serializer method name.voidsetType(IClass type)Set value type.-
Methods inherited from class org.jibx.binding.model.AttributeBase
validate
-
-
-
-
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
-
PRESERVE_WHITESPACE
public static final int PRESERVE_WHITESPACE
- See Also:
- Constant Field Values
-
REPLACE_WHITESPACE
public static final int REPLACE_WHITESPACE
- See Also:
- Constant Field Values
-
COLLAPSE_WHITESPACE
public static final int COLLAPSE_WHITESPACE
- See Also:
- Constant Field Values
-
TRIM_WHITESPACE
public static final int TRIM_WHITESPACE
- See Also:
- Constant Field Values
-
s_whitespaceEnum
public static final EnumSet s_whitespaceEnum
-
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_whitespaceName
private java.lang.String m_whitespaceName
Whitespace handling name.
-
m_whitespaceIndex
private int m_whitespaceIndex
Actual selected whitespace handling.
-
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.
-
-
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 (
nullif 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 (nullif 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 toAttributeBase.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
nullif none)
-
getSerializer
public IClassItem getSerializer()
Get serializer method information. This method is only usable after a call toAttributeBase.validate(ValidationContext).- Returns:
- serializer information (or
nullif none)
-
setSerializerName
public void setSerializerName(java.lang.String name)
Set serializer method name.- Parameters:
name- fully qualified class and method name for serializer
-
setDefaultName
public void setDefaultName(java.lang.String name)
Set whitespace handling type name.- Parameters:
name- whitespace handling type
-
getDefaultName
public java.lang.String getDefaultName()
Get whitespace handling type name.- Returns:
- whitespace handling type
-
getDeserializerName
public java.lang.String getDeserializerName()
Get deserializer name.- Returns:
- fully qualified class and method name for deserializer (or
nullif none)
-
getDeserializer
public IClassItem getDeserializer()
Get deserializer method information. This method is only usable after a call toAttributeBase.validate(ValidationContext).- Returns:
- deserializer information (or
nullif 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
nullif none)
-
getEnumValue
public IClassItem getEnumValue()
Get enum value method information. This method is only usable after a call toAttributeBase.validate(ValidationContext).- Returns:
- enum value method information (or
nullif none)
-
setEnumValueName
public void setEnumValueName(java.lang.String name)
Set enum value method name.- Parameters:
name- enum value method name (nullif none)
-
getBaseFormat
public FormatElement getBaseFormat()
Get base format information. This method is only usable after a call toAttributeBase.validate(ValidationContext).- Returns:
- base format element (or
nullif none)
-
setQualifiedFormat
private void setQualifiedFormat(java.lang.String label, IUnmarshallingContext ictx) throws JiBXExceptionJiBX access method to set format label as qualified name.- Parameters:
label- format label text (nullif 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 (
nullif none) - Throws:
JiBXException- on deserialization error
-
prevalidate
public void prevalidate(ValidationContext vctx)
Description copied from class:AttributeBasePrevalidate 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:
prevalidatein classAttributeBase- Parameters:
vctx- validation context
-
-