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_WHITESPACEstatic intPRESERVE_WHITESPACEstatic intREPLACE_WHITESPACEstatic StringArrays_allowedAttributesEnumeration of allowed attribute namesstatic org.jibx.runtime.EnumSets_whitespaceEnumstatic 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.ObjectgetDefault()Get default value.StringgetDefaultName()Get whitespace handling type name.StringgetDefaultText()Get default value text.IClassItemgetDeserializer()Get deserializer method information.StringgetDeserializerName()Get deserializer name.IClassItemgetEnumValue()Get enum value method information.StringgetEnumValueName()Get enum value method name.StringgetFormatName()Get base format name.org.jibx.runtime.QNamegetFormatQName()Get format qualified name.IClassItemgetSerializer()Get serializer method information.StringgetSerializerName()Get serializer name.IClassgetType()Get value type.voidprevalidate(ValidationContext vctx)Prevalidate attribute information.voidsetDefaultName(String name)Set whitespace handling type name.voidsetDefaultText(String value)Set default value text.voidsetDeserializerName(String name)Set deserializer method name.voidsetEnumValueName(String name)Set enum value method name.voidsetFormatName(String name)Set base format name.voidsetFormatQName(org.jibx.runtime.QName qname)Set format qualified name.voidsetSerializerName(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
-
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 org.jibx.runtime.EnumSet s_whitespaceEnum
-
-
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 String getFormatName()
Get base format name.- Returns:
- referenced base format
-
setFormatName
public void setFormatName(String name)
Set base format name.- Parameters:
name- referenced base format
-
getFormatQName
public org.jibx.runtime.QName getFormatQName()
Get format qualified name.- Returns:
- format qualified name (
nullif none)
-
setFormatQName
public void setFormatQName(org.jibx.runtime.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 String getDefaultText()
Get default value text.- Returns:
- default value text
-
getDefault
public Object getDefault()
Get default value. This method is only usable after a call toAttributeBase.validate(ValidationContext).- Returns:
- default value object
-
setDefaultText
public void setDefaultText(String value)
Set default value text.- Parameters:
value- default value text
-
getSerializerName
public 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(String name)
Set serializer method name.- Parameters:
name- fully qualified class and method name for serializer
-
setDefaultName
public void setDefaultName(String name)
Set whitespace handling type name.- Parameters:
name- whitespace handling type
-
getDefaultName
public String getDefaultName()
Get whitespace handling type name.- Returns:
- whitespace handling type
-
getDeserializerName
public 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(String name)
Set deserializer method name.- Parameters:
name- fully qualified class and method name for deserializer
-
getEnumValueName
public 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(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)
-
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
-
-