|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.vtor.Vtor
public class Vtor
Vtor validator.
| Field Summary | |
|---|---|
static java.lang.String |
ALL_PROFILES
|
static java.lang.String |
DEFAULT_PROFILE
|
protected java.util.HashSet<java.lang.String> |
enabledProfiles
|
protected int |
severity
|
protected boolean |
validateAllProfilesByDefault
|
protected java.util.List<Violation> |
violations
|
| Constructor Summary | |
|---|---|
Vtor()
|
|
| Method Summary | |
|---|---|
void |
addViolation(Violation v)
Adds new violation. |
java.util.List<Violation> |
getViolations()
Returns the list of validation violations or null if validation is successful. |
boolean |
hasViolations()
Returns true if there are validations. |
boolean |
isValidateAllProfilesByDefault()
|
protected boolean |
matchProfiles(java.lang.String[] checkProfiles)
Determine if any of checks profiles is among enabled profiles. |
void |
resetProfiles()
Reset profiles by clearing all enabled profiles and setting to default state. |
void |
resetViolations()
Resets list of all violations. |
void |
setSeverity(int severity)
Set validation severity. |
void |
setValidateAllProfilesByDefault(boolean validateAllProfilesByDefault)
Specifies how to validate when no profiles is specified. |
void |
useProfile(java.lang.String profile)
Enables single profile. |
void |
useProfiles(java.lang.String... enabledProfiles)
Enables list of profiles. |
void |
validate(java.lang.Object target)
Validate object using context from the annotations. |
void |
validate(ValidationContext vctx,
java.lang.Object target)
|
void |
validate(ValidationContext ctx,
java.lang.Object target,
java.lang.String targetName)
Performs validation of provided validation context and appends violations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_PROFILE
public static final java.lang.String ALL_PROFILES
protected java.util.List<Violation> violations
protected int severity
protected java.util.HashSet<java.lang.String> enabledProfiles
protected boolean validateAllProfilesByDefault
| Constructor Detail |
|---|
public Vtor()
| Method Detail |
|---|
public void addViolation(Violation v)
violation. Violations are added during validation.
They can be added after the validation as well, with null check (and constraint).
public void resetViolations()
public void validate(java.lang.Object target)
public void validate(ValidationContext vctx,
java.lang.Object target)
validate(ValidationContext, Object, String)
public void validate(ValidationContext ctx,
java.lang.Object target,
java.lang.String targetName)
public void setSeverity(int severity)
public boolean isValidateAllProfilesByDefault()
public void setValidateAllProfilesByDefault(boolean validateAllProfilesByDefault)
true, then all profiles will be validated;
otherwise, only default profiles will be validated.
public void useProfile(java.lang.String profile)
public void useProfiles(java.lang.String... enabledProfiles)
public void resetProfiles()
setValidateAllProfilesByDefault(boolean)protected boolean matchProfiles(java.lang.String[] checkProfiles)
public java.util.List<Violation> getViolations()
null if validation is successful.
public boolean hasViolations()
true if there are validations.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||