Package org.fugerit.java.core.validator
Class ValidatorNumber
- java.lang.Object
-
- org.fugerit.java.core.cfg.xml.BasicIdConfigType
-
- org.fugerit.java.core.validator.BasicValidator
-
- org.fugerit.java.core.validator.ValidatorNumber
-
- All Implemented Interfaces:
Serializable
,IdConfigType
,KeyObject<String>
,KeyString
public class ValidatorNumber extends BasicValidator
Basic number validation implementation.- Since:
- 0.7.4.7
- Author:
- Matteo a.k.a. Fugerit
- See Also:
- ValidatorNumber Docs @ fugerit.org, ValidatorCatalog Docs @ fugerit.org, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_KEY_NUMBER
static String
ERROR_KEY_NUMBER_MAX
static String
ERROR_KEY_NUMBER_MAXFRACTION
static String
ERROR_KEY_NUMBER_MAXINTEGER
static String
ERROR_KEY_NUMBER_MIN
static String
KEY_CURRENCY
static String
KEY_GROUPING_USED
static String
KEY_MAXIMUM_INTEGER_DIGITS
static String
KEY_MAXVALUE
static String
KEY_MINIMUM_FRACTION_DIGITS
static String
KEY_MINVALUE
-
Fields inherited from class org.fugerit.java.core.validator.BasicValidator
ERROR_KEY_LENGTH_MAX, ERROR_KEY_LENGTH_MIN, ERROR_KEY_REQUIRED, KEY_INFO, KEY_MAXLENGTH, KEY_MINLENGTH, KEY_REQUIRED, NO_LENGTH_CONSTRAINT
-
-
Constructor Summary
Constructors Constructor Description ValidatorNumber()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkConfig()
void
configure(Properties atts)
int
getMaximumFractionDigits()
int
getMaximumIntegerDigits()
String
getMaxValue()
String
getMinValue()
boolean
isCurrency()
boolean
isGroupingUsed()
protected NumberFormat
newFormat(ValidatorContext context)
protected Date
setDate(SimpleDateFormat sdf, String d)
boolean
validate(ValidatorContext context)
protected boolean
validate(ValidatorContext context, String minValue, String maxValue)
-
Methods inherited from class org.fugerit.java.core.validator.BasicValidator
checkOverride, configure, configure, formatMessage, isOptional
-
Methods inherited from class org.fugerit.java.core.cfg.xml.BasicIdConfigType
getId, getKey, setId, toString
-
-
-
-
Field Detail
-
KEY_MAXIMUM_INTEGER_DIGITS
public static final String KEY_MAXIMUM_INTEGER_DIGITS
- See Also:
- Constant Field Values
-
KEY_MINIMUM_FRACTION_DIGITS
public static final String KEY_MINIMUM_FRACTION_DIGITS
- See Also:
- Constant Field Values
-
KEY_GROUPING_USED
public static final String KEY_GROUPING_USED
- See Also:
- Constant Field Values
-
KEY_CURRENCY
public static final String KEY_CURRENCY
- See Also:
- Constant Field Values
-
KEY_MINVALUE
public static final String KEY_MINVALUE
- See Also:
- Constant Field Values
-
KEY_MAXVALUE
public static final String KEY_MAXVALUE
- See Also:
- Constant Field Values
-
ERROR_KEY_NUMBER
public static final String ERROR_KEY_NUMBER
- See Also:
- Constant Field Values
-
ERROR_KEY_NUMBER_MIN
public static final String ERROR_KEY_NUMBER_MIN
- See Also:
- Constant Field Values
-
ERROR_KEY_NUMBER_MAX
public static final String ERROR_KEY_NUMBER_MAX
- See Also:
- Constant Field Values
-
ERROR_KEY_NUMBER_MAXINTEGER
public static final String ERROR_KEY_NUMBER_MAXINTEGER
- See Also:
- Constant Field Values
-
ERROR_KEY_NUMBER_MAXFRACTION
public static final String ERROR_KEY_NUMBER_MAXFRACTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMaximumIntegerDigits
public int getMaximumIntegerDigits()
-
getMaximumFractionDigits
public int getMaximumFractionDigits()
-
isGroupingUsed
public boolean isGroupingUsed()
-
isCurrency
public boolean isCurrency()
-
getMinValue
public String getMinValue()
-
getMaxValue
public String getMaxValue()
-
setDate
protected Date setDate(SimpleDateFormat sdf, String d) throws ParseException
- Throws:
ParseException
-
checkConfig
public void checkConfig() throws ConfigException
- Overrides:
checkConfig
in classBasicValidator
- Throws:
ConfigException
-
configure
public void configure(Properties atts) throws ConfigException
- Overrides:
configure
in classBasicValidator
- Throws:
ConfigException
-
validate
public boolean validate(ValidatorContext context) throws Exception
- Overrides:
validate
in classBasicValidator
- Throws:
Exception
-
newFormat
protected NumberFormat newFormat(ValidatorContext context)
-
validate
protected boolean validate(ValidatorContext context, String minValue, String maxValue) throws ConfigException
- Throws:
ConfigException
-
-