Class StringAttributes


  • public class StringAttributes
    extends AttributeBase
    Model component for string attribute group in binding definition.
    Author:
    Dennis M. Sosnoski
    • 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
      • 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.
    • 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
      • 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)
      • 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 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)
      • setEnumValueName

        public void setEnumValueName​(java.lang.String name)
        Set enum value method name.
        Parameters:
        name - enum value method name (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