public class NumericFieldDef extends FieldDef
Modifier and Type | Field and Description |
---|---|
protected DecimalFormat |
patternFormat |
internalId, internalName, log, TIMESTAMP_FORMAT
SERIALIZED_CLASS_NAME, TYPE
XML_SERIALIZED_CLASS_NAME
Constructor and Description |
---|
NumericFieldDef() |
NumericFieldDef(String name,
FieldType type) |
Modifier and Type | Method and Description |
---|---|
NumericFieldDef |
fromRecord(Record source)
Loads this instance's state from a record and returns
this (for fluid API call chaining). |
NumericFieldDef |
fromXmlElement(Element fieldDefElement) |
Number |
getMaximum()
The optional largest number allowed in values of this field.
|
Number |
getMinimum()
The optional smallest number allowed in values of this field.
|
String |
getPattern()
The optional numeric pattern to use when parsing incoming values (from currency, percentage, etc.) during mapping.
|
Integer |
getPrecision()
The optional numeric precision -- currently unused.
|
Integer |
getScale()
The optional numeric scale -- currently unused.
|
protected Object |
mapValueImpl(Object value) |
NumericFieldDef |
setAllowedValues(ValueMatch<?> allowedValues) |
NumericFieldDef |
setDescription(String description) |
NumericFieldDef |
setDisplayName(String displayName) |
NumericFieldDef |
setLimitToAllowedValues(boolean limitToAllowedValues) |
NumericFieldDef |
setMaximum(Number maximum) |
NumericFieldDef |
setMinimum(Number minimum) |
NumericFieldDef |
setName(String name) |
NumericFieldDef |
setPattern(String pattern) |
NumericFieldDef |
setPrecision(Integer precision) |
NumericFieldDef |
setRequired(boolean required) |
NumericFieldDef |
setScale(Integer scale) |
NumericFieldDef |
setType(FieldType type) |
Record |
toRecord() |
Element |
toXmlElement(Document document) |
protected void |
validateValueImpl(Object value,
ValidationResult result) |
assertValid, fromJson, getAllowedValues, getAttributes, getDefaultValueExpression, getDefaultValueExpressionAsString, getDescription, getDisplayName, getDisplayNameOrName, getEntityDef, getExample, getMaximumElements, getMinimumElements, getName, getNameForErrorMessage, getPosition, getSchemaDef, getSchemaDef, getTags, getType, isArray, isLimitToAllowedValues, isRequired, isStrictArrays, mapValue, newInstanceFromRecord, newInstanceFromType, newInstanceFromXml, setArray, setAttributes, setDefaultValueExpression, setEntityDef, setExample, setMaximumElements, setMinimumElements, setPosition, setStrictArrays, setTags, validateAllowedValues, validateField, validateField, validateField, validateField, validateValue, validateValue
addExceptionProperties, assertValid, clone, exception, exception, exception, getInternalId, getInternalName, resetInternalId
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fromArrayValue, fromArrayValue, fromArrayValue, fromJson, newInstanceFromRecord, toArrayValue, toJson, toJson, toJson, toRecord
newInstanceFromJson
fromXml, fromXml, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getChildElement, getChildElements, newInstanceFromXml, newInstanceFromXml, setAttribute, toXml, toXml, toXml, toXml, toXml, writeXml, writeXml
protected DecimalFormat patternFormat
public String getPattern()
public NumericFieldDef setPattern(String pattern)
protected Object mapValueImpl(Object value) throws Throwable
mapValueImpl
in class FieldDef
Throwable
protected void validateValueImpl(Object value, ValidationResult result) throws Throwable
validateValueImpl
in class FieldDef
Throwable
public NumericFieldDef setName(String name)
public NumericFieldDef setDisplayName(String displayName)
setDisplayName
in class FieldDef
public NumericFieldDef setDescription(String description)
setDescription
in class FieldDef
public NumericFieldDef setType(FieldType type)
public NumericFieldDef setRequired(boolean required)
setRequired
in class FieldDef
public NumericFieldDef setAllowedValues(ValueMatch<?> allowedValues)
setAllowedValues
in class FieldDef
public NumericFieldDef setLimitToAllowedValues(boolean limitToAllowedValues)
setLimitToAllowedValues
in class FieldDef
public Integer getPrecision()
public NumericFieldDef setPrecision(Integer precision)
public Integer getScale()
public NumericFieldDef setScale(Integer scale)
public Number getMinimum()
public NumericFieldDef setMinimum(Number minimum)
public Number getMaximum()
public NumericFieldDef setMaximum(Number maximum)
public Record toRecord()
toRecord
in interface RecordSerializable
toRecord
in class FieldDef
public NumericFieldDef fromRecord(Record source)
RecordSerializable
this
(for fluid API call chaining).
For fluid API call chaining, the overridden method should change the declared return type to its class.fromRecord
in interface RecordSerializable
fromRecord
in class FieldDef
public Element toXmlElement(Document document)
toXmlElement
in interface XmlSerializable
toXmlElement
in class FieldDef
public NumericFieldDef fromXmlElement(Element fieldDefElement)
fromXmlElement
in interface XmlSerializable
fromXmlElement
in class FieldDef