Klasse BigDecimalDataElement

java.lang.Object
de.esoco.lib.property.AbstractStringProperties
de.esoco.lib.property.StringProperties
de.esoco.data.element.DataElement<BigDecimal>
de.esoco.data.element.BigDecimalDataElement
Alle implementierten Schnittstellen:
de.esoco.lib.property.HasProperties, de.esoco.lib.property.MutableProperties, Serializable

public class BigDecimalDataElement extends DataElement<BigDecimal>
A data element implementation for BigDecimal values.
Siehe auch:
  • Felddetails

    • DISPLAY_STYLE

      public static final de.esoco.lib.property.PropertyName<BigDecimalDataElement.DisplayStyle> DISPLAY_STYLE
      A style property that defines the rendering of big decimal values.
    • DECIMAL_GROUP_CHAR

      public static final String DECIMAL_GROUP_CHAR
      The placeholder string for the decimal grouping character.
      Siehe auch:
    • DECIMAL_SEPARATOR_CHAR

      public static final String DECIMAL_SEPARATOR_CHAR
      The placeholder string for the decimal separator character.
      Siehe auch:
    • DEFAULT_CONSTRAINT

      public static final String DEFAULT_CONSTRAINT
      Default input constraint for positive or negative decimal values with optional grouping characters. Contains the input character placeholders DECIMAL_GROUP_CHAR and DECIMAL_SEPARATOR_CHAR which must be replaced with the actual locale-specific pattern before using the string as a regular expression.
      Siehe auch:
    • CURRENCY_CONSTRAINT

      public static final String CURRENCY_CONSTRAINT
      Input constraint for positive currency values. To also allow negative values use SIGNED_CURRENCY_CONSTRAINT. See the remarks for DEFAULT_CONSTRAINT.
      Siehe auch:
    • SIGNED_CURRENCY_CONSTRAINT

      public static final String SIGNED_CURRENCY_CONSTRAINT
      A variant of CURRENCY_CONSTRAINT that allows both positive and negative valuess.
      Siehe auch:
  • Konstruktordetails

    • BigDecimalDataElement

      public BigDecimalDataElement(String name, BigDecimal value)
      Creates a new read-only instance with a certain name and value.
      Parameter:
      name - The name of this element
      value - The initial value
    • BigDecimalDataElement

      public BigDecimalDataElement(String name, BigDecimal value, Validator<? super BigDecimal> validator, Set<DataElement.Flag> flags)
      Creates a new instance with a certain initial value and validator.
      Parameter:
      name - The name of this element
      value - The initial value
      validator - The validator for the value or NULL for none
      flags - The optional flags for this data element
    • BigDecimalDataElement

      protected BigDecimalDataElement()
      Default constructor for serialization.
  • Methodendetails

    • copy

      public BigDecimalDataElement copy(DataElement.CopyMode mode, de.esoco.lib.property.PropertyName<?>... copyProperties)
      Returns a copy of this data element that contains all or a subset of it's current state. Always copied are the name and flags. Never copied is the parent reference because upon copying typically a reference to a copied parent needs to be set. The further data the copy contains depends on the copy mode:

      The copy instance is created by invoking DataElement.newInstance() which has the recommendation to overwrite the return type to the concrete subtype to prevent the need for casting by the invoking code. For the same reason it is recommended that subclasses also override this method with the concrete return type and cast the result of super.copy() to that type.

      Setzt außer Kraft:
      copy in Klasse DataElement<BigDecimal>
      Parameter:
      mode - The copy mode
      copyProperties - An optional list of properties to copy. If not provided all properties will be copied (unless the mode is DataElement.CopyMode.PLACEHOLDER)
      Gibt zurück:
      The copied instance
    • getValue

      public final BigDecimal getValue()
      ---------------------------------------------------------------- /** Returns the value of this element. Each subclass must implement this method separately because some environments (like GWT) require serializable objects to use specific types for serializable fields. Therefore it is not possible to store a generic Object value in the base class.
      Angegeben von:
      getValue in Klasse DataElement<BigDecimal>
      Gibt zurück:
      The element value
    • setStringValue

      public void setStringValue(String value)
      Sets a string value. This method must be overridden by subclasses that want to support the setting of string values in parallel to their native datatype. The default implementation always throws a runtime exception.
      Setzt außer Kraft:
      setStringValue in Klasse DataElement<BigDecimal>
      Parameter:
      value - The new string value
    • newInstance

      protected BigDecimalDataElement newInstance()
      Returns a new instance of the respective data element sub-type on which it is invoked. This is needed for GWT which doesn't support reflection. Used by DataElement.copy(CopyMode, PropertyName...) for cloning an instance. Implementations should overwrite the return type with their concrete type to prevent the need for casting by the invoking code.
      Angegeben von:
      newInstance in Klasse DataElement<BigDecimal>
      Gibt zurück:
      The new instance
    • updateValue

      protected void updateValue(BigDecimal newValue)
      Updates the element value. Will be invoked by DataElement.setValue(Object) to store a new value after validation. If a subclass wants to reject certain values it should do so in the DataElement.isValidValue(Validator, Object) method. Subclasses that are always immutable should implement an assertion because if the element has been initialized correctly (validator = NULL) this method should then be reached.
      Angegeben von:
      updateValue in Klasse DataElement<BigDecimal>
      Parameter:
      newValue - The new value for this element
    • valuesEqual

      protected boolean valuesEqual(BigDecimal a, BigDecimal b)
      Checks two values for equality. The default implementation invokes the method Object.equals(Object) but subclasses can override this for more specific comparisons (e.g. by using Comparable).
      Setzt außer Kraft:
      valuesEqual in Klasse DataElement<BigDecimal>
      Parameter:
      a - The first value to compare (can be be NULL)
      b - The second value to compare (can be be NULL)
      Gibt zurück:
      TRUE if the values are equal