Enum ValidateType
- java.lang.Object
-
- java.lang.Enum<ValidateType>
-
- net.sf.jkniv.sqlegance.validation.ValidateType
-
- All Implemented Interfaces:
Serializable,Comparable<ValidateType>
public enum ValidateType extends Enum<ValidateType>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidassertValidate(Object params)Use validator (JSR 303) to perform validation against domain model, when some constraint is violatedConstraintExceptionis throwstatic <T> voidassertValidate(Object params, Class<T> validateGroup)Use validator (JSR 303) to perform validation against domain modelstatic voidassertValidate(Object params, ValidateType validateType)Use validator (JSR 303) to perform validation against domain modelstatic ValidateTypeget(String type)abstract Class<?>getValidateGroup()Map<String,String>validate(Object params)Use validator (JSR 303) to perform validation against domain modelstatic <T> Map<String,String>validate(Object params, Class<T> validateGroup)Use validator (JSR 303) to perform validation against domain modelstatic Map<String,String>validate(Object params, ValidateType validateType)Use validator (JSR 303) to perform validation against domain modelstatic ValidateTypevalueOf(String name)Returns the enum constant of this type with the specified name.static ValidateType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final ValidateType NONE
-
ALL
public static final ValidateType ALL
-
GET
public static final ValidateType GET
-
LIST
public static final ValidateType LIST
-
SELECT
public static final ValidateType SELECT
-
SCALAR
public static final ValidateType SCALAR
-
ADD
public static final ValidateType ADD
-
UPDATE
public static final ValidateType UPDATE
-
ENRICH
public static final ValidateType ENRICH
-
REMOVE
public static final ValidateType REMOVE
-
-
Method Detail
-
values
public static ValidateType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ValidateType c : ValidateType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ValidateType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getValidateGroup
public abstract Class<?> getValidateGroup()
-
get
public static ValidateType get(String type)
- Parameters:
type- of validate- Returns:
- enum with valueof
type, ValidateType.NONE if doesn't match
-
assertValidate
public void assertValidate(Object params)
Use validator (JSR 303) to perform validation against domain model, when some constraint is violatedConstraintExceptionis throw- Parameters:
params- the domain model to validate- Throws:
ConstraintException- when some constraint is violated
-
validate
public Map<String,String> validate(Object params)
Use validator (JSR 303) to perform validation against domain model- Parameters:
params- the domain model to validate- Returns:
- the pairs field and constraints violated, an empty Map is return when any constraint is violated
-
assertValidate
public static void assertValidate(Object params, ValidateType validateType)
Use validator (JSR 303) to perform validation against domain model- Parameters:
params- the domain model to validatevalidateType- type of validation- Throws:
ConstraintException- when some constraint is violated
-
assertValidate
public static <T> void assertValidate(Object params, Class<T> validateGroup)
Use validator (JSR 303) to perform validation against domain model- Parameters:
params- the domain model to validatevalidateGroup- type of validation- Throws:
ConstraintException- when some constraint is violated
-
validate
public static Map<String,String> validate(Object params, ValidateType validateType)
Use validator (JSR 303) to perform validation against domain model- Parameters:
params- the domain model to validatevalidateType- type of validation- Returns:
- the pairs field and constraints violated, an empty Map is return when any constraint is violated
-
validate
public static <T> Map<String,String> validate(Object params, Class<T> validateGroup)
Use validator (JSR 303) to perform validation against domain model- Parameters:
params- the domain model to validatevalidateGroup- type of validation- Returns:
- the pairs field and constraints violated, an empty Map is return when any constraint is violated
-
-