Package org.fugerit.java.core.validator
Class BasicValidator
- java.lang.Object
-
- org.fugerit.java.core.cfg.xml.BasicIdConfigType
-
- org.fugerit.java.core.validator.BasicValidator
-
- All Implemented Interfaces:
Serializable
,IdConfigType
,KeyObject<String>
,KeyString
- Direct Known Subclasses:
ValidatorDate
,ValidatorNumber
,ValidatorRegex
,ValidatorWrapper
public class BasicValidator extends BasicIdConfigType
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_KEY_LENGTH_MAX
static String
ERROR_KEY_LENGTH_MIN
static String
ERROR_KEY_REQUIRED
static String
KEY_INFO
static String
KEY_MAXLENGTH
static String
KEY_MINLENGTH
static String
KEY_REQUIRED
static int
NO_LENGTH_CONSTRAINT
-
Constructor Summary
Constructors Constructor Description BasicValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkConfig()
protected String
checkOverride(ValidatorContext context, String def, String key)
void
configure(Properties atts)
void
configure(Element config)
void
configure(Element config, BasicValidator parent)
String
formatMessage(Properties bundle, String key, String... params)
boolean
isOptional()
boolean
validate(ValidatorContext context)
-
Methods inherited from class org.fugerit.java.core.cfg.xml.BasicIdConfigType
getId, getKey, setId, toString
-
-
-
-
Field Detail
-
KEY_REQUIRED
public static final String KEY_REQUIRED
- See Also:
- Constant Field Values
-
KEY_MINLENGTH
public static final String KEY_MINLENGTH
- See Also:
- Constant Field Values
-
KEY_MAXLENGTH
public static final String KEY_MAXLENGTH
- See Also:
- Constant Field Values
-
NO_LENGTH_CONSTRAINT
public static final int NO_LENGTH_CONSTRAINT
- See Also:
- Constant Field Values
-
KEY_INFO
public static final String KEY_INFO
- See Also:
- Constant Field Values
-
ERROR_KEY_REQUIRED
public static final String ERROR_KEY_REQUIRED
- See Also:
- Constant Field Values
-
ERROR_KEY_LENGTH_MIN
public static final String ERROR_KEY_LENGTH_MIN
- See Also:
- Constant Field Values
-
ERROR_KEY_LENGTH_MAX
public static final String ERROR_KEY_LENGTH_MAX
- See Also:
- Constant Field Values
-
-
Method Detail
-
isOptional
public boolean isOptional()
-
configure
public void configure(Element config, BasicValidator parent) throws ConfigException
- Throws:
ConfigException
-
checkConfig
public void checkConfig() throws ConfigException
- Throws:
ConfigException
-
configure
public void configure(Element config) throws ConfigException
- Throws:
ConfigException
-
configure
public void configure(Properties atts) throws ConfigException
- Throws:
ConfigException
-
checkOverride
protected String checkOverride(ValidatorContext context, String def, String key)
-
validate
public boolean validate(ValidatorContext context) throws Exception
- Throws:
Exception
-
formatMessage
public String formatMessage(Properties bundle, String key, String... params)
-
-