Class LayoutField

java.lang.Object
cl.obcom.desktopfx.layout.LayoutField
All Implemented Interfaces:
Serializable

public abstract class LayoutField extends Object implements Serializable
Data item whose value can be edited with a LayoutMessage. A LayoutField has a type, a name, a length, a numeric scale and a default value. The values of these properties have restrictions depending on the type of the field. See FieldType for details about these restrictions.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    final Character
    getChar(LayoutMessage message, int index)
    Returns the first character of the string value of the index occurence of this field in message.
    final Character
    getChar(LayoutMessage message, int index, boolean strict)
    Returns the first character of the string value of the index occurence of this field in message.
    final Date
    getDate(LayoutMessage message, int index)
    Returns the date value of the index occurence of this field in message.
    getDate(LayoutMessage message, int index, boolean strict)
    Returns the date value of the index occurence of this field in message.
    Returns the default value of this field.
    final String
    Returns the defined default value of this field.
    final Double
    getDouble(LayoutMessage message, int index)
    Returns the double value of the index occurence of this field in message.
    final Double
    getDouble(LayoutMessage message, int index, boolean strict)
    Returns the double value of the index occurence of this field in message.
    int
    Returns the length of the formatted values of this field.
    final Integer
    getInteger(LayoutMessage message, int index)
    Returns the integer value of the index occurence of this field in message.
    final Integer
    getInteger(LayoutMessage message, int index, boolean strict)
    Returns the integer value of the index occurence of this field in message.
    final Layout
    Returns the layout of this field or null if undefined.
    final int
    Returns the length of each occurrence of this field.
    final Locale
    Returns the locale of this field.
    final Long
    getLong(LayoutMessage message, int index)
    Returns the long value of the index occurence of this field in message.
    final Long
    getLong(LayoutMessage message, int index, boolean strict)
    Returns the long value of the index occurence of this field in message.
    final String
    Returns the name of this field.
    getNumber(LayoutMessage message, int index)
    Returns the decimal value of the index occurence of this field in message.
    getNumber(LayoutMessage message, int index, boolean strict)
    Returns the decimal value of the index occurence of this field in message.
    final int
    Returns the number of occurrences of this field.
    final int
    getOffset(int index)
    Returns the offset position of the index occurence of this field in a message or it's parent list.
    Returns the list field that contains this field.
    final int
    Returns the numeric scale of this field.
    final String
    getString(LayoutMessage message, int index)
    Returns the string value of the index occurence of this field in message.
    getString(LayoutMessage message, int index, boolean strict)
    Returns the string value of the index occurence of this field in message.
    final String
    getSubstring(LayoutMessage message, int index)
    Returns a substring of the index occurence of this field in message.
    final String
    getSubstring(LayoutMessage message, int index, boolean rtrim, boolean nodata)
    Returns a substring of the index occurence of this field in message.
    final FieldType
    Returns the type of this field.
    final Object
    getValue(LayoutMessage message, int index)
    Returns the object value of the index occurence of this field in message.
    getValue(LayoutMessage message, int index, boolean strict)
    Returns the object value of the index occurence of this field in message.
    final boolean
    Returns true if numbers are formatted using group separators.
    final boolean
    isNull(LayoutMessage message, int index)
    Returns true if the value of the index occurence of this field in message is NULL.
    final void
    setChar(LayoutMessage message, int index, Character value)
    Changes the character value of the index occurence of this field in message.
    final void
    setChar(LayoutMessage message, int index, Character value, boolean strict)
    Changes the character value of the index occurence of this field in message.
    final void
    setDate(LayoutMessage message, int index, Date date)
    Changes the date value of the index occurence of this field in message.
    void
    setDate(LayoutMessage message, int index, Date date, boolean strict)
    Changes the date value of the index occurence of this field in message.
    void
    setDefault(LayoutMessage message, int index)
    Changes the value of the index occurence of this field in message to its default value.
    final void
    setDouble(LayoutMessage message, int index, Double value)
    Changes the double value of the index occurence of this field in message.
    final void
    setDouble(LayoutMessage message, int index, Double value, boolean strict)
    Changes the double value of the index occurence of this field in message.
    void
    setGroupingUsed(boolean groupingUsed)
    Changes whether numbers are formatted using group separators.
    final void
    setInteger(LayoutMessage message, int index, Integer value)
    Changes the integer value of the index occurence of this field in message.
    final void
    setInteger(LayoutMessage message, int index, Integer value, boolean strict)
    Changes the integer value of the index occurence of this field in message.
    void
    setLocale(Locale locale)
    Changes the locale of this field.
    final void
    setLong(LayoutMessage message, int index, Long value)
    Changes the long value of the index occurence of this field in message.
    final void
    setLong(LayoutMessage message, int index, Long value, boolean strict)
    Changes the long value of the index occurence of this field in message.
    void
    setNull(LayoutMessage message, int index)
    Changes the value of the index occurence of this field in message to NULL.
    final void
    setNumber(LayoutMessage message, int index, BigDecimal value)
    Changes the decimal value of the index occurence of this field in message.
    void
    setNumber(LayoutMessage message, int index, BigDecimal value, boolean strict)
    Changes the decimal value of the index occurence of this field in message.
    final void
    setString(LayoutMessage message, int index, String value)
    Changes the string value of the index occurence of this field in message.
    void
    setString(LayoutMessage message, int index, String value, boolean strict)
    Changes the string value of the index occurence of this field in message.
    final void
    setSubstring(LayoutMessage message, int index, String value)
    Replaces a substring of the index occurence of this field in message.
    final void
    setSubstring(LayoutMessage message, int index, String value, boolean strict)
    Replaces a substring of the index occurence of this field in message.
    final void
    setValue(LayoutMessage message, int index, Object value)
    Changes the object value of the index occurence of this field in message.
    void
    setValue(LayoutMessage message, int index, Object value, boolean strict)
    Changes the object value of the index occurence of this field in message.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getType

      public final FieldType getType()
      Returns the type of this field.
      Returns:
      the type of this field.
    • getLayout

      public final Layout getLayout()
      Returns the layout of this field or null if undefined.
      Returns:
      the layout of this field or null if undefined.
    • getName

      public final String getName()
      Returns the name of this field.
      Returns:
      the name of this field.
    • getLength

      public final int getLength()
      Returns the length of each occurrence of this field.
      Returns:
      the length of each occurrence of this field.
    • getScale

      public final int getScale()
      Returns the numeric scale of this field.
      Returns:
      the numeric scale of this field.
    • getOccurs

      public final int getOccurs()
      Returns the number of occurrences of this field.
      Returns:
      the number of occurrences of this field.
    • getFormattedLength

      public int getFormattedLength()
      Returns the length of the formatted values of this field.
      Returns:
      the length of the formatted values of this field.
    • getLocale

      public final Locale getLocale()
      Returns the locale of this field. This locale is used by fields that are locale-sensitive (such as numeric fields) when they are converted to/from strings. Initially, a field uses the default JVM locale.
      Returns:
      the locale of this field or null for default locale.
    • setLocale

      public void setLocale(Locale locale)
      Changes the locale of this field. This locale is used by fields that are locale-sensitive (such as numeric fields) when they are converted to/from strings. If supplied locale is null, the default JVM locale is used.
      Parameters:
      locale - the new layout locale (can be null).
    • isGroupingUsed

      public final boolean isGroupingUsed()
      Returns true if numbers are formatted using group separators.
      Returns:
      true if numbers are formatted using group separators.
    • setGroupingUsed

      public void setGroupingUsed(boolean groupingUsed)
      Changes whether numbers are formatted using group separators.
      Parameters:
      groupingUsed - the new value of this property.
    • getDefinedDefault

      public final String getDefinedDefault()
      Returns the defined default value of this field. If the field does not have a defined default value, it returns null.
      Returns:
      the default value of this field or null if the field does not have a defined default value.
    • getDefault

      public String getDefault()
      Returns the default value of this field. If the field does not have a defined default value, it returns the default value associatted with its type. This method never returns null.
      Returns:
      the default value of this field or the default value associatted with its type.
    • setDefault

      public void setDefault(LayoutMessage message, int index)
      Changes the value of the index occurence of this field in message to its default value. If the field's default value is invalid, then the type's default value is used.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
    • getParent

      public final LayoutField getParent()
      Returns the list field that contains this field. If this field does not belong to a list, it returns null. Fields of type FieldType.LIST always return null because list fields cannot be defined (contained) within other lists.
      Returns:
      the list field that contains this field or null.
    • getOffset

      public final int getOffset(int index)
      Returns the offset position of the index occurence of this field in a message or it's parent list.
      Parameters:
      index - the occurence index of the field.
      Returns:
      the offset position of this field in a message or parent list.
      Throws:
      IndexOutOfBoundsException - if index is out-of-bounds.
    • isNull

      public final boolean isNull(LayoutMessage message, int index)
      Returns true if the value of the index occurence of this field in message is NULL. The value is NULL if the first character of it's substring is NO-DATA (0x1A). The substring begins at getOffset with a length given by getLength()
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Returns:
      true if the value of this field is NULL.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
    • setNull

      public void setNull(LayoutMessage message, int index)
      Changes the value of the index occurence of this field in message to NULL. The value is set to NULL by replacing all characters of it's substring with NO-DATA (0x1A).
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
    • getSubstring

      public final String getSubstring(LayoutMessage message, int index)
      Returns a substring of the index occurence of this field in message. The substring begins at getOffset with a length given by getLength(). Trailing spaces are removed. It returns null if the first character of the substring is NO-DATA (0x1A).
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Returns:
      the requiered substring or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
    • getSubstring

      public final String getSubstring(LayoutMessage message, int index, boolean rtrim, boolean nodata)
      Returns a substring of the index occurence of this field in message. The substring begins at getOffset with a length given by getLength(). If rtrim is true, trailing spaces are removed. It returns null if nodata is true and the first character of the substring is NO-DATA (0x1A). If nodata is false, the returned substring includes NO-DATA (0x1A) characters.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      rtrim - if true remove trailing spaces.
      nodata - if true check for NO-DATA.
      Returns:
      the requiered substring or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
    • setSubstring

      public final void setSubstring(LayoutMessage message, int index, String value)
      Replaces a substring of the index occurence of this field in message. The substring begins at getOffset(int) method with a length given by getLength(). If value is null, the substring is filled with NO-DATA (0x1A) characters. If value is shorter than the substring, the remaining space is filled with spaces. If value is too long, it is truncated.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new character sequence of this field (can be null).
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      IllegalArgumentException - if strict and value is too long.
    • setSubstring

      public final void setSubstring(LayoutMessage message, int index, String value, boolean strict)
      Replaces a substring of the index occurence of this field in message. The substring begins at getOffset(int) method with a length given by getLength(). If value is null, the substring is filled with NO-DATA (0x1A) characters. If value is shorter than the substring, the remaining space is filled with spaces. If value is too long, it is truncated, unless strict is true, in which case an exception is thrown.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new character sequence of this field (can be null).
      strict - if true throws an exception if value is invalid.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      IllegalArgumentException - if strict and value is too long.
    • getString

      public final String getString(LayoutMessage message, int index)
      Returns the string value of the index occurence of this field in message. It returns null if the value of the field is NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Returns:
      the string value of this field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
    • getString

      public String getString(LayoutMessage message, int index, boolean strict)
      Returns the string value of the index occurence of this field in message. It returns null if the value of the field is NULL. If strict is true an exception is thrown if message is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      strict - if true throws an exception if message is invalid.
      Returns:
      the string value of this field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
    • setString

      public final void setString(LayoutMessage message, int index, String value)
      Changes the string value of the index occurence of this field in message. The supplied value is formatted according to the type of this field, and the resulting text is stored in message. If value is null, the value of the field is set to NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the string representation of the field value.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if value has an invalid format.
    • setString

      public void setString(LayoutMessage message, int index, String value, boolean strict)
      Changes the string value of the index occurence of this field in message. The supplied value is formatted according to the type of this field, and the resulting text is stored in message. If value is null, the value of the field is set to NULL. If strict is true an exception is thrown if value is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the string representation of the field value.
      strict - if true throws an exception if value is invalid.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if value has an invalid format.
    • getChar

      public final Character getChar(LayoutMessage message, int index)
      Returns the first character of the string value of the index occurence of this field in message. It returns null if the value of the field is NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Returns:
      the character value of the field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
    • getChar

      public final Character getChar(LayoutMessage message, int index, boolean strict)
      Returns the first character of the string value of the index occurence of this field in message. It returns null if the value of the field is NULL. If strict is true an exception is thrown if message is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      strict - if true throws an exception if message is invalid.
      Returns:
      the character value of the field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
    • setChar

      public final void setChar(LayoutMessage message, int index, Character value)
      Changes the character value of the index occurence of this field in message. If value is null, the value of the field is set to NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new character value of the field (can be null).
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if value has an invalid format.
    • setChar

      public final void setChar(LayoutMessage message, int index, Character value, boolean strict)
      Changes the character value of the index occurence of this field in message. If value is null, the value of the field is set to NULL. If strict is true an exception is thrown if value is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new character value of the field (can be null).
      strict - if true throws an exception if value is invalid.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if value has an invalid format.
    • getNumber

      public final BigDecimal getNumber(LayoutMessage message, int index)
      Returns the decimal value of the index occurence of this field in message. This method can only be used if the type of this field is NUMERIC or SIGNED. It returns null if the value of the field is NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Returns:
      the decimal value of this field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • getNumber

      public BigDecimal getNumber(LayoutMessage message, int index, boolean strict)
      Returns the decimal value of the index occurence of this field in message. This method can only be used if the type of this field is NUMERIC or SIGNED. It returns null if the value of the field is NULL. If strict is true an exception is thrown if message is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      strict - if true throws an exception if message is invalid.
      Returns:
      the decimal value of this field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • setNumber

      public final void setNumber(LayoutMessage message, int index, BigDecimal value)
      Changes the decimal value of the index occurence of this field in message. This method can only be used if the type of this field is NUMERIC or SIGNED. If decimal is null, the value of the field is set to NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - decimal value of the field (can be null).
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • setNumber

      public void setNumber(LayoutMessage message, int index, BigDecimal value, boolean strict)
      Changes the decimal value of the index occurence of this field in message. This method can only be used if the type of this field is NUMERIC or SIGNED. If decimal is null, the value of the field is set to NULL. If strict is true an exception is thrown if value is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - decimal value of the field (can be null).
      strict - if true throws an exception if value is invalid.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • getDouble

      public final Double getDouble(LayoutMessage message, int index)
      Returns the double value of the index occurence of this field in message. It returns null if the value of the field is NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Returns:
      the double value of the field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • getDouble

      public final Double getDouble(LayoutMessage message, int index, boolean strict)
      Returns the double value of the index occurence of this field in message. It returns null if the value of the field is NULL. If strict is true an exception is thrown if message is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      strict - if true throws an exception if message is invalid.
      Returns:
      the double value of the field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • setDouble

      public final void setDouble(LayoutMessage message, int index, Double value)
      Changes the double value of the index occurence of this field in message. If value is null, the value of the field is set to NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new double value of the field (can be null).
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • setDouble

      public final void setDouble(LayoutMessage message, int index, Double value, boolean strict)
      Changes the double value of the index occurence of this field in message. If value is null, the value of the field is set to NULL. If strict is true an exception is thrown if value is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new double value of the field (can be null).
      strict - if true throws an exception if value is invalid.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • getInteger

      public final Integer getInteger(LayoutMessage message, int index)
      Returns the integer value of the index occurence of this field in message. It returns null if the value of the field is NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Returns:
      the integer value of the the field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • getInteger

      public final Integer getInteger(LayoutMessage message, int index, boolean strict)
      Returns the integer value of the index occurence of this field in message. It returns null if the value of the field is NULL. If strict is true an exception is thrown if message is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      strict - if true throws an exception if message is invalid.
      Returns:
      the integer value of the the field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • setInteger

      public final void setInteger(LayoutMessage message, int index, Integer value)
      Changes the integer value of the index occurence of this field in message. If value is null, the value of the field is set to NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new integer value of the field (can be null).
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • setInteger

      public final void setInteger(LayoutMessage message, int index, Integer value, boolean strict)
      Changes the integer value of the index occurence of this field in message. If value is null, the value of the field is set to NULL. If strict is true an exception is thrown if value is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new integer value of the field (can be null).
      strict - if true throws an exception if value is invalid.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • getLong

      public final Long getLong(LayoutMessage message, int index)
      Returns the long value of the index occurence of this field in message. It returns null if the value of the field is NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Returns:
      the long value of the the field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • getLong

      public final Long getLong(LayoutMessage message, int index, boolean strict)
      Returns the long value of the index occurence of this field in message. It returns null if the value of the field is NULL. If strict is true an exception is thrown if message is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      strict - if true throws an exception if message is invalid.
      Returns:
      the long value of the the field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • setLong

      public final void setLong(LayoutMessage message, int index, Long value)
      Changes the long value of the index occurence of this field in message. If value is null, the value of the field is set to NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new long value of the field (can be null).
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • setLong

      public final void setLong(LayoutMessage message, int index, Long value, boolean strict)
      Changes the long value of the index occurence of this field in message. If value is null, the value of the field is set to NULL. If strict is true an exception is thrown if value is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new long value of the field (can be null).
      strict - if true throws an exception if value is invalid.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      UnsupportedOperationException - if the type of this field is not NUMERIC or SIGNED.
    • getDate

      public final Date getDate(LayoutMessage message, int index)
      Returns the date value of the index occurence of this field in message. This method can only be used if the type of this field is DATE. It returns null if the value of the field is NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Returns:
      the date value of this field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
      UnsupportedOperationException - if the type of this field is not DATE.
    • getDate

      public Date getDate(LayoutMessage message, int index, boolean strict)
      Returns the date value of the index occurence of this field in message. This method can only be used if the type of this field is DATE. It returns null if the value of the field is NULL. If strict is true an exception is thrown if message is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      strict - if true throws an exception if message is invalid.
      Returns:
      the date value of this field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
      UnsupportedOperationException - if the type of this field is not DATE.
    • setDate

      public final void setDate(LayoutMessage message, int index, Date date)
      Changes the date value of the index occurence of this field in message. This method can only be used if the type of this field is DATE. If date is null, the value of the field is set to NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      date - the new date value of the field (can be null).
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      UnsupportedOperationException - if the type of this field is not DATE.
    • setDate

      public void setDate(LayoutMessage message, int index, Date date, boolean strict)
      Changes the date value of the index occurence of this field in message. This method can only be used if the type of this field is DATE. If date is null, the value of the field is set to NULL. If strict is true an exception is thrown if value is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      date - the new date value of the field (can be null).
      strict - if true throws an exception if value is invalid.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      UnsupportedOperationException - if the type of this field is not DATE.
    • getValue

      public final Object getValue(LayoutMessage message, int index)
      Returns the object value of the index occurence of this field in message. It returns null if the value of the field is NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      Returns:
      the object value of this field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
    • getValue

      public Object getValue(LayoutMessage message, int index, boolean strict)
      Returns the object value of the index occurence of this field in message. It returns null if the value of the field is NULL. If strict is true an exception is thrown if message is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      strict - if true throws an exception if message is invalid.
      Returns:
      the object value of this field or null.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if the field record data is invalid.
    • setValue

      public final void setValue(LayoutMessage message, int index, Object value)
      Changes the object value of the index occurence of this field in message. If value is null, the value of the field is set to NULL.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new object value of the field (can be null).
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if supplied value is invalid.
    • setValue

      public void setValue(LayoutMessage message, int index, Object value, boolean strict)
      Changes the object value of the index occurence of this field in message. If value is null, the value of the field is set to NULL. If strict is true an exception is thrown if value is invalid.
      Parameters:
      message - the layout message editor.
      index - the occurence index of the field.
      value - the new object value of the field (can be null).
      strict - if true throws an exception if value is invalid.
      Throws:
      NullPointerException - if message is null.
      IndexOutOfBoundsException - if index is out-of-bounds.
      ValueFormatException - if supplied value is invalid.