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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull StringformatNumber(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 StringReturn 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, ornullif transfer is not supported.@Nullable NumberTypegetType()Number type.booleanisAboveMaximum(@NotNull Number number) Tests, whether the given number is above the defined maximum.booleanisBelowMinimum(@NotNull Number number) Tests, whether the given number is below the defined minimum.booleanisInvalidType(Number number) Tests whether the given type is invalid wrt. the definition.booleanChecks whether the given number contains a valid value wrt this definition.max()Get the maximum value as type-correct number.@NotNull Numbermin()Get the minimum value as type-correct number.@Nullable NumberparseNumber(String lang, String string) Parse a string to a number using the format provided for the given language.voidSets the maximum value of the numbervoidSets the minimum value of the numbervoidsetType(NumberType type) Sets the number type@NotNull NumberTypetype()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, singleLineMethods inherited from class de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomTextualFormElement
getLength, length, maxInputLength, setLength, setMaxInputLengthMethods 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, verifyMethods inherited from class de.espirit.firstspirit.access.store.templatestore.gom.AbstractGomElement
getGomElementTag, getIncludeConfiguration, hasRepresentation, setGomElementTag, setIncludeConfigurationMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.espirit.firstspirit.access.store.templatestore.gom.GomElement
getGomElementTag, getIncludeConfiguration, hasRepresentation, setGomElementTag, setIncludeConfigurationMethods 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, usesLanguagesMethods inherited from interface de.espirit.firstspirit.access.store.templatestore.gom.GomHideable
isHiddenMethods 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:AbstractGomElementReturn the default tag for a gom element.- Overrides:
getDefaultTagin 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:AbstractGomFormElementProvides language dependent information on this form element, like a label and description for multiple languages.- Specified by:
getLangInfosin interfaceGomLangInfoProvider- Overrides:
getLangInfosin classAbstractGomFormElement- Returns:
- A language information container.
-
getPassword
Description copied from class:GomTextMode for displaying the form field content- Overrides:
getPasswordin classGomText
-
getMaxInputLength
Description copied from class:AbstractGomTextualFormElementMaximum number of characters allowed for input- Overrides:
getMaxInputLengthin classAbstractGomTextualFormElement
-
getTransferTypes
Description copied from interface:GomTransferHandlingReturns a list of supportedTransferType's, ornullif transfer is not supported.- Specified by:
getTransferTypesin interfaceGomTransferHandling- Overrides:
getTransferTypesin 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
nullor 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
-