public class ConstraintField extends Field
Constructor and Description |
---|
ConstraintField(String name,
String scope)
create a new cache field, given a string representation of the scope
|
Modifier and Type | Method and Description |
---|---|
void |
addConstraint(ValueConstraint constraint)
add a constraint for this field
|
boolean |
applyConstraints(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request)
apply the constraints on the value of the field in the given request.
|
boolean |
getCacheOnMatch() |
boolean |
getCacheOnMatchFailure() |
void |
setCacheOnMatch(boolean cacheOnMatch)
set whether to cache should the constraints check pass
|
void |
setCacheOnMatchFailure(boolean cacheOnMatchFailure)
set whether to cache should there be a failure forcing the constraint
|
void |
setValueConstraints(ValueConstraint[] vcs)
add an array of constraints for this field
|
public ConstraintField(String name, String scope) throws IllegalArgumentException
name
- name of this fieldscope
- scope of this fieldIllegalArgumentException
public void setCacheOnMatch(boolean cacheOnMatch)
cacheOnMatch
- should the constraint check pass, should we cache?public boolean getCacheOnMatch()
public void setCacheOnMatchFailure(boolean cacheOnMatchFailure)
cacheOnMatchFailure
- should there be a constraint check failure,
enable cache?public boolean getCacheOnMatchFailure()
public void addConstraint(ValueConstraint constraint)
constraint
- one constraint associated with this fieldpublic void setValueConstraints(ValueConstraint[] vcs)
vcs
- constraints associated with this fieldpublic boolean applyConstraints(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request)
Copyright © 2018. All rights reserved.