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
static int COLLAPSE_WHITESPACE
           
static int PRESERVE_WHITESPACE
           
static int REPLACE_WHITESPACE
           
static StringArray s_allowedAttributes
          Enumeration of allowed attribute names
static EnumSet s_whitespaceEnum
           
static int TRIM_WHITESPACE
           
 
Constructor Summary
StringAttributes()
          Default constructor.
 
Method Summary
 FormatElement getBaseFormat()
          Get base format information.
 Object getDefault()
          Get default value.
 String getDefaultName()
          Get whitespace handling type name.
 String getDefaultText()
          Get default value text.
 IClassItem getDeserializer()
          Get deserializer method information.
 String getDeserializerName()
          Get deserializer name.
 IClassItem getEnumValue()
          Get enum value method information.
 String getEnumValueName()
          Get enum value method name.
 String getFormatName()
          Get base format name.
 QName getFormatQName()
          Get format qualified name.
 IClassItem getSerializer()
          Get serializer method information.
 String getSerializerName()
          Get serializer name.
 IClass getType()
          Get value type.
 void prevalidate(ValidationContext vctx)
          Prevalidate attribute information.
 void setDefaultName(String name)
          Set whitespace handling type name.
 void setDefaultText(String value)
          Set default value text.
 void setDeserializerName(String name)
          Set deserializer method name.
 void setEnumValueName(String name)
          Set enum value method name.
 void setFormatName(String name)
          Set base format name.
 void setFormatQName(QName qname)
          Set format qualified name.
 void setSerializerName(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


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
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 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 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 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 to AttributeBase.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 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(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 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(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 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(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)

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


Copyright © 2005-2011 jibx.org. All Rights Reserved.