Constructs a DecimalField with the specified initial value and context.
Constructs a DecimalField with the specified initial value and context. The scale is taken from the initial value.
The Record that owns this field
The initial value
the scale of the decimal field, since there might be no value
The MathContext that controls precision and rounding
Constructs a DecimalField with the specified initial value.
Constructs a DecimalField with the specified initial value. The context is set to MathContext.UNLIMITED (see note above about default precision). The scale is taken from the initial value.
The Record that owns this field
The initial value
the scale of the decimal field, since there might be no value
The Record that owns this field
The MathContext that controls precision and rounding
Controls the scale of the underlying BigDecimal
ValueType represents the type that users will work with.
ValueType represents the type that users will work with. For OptionalTypedField, this is equal to Option[ThisType].
Default read-only rendering of field
Default read-only rendering of field
Helper for implementing asJValue for a conversion to an encoded JString
Helper for implementing asJValue for a conversion to an encoded JString
function to transform the field value into a String
Encode the field value into a JValue
Encode the field value into a JValue
Returns the field's value as a valid JavaScript expression
Returns the field's value as a valid JavaScript expression
Convert the field to a String.
Convert the field to a String... usually of the form "displayName=value"
Perform an atomic update of this Settable.
Perform an atomic update of this Settable. The current value is passed to the function and the ValueHolder is set to the result of the function. This is enclosed in the performAtomicOperation method which will, by default, synchronize this instance
Can the value of this field be read without obscuring the result?
Can the value of this field be read without obscuring the result?
Can the value of this field be written?
Can the value of this field be written?
If the owner is not in "safe" mode, check the current environment to see if the field can be read
If the owner is not in "safe" mode, check the current environment to see if the field can be read
If the owner is not in "safe" mode, check the current environment to see if the field can be written
If the owner is not in "safe" mode, check the current environment to see if the field can be written
Clear the value of this field
Clear the value of this field
The MathContext that controls precision and rounding
The MathContext that controls precision and rounding
The default value of the field when no value is set.
The default value of the field when no value is set. Must return a Full Box unless optional_? is true
The display name of this field (e.
The display name of this field (e.g., "First Name")
A unique 'id' for the field for form generation
A unique 'id' for the field for form generation
Should the dirty flag always be set when setBox is called
Should the dirty flag always be set when setBox is called
What form elements are we going to add to this field?
What form elements are we going to add to this field?
Form field's type.
Form field's type. Defaults to 'text', but you may want to change it to other HTML5 values.
Generic implementation of setFromAny that implements exactly what the doc for setFromAny specifies, using a Manifest to check types
Generic implementation of setFromAny that implements exactly what the doc for setFromAny specifies, using a Manifest to check types
get the value
get the value
Should the field be ignored by the OR Mapper?
Should the field be ignored by the OR Mapper?
OptionalTypedField and MandatoryTypedField implement this to do the appropriate lifting of Box[MyType] to ValueType
OptionalTypedField and MandatoryTypedField implement this to do the appropriate lifting of Box[MyType] to ValueType
The text name of this field
The text name of this field
The error message used when the field value could not be set
The error message used when the field value could not be set
The error message used when the field value must be set
The error message used when the field value must be set
Is the value of this field optional (e.
Is the value of this field optional (e.g. NULLable)?
Return the owner of this field
Return the owner of this field
Perform an atomic operation on the Settable.
Perform an atomic operation on the Settable. By default synchronizes the instance, but it could use other mechanisms
Is the Field required (and will have a style designating it as such)
Is the Field required (and will have a style designating it as such)
Helper function that does validation of a value by using the validators specified for the field
Helper function that does validation of a value by using the validators specified for the field
Are we in "safe" mode (i.
Are we in "safe" mode (i.e., the value of the field can be read or written without any security checks.)
Controls the scale of the underlying BigDecimal
Controls the scale of the underlying BigDecimal
Set the value of the field to the given value.
Set the value of the field to the given value. Note: Because setting a field can fail (return non-Full), this method will return defaultValueBox if the field could not be set.
A list of functions that transform the value before it is set.
A list of functions that transform the value before it is set. The transformations are also applied before the value is used in a query. Typical applications of this are trimming and/or toLowerCase-ing strings
A list of functions that transform the value before it is set.
A list of functions that transform the value before it is set. The transformations are also applied before the value is used in a query. Typical applications of this are trimming and/or toLowerCase-ing strings
Set the value of the field from anything.
Set the value of the field from anything. Implementations of this method should accept at least the following (pattern => valueBox)
Note that setFromAny should _always_ call setBox, even if the conversion fails. This is so that validation properly notes the error.
The method genericSetFromAny implements this guideline.
Helper for implementing setFromJValue for a conversion from an encoded JString
Helper for implementing setFromJValue for a conversion from an encoded JString
function to try and transform a String into a field value
Decode the JValue and set the field to the decoded value.
Decode the JValue and set the field to the decoded value. Returns Empty or Failure if the value could not be set
Set the value of the field using some kind of type-specific conversion from a String.
Set the value of the field using some kind of type-specific conversion from a String. By convention, if the field is optional_?, then the empty string should be treated as no-value (Empty). Note that setFromString should _always_ call setBox, even if the conversion fails. This is so that validation properly notes the error.
Full(convertedValue) if the conversion succeeds (the field value will be set by side-effect) Empty or Failure if the conversion does not succeed
Augments genericSetFromAny with support for values of type Number (optionally wrapped in any of the usual suspects)
Augments genericSetFromAny with support for values of type Number (optionally wrapped in any of the usual suspects)
Given the current context, should this field be displayed
Given the current context, should this field be displayed
Given the current state of things, should this field be shown
Given the current state of things, should this field be shown
Returns form input of this field
Returns form input of this field
Convert the field value to an XHTML representation
Convert the field value to an XHTML representation
Is this an upload field so that a form that includes this field must be multi-part mime
Is this an upload field so that a form that includes this field must be multi-part mime
Validate this field's setting, returning any errors found
Validate this field's setting, returning any errors found
Get the value.
Get the value. Use get.
(Since version 2.6) Use get
A field that maps to a decimal value. Decimal precision and rounding are controlled via the context parameter. The default value is zero.
Note:
Using MathContext.UNLIMITED, whether explicitly or implicitly, means that no precision or scaling will be used for the SQL field definition; the default scale for DECIMAL is zero per the SQL standard, but the precision for DECIMAL is vendor-specific. For example, PostgreSQL uses maximum precision if it's not specified, but SQL Server uses a default precision of 18.