Class GomNumber
java.lang.Object
de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomElement
de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomFormElement
de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomTextualFormElement
de.espirit.firstspirit.access.store.templatestore.gom.GomText
de.espirit.firstspirit.access.store.templatestore.gom.GomNumber
- All Implemented Interfaces:
GomCheckable
,GomElement
,GomFormElement
,GomHideable
,GomLangInfoProvider
,GomSearchRelevancy
,GomSingleLineable
,GomTransferHandling
,LineBreakable
,TextGomFormElement
,Serializable
GOM implementation for numbers.
- Since:
- 3.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.espirit.firstspirit.access.store.templatestore.gom.GomCheckable
GomCheckable.Context
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
formatNumber
(String lang, Number number) Format a number to string using the format provided for the given language.getDecimalFormat
(String lang) Get the formatting object for the given language.protected String
Return the default tag for a gom element.Provides language dependent information on this form element, like a label and description for multiple languages.getMax()
Maximum value of the numberMaximum number of characters allowed for inputgetMin()
Minimum value of the numberMode for displaying the form field content@Nullable List<TransferType<?>>
getTransferTypes
(SpecialistsBroker broker) Returns a list of supportedTransferType
's, ornull
if transfer is not supported.@Nullable NumberType
getType()
Number type.boolean
isAboveMaximum
(@NotNull Number number) Tests, whether the given number is above the defined maximum.boolean
isBelowMinimum
(@NotNull Number number) Tests, whether the given number is below the defined minimum.boolean
isInvalidType
(Number number) Tests whether the given type is invalid wrt. the definition.boolean
Checks whether the given number contains a valid value wrt this definition.max()
Get the maximum value as type-correct number.@NotNull Number
min()
Get the minimum value as type-correct number.@Nullable Number
parseNumber
(String lang, String string) Parse a string to a number using the format provided for the given language.void
Sets the maximum value of the numbervoid
Sets the minimum value of the numbervoid
setType
(NumberType type) Sets the number type@NotNull NumberType
type()
Get the type of value, defaulting toNumberType.LONG
.Methods inherited from class de.espirit.firstspirit.access.store.templatestore.gom.GomText
displayMode, editable, getEditable, getSingleLine, setEditable, setPassword, setSingleLine, singleLine
Methods inherited from class de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomTextualFormElement
getLength, length, maxInputLength, setLength, setMaxInputLength
Methods inherited from class de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomFormElement
allowsEmpty, breaks, clone, convertEntities, description, fillsHorizontally, getAllowEmpty, getConvertEntities, getDefaultValue, getHFill, getHidden, getLabel, getName, getNoBreak, getPreset, getSearchRelevancy, getUseLanguages, isHidden, label, name, preset, setAllowEmpty, setConvertEntities, setDefaultValue, setHFill, setHidden, setLabel, setLabelAndDescription, setName, setNoBreak, setPreset, setSearchRelevancy, setUseLanguages, usesLanguages, validate, verify
Methods inherited from class de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomElement
getGomElementTag, getIncludeConfiguration, hasRepresentation, setGomElementTag, setIncludeConfiguration
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.espirit.firstspirit.access.store.templatestore.gom.GomElement
getGomElementTag, getIncludeConfiguration, hasRepresentation, setGomElementTag, setIncludeConfiguration
Methods inherited from interface de.espirit.firstspirit.access.store.templatestore.gom.GomFormElement
allowsEmpty, breaks, convertEntities, fillsHorizontally, getAllowEmpty, getDefaultValue, getHidden, getName, getPreset, name, preset, setAllowEmpty, setDefaultValue, setHidden, setName, setPreset, usesLanguages
Methods inherited from interface de.espirit.firstspirit.access.store.templatestore.gom.GomHideable
isHidden
Methods inherited from interface de.espirit.firstspirit.access.store.templatestore.gom.GomLangInfoProvider
description, label
-
Field Details
-
TAG
The tag of this component- Since:
- 4.0
- See Also:
-
-
Constructor Details
-
GomNumber
public GomNumber()
-
-
Method Details
-
getDefaultTag
Description copied from class:AbstractGomElement
Return the default tag for a gom element.- Overrides:
getDefaultTag
in classGomText
- Returns:
- The elements default tag.
-
getMax
Maximum value of the number- Since:
- 3.0
-
setMax
Sets the maximum value of the number- Since:
- 3.0
-
getMin
Minimum value of the number- Since:
- 3.0
-
setMin
Sets the minimum value of the number- Since:
- 3.0
-
getType
Number type.- Returns:
- Actual number type or
null
. - Since:
- 3.0
- See Also:
-
setType
Sets the number type- Since:
- 3.0
-
getLangInfos
Description copied from class:AbstractGomFormElement
Provides language dependent information on this form element, like a label and description for multiple languages.- Specified by:
getLangInfos
in interfaceGomLangInfoProvider
- Overrides:
getLangInfos
in classAbstractGomFormElement
- Returns:
- A language information container.
-
getPassword
Description copied from class:GomText
Mode for displaying the form field content- Overrides:
getPassword
in classGomText
-
getMaxInputLength
Description copied from class:AbstractGomTextualFormElement
Maximum number of characters allowed for input- Overrides:
getMaxInputLength
in classAbstractGomTextualFormElement
-
getTransferTypes
Description copied from interface:GomTransferHandling
Returns a list of supportedTransferType
's, ornull
if transfer is not supported.- Specified by:
getTransferTypes
in interfaceGomTransferHandling
- Overrides:
getTransferTypes
in classGomText
- Parameters:
broker
- Broker for requesting services or providers.- Returns:
- supported transfer types, or
null
.
-
type
Get the type of value, defaulting toNumberType.LONG
.- Returns:
- The type.
- Since:
- 3.0
-
min
Get the minimum value as type-correct number.- Returns:
- The minimum value.
- Since:
- 3.0
-
max
Get the maximum value as type-correct number.- Returns:
- The maximum value.
- Since:
- 3.0
-
getDecimalFormat
Get the formatting object for the given language.- Parameters:
lang
- The language to look up.- Returns:
- The formatting object for the language or the default one.
- Since:
- 3.0
-
parseNumber
@Nullable public @Nullable Number parseNumber(String lang, String string) throws NumberFormatException Parse a string to a number using the format provided for the given language.- Parameters:
lang
- The language for selecting the format.string
- The string to be parsed.- Returns:
- The parsed number or null, if string is
null
or empty. - Throws:
NumberFormatException
- If the given string is not a number.- Since:
- 3.0
-
formatNumber
Format a number to string using the format provided for the given language.- Parameters:
lang
- The language for selecting the format.number
- The number to be formatted.- Returns:
- The formatted string or an empty string.
- Since:
- 3.0
-
isValid
Checks whether the given number contains a valid value wrt this definition.- Parameters:
number
- The number to check.- Returns:
true
, if the number is valid.- Since:
- 3.0
-
isInvalidType
Tests whether the given type is invalid wrt. the definition.- Parameters:
number
- The number to test (Notnull
!)- Since:
- 3.0
-
isBelowMinimum
Tests, whether the given number is below the defined minimum.- Parameters:
number
- The number to test (Notnull
!)- Returns:
true
, if the given number is less than minimum.- Since:
- 3.0
-
isAboveMaximum
Tests, whether the given number is above the defined maximum.- Parameters:
number
- The number to test (Notnull
!)- Returns:
true
, if the given number is greater than maximum.- Since:
- 3.0
-