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 Details

    • s_allowedAttributes

      public static final StringArray s_allowedAttributes
      Enumeration of allowed attribute names
    • SERIALIZER_SIGNATURE_VARIANTS

      private static final String[] SERIALIZER_SIGNATURE_VARIANTS
    • DESERIALIZER_SIGNATURES

      private static final String[] DESERIALIZER_SIGNATURES
    • ENUM_VALUE_METHOD_SIGNATURE

      private static final String ENUM_VALUE_METHOD_SIGNATURE
      See Also:
    • STRING_CONSTRUCTOR_SIGNATURE

      private static final String STRING_CONSTRUCTOR_SIGNATURE
      See Also:
    • STRING_CONSTRUCTOR_ARGUMENT_CLASSES

      private static final Class[] STRING_CONSTRUCTOR_ARGUMENT_CLASSES
    • PRESERVE_WHITESPACE

      public static final int PRESERVE_WHITESPACE
      See Also:
    • REPLACE_WHITESPACE

      public static final int REPLACE_WHITESPACE
      See Also:
    • COLLAPSE_WHITESPACE

      public static final int COLLAPSE_WHITESPACE
      See Also:
    • TRIM_WHITESPACE

      public static final int TRIM_WHITESPACE
      See Also:
    • s_whitespaceEnum

      public static final EnumSet s_whitespaceEnum
    • m_formatName

      private String m_formatName
      Referenced format name.
    • m_formatQName

      private QName m_formatQName
      Format qualified name.
    • m_defaultText

      private String m_defaultText
      Default value text.
    • m_serializerName

      private String m_serializerName
      Serializer fully qualified class and method name.
    • m_whitespaceName

      private String m_whitespaceName
      Whitespace handling name.
    • m_whitespaceIndex

      private int m_whitespaceIndex
      Actual selected whitespace handling.
    • m_deserializerName

      private String m_deserializerName
      Deserializer fully qualified class and method name.
    • m_enumValueName

      private 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 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 Details

    • StringAttributes

      public StringAttributes()
      Default constructor.
  • Method Details

    • 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)
    • setQualifiedFormat

      private void setQualifiedFormat(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 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