Package org.fugerit.java.core.validator
Class ValidatorCatalog
- java.lang.Object
-
- org.fugerit.java.core.validator.ValidatorCatalog
-
- All Implemented Interfaces:
Serializable
public class ValidatorCatalog extends Object implements Serializable
Validator Catalog is the main configuration item of this simple configuration framework. You can find a sample configuration at : fj-core/src/test/resources/core/validator/validator-catalog-test.xml And sample usage in junit test : fj-core/src/test/java/test/org/fugerit/java/core/validator/TestValidatorCatalog.java- Author:
- Matteo a.k.a. Fugerit
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATT_PARENT
static String
ATT_TYPE
static String
CONF_BUNDLE_PATH
static String
DEFAULT_BUNDLE_PATH
static String
DEFAULT_CUSTOM_MESSAGE_LOCALE
static String
TAG_CUSTOM_MESSAGE
static String
TAG_VALIDATOR
-
Constructor Summary
Constructors Constructor Description ValidatorCatalog()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Element element)
Properties
getBundle(Locale l)
ListMapConfig<BasicValidator>
getValidators()
static ValidatorCatalog
init(String path)
static void
init(String path, ValidatorCatalog catalog)
boolean
validate(String validatorId, ValidatorResult result, Locale l, String fieldId, String value, String label, Properties params)
-
-
-
Field Detail
-
TAG_CUSTOM_MESSAGE
public static final String TAG_CUSTOM_MESSAGE
- See Also:
- Constant Field Values
-
DEFAULT_CUSTOM_MESSAGE_LOCALE
public static final String DEFAULT_CUSTOM_MESSAGE_LOCALE
- See Also:
- Constant Field Values
-
TAG_VALIDATOR
public static final String TAG_VALIDATOR
- See Also:
- Constant Field Values
-
ATT_TYPE
public static final String ATT_TYPE
- See Also:
- Constant Field Values
-
ATT_PARENT
public static final String ATT_PARENT
- See Also:
- Constant Field Values
-
CONF_BUNDLE_PATH
public static final String CONF_BUNDLE_PATH
- See Also:
- Constant Field Values
-
DEFAULT_BUNDLE_PATH
public static final String DEFAULT_BUNDLE_PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getValidators
public ListMapConfig<BasicValidator> getValidators()
-
configure
public void configure(Element element) throws ConfigException
- Throws:
ConfigException
-
getBundle
public Properties getBundle(Locale l)
-
validate
public boolean validate(String validatorId, ValidatorResult result, Locale l, String fieldId, String value, String label, Properties params) throws Exception
- Throws:
Exception
-
init
public static ValidatorCatalog init(String path) throws ConfigException
- Throws:
ConfigException
-
init
public static void init(String path, ValidatorCatalog catalog) throws ConfigException
- Throws:
ConfigException
-
-