Class AdaptiveNumberDatatype
java.lang.Object
io.jmix.core.metamodel.datatype.impl.NumberDatatype
io.jmix.core.metamodel.datatype.impl.AdaptiveNumberDatatype
- All Implemented Interfaces:
Datatype<Number>
,ParameterizedDatatype
A number format that is used when the entity attribute has the
NumberFormat
annotation.-
Field Summary
Fields inherited from class io.jmix.core.metamodel.datatype.impl.NumberDatatype
decimalSeparator, formatPattern, groupingSeparator
-
Constructor Summary
ConstructorDescriptionAdaptiveNumberDatatype
(Class<?> type, NumberFormat numberFormat, FormatStringsRegistry formatStringsRegistry) AdaptiveNumberDatatype
(Class<?> type, String pattern, String decimalSeparator, String groupingSeparator, FormatStringsRegistry formatStringsRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkIntegerRange
(String value, Number result) protected void
checkLongRange
(String value, Number result) protected void
checkRange
(String value, Number number) protected NumberFormat
Creates non-localized format.protected NumberFormat
createLocalizedFormat
(Locale locale) Converts value to String.Converts value to String taking into account local formats.Java class representing this DatatypeParses value from StringParses value from String taking into account local formatsprotected Number
requestedType
(Number number) protected void
setupFormat
(NumberFormat numberFormat) toString()
Methods inherited from class io.jmix.core.metamodel.datatype.impl.NumberDatatype
getParameters, parse
-
Field Details
-
type
-
formatStringsRegistry
-
-
Constructor Details
-
AdaptiveNumberDatatype
public AdaptiveNumberDatatype(Class<?> type, NumberFormat numberFormat, FormatStringsRegistry formatStringsRegistry) -
AdaptiveNumberDatatype
public AdaptiveNumberDatatype(Class<?> type, String pattern, String decimalSeparator, String groupingSeparator, FormatStringsRegistry formatStringsRegistry)
-
-
Method Details
-
createFormat
Description copied from class:NumberDatatype
Creates non-localized format.- Overrides:
createFormat
in classNumberDatatype
-
createLocalizedFormat
-
setupFormat
-
getJavaClass
Description copied from interface:Datatype
Java class representing this Datatype- Specified by:
getJavaClass
in interfaceDatatype<Number>
-
format
Description copied from interface:Datatype
Converts value to String. Returns an empty string for null value. -
format
Description copied from interface:Datatype
Converts value to String taking into account local formats. Returns an empty string for null value. -
parse
Description copied from interface:Datatype
Parses value from String- Specified by:
parse
in interfaceDatatype<Number>
- Throws:
ParseException
-
parse
Description copied from interface:Datatype
Parses value from String taking into account local formats- Specified by:
parse
in interfaceDatatype<Number>
- Throws:
ParseException
-
requestedType
-
checkRange
- Throws:
ParseException
-
checkIntegerRange
- Throws:
ParseException
-
checkLongRange
- Throws:
ParseException
-
toString
-