public class Validator extends Filter
Pattern
Constructor and Description |
---|
Validator()
Constructor.
|
Validator(Context context)
Constructor.
|
Validator(Context context,
Restlet next)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected int |
beforeHandle(Request request,
Response response)
Allows filtering before its handling by the target Restlet.
|
void |
validate(java.lang.String attribute,
boolean required,
java.lang.String format)
Checks the request attributes for presence or format.
|
void |
validateFormat(java.lang.String attribute,
java.lang.String format)
Checks the request attributes for format only.
|
void |
validatePresence(java.lang.String attribute)
Checks the request attributes for presence only.
|
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
public Validator()
public Validator(Context context)
context
- The context.protected int beforeHandle(Request request, Response response)
validate(String, boolean, String)
method.beforeHandle
in class Filter
request
- The request to filter.response
- The response to filter.Filter.CONTINUE
status.public void validate(java.lang.String attribute, boolean required, java.lang.String format)
attribute
- Name of the attribute to look for.required
- Indicates if the attribute presence is required.format
- Format of the attribute value, using Regex pattern syntax.public void validateFormat(java.lang.String attribute, java.lang.String format)
attribute
- Name of the attribute to look for.format
- Format of the attribute value, using Regex pattern syntax.public void validatePresence(java.lang.String attribute)
attribute
- Name of the attribute to look for.Copyright © 2005-2024 Restlet.