|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.transformation.helpers.FormValidatorHelper
public class FormValidatorHelper
The ValidatorActionResult
object helper
Constructor Summary | |
---|---|
FormValidatorHelper(String descriptor,
boolean reloadable,
Logger logger,
SourceResolver resolver)
|
|
FormValidatorHelper(String descriptor,
boolean reloadable,
Logger logger,
SourceResolver resolver,
String constraintset)
|
Method Summary | |
---|---|
static Object |
getAttribute(Map objectModel,
String name)
Get the specified attribute |
protected static Configuration |
getConfiguration(String descriptor,
SourceResolver resolver,
boolean reloadable,
Logger logger)
Set up the complementary configuration file. |
protected static Configuration |
getConfigurationByName(Configuration[] conf,
String name,
Logger logger)
Iterate over a set of configurations and return the one whose name matches the given one. |
String |
getParameterAttribute(String attribute)
Get an attribute for the context's current parameter as specified in descriptor.xml. |
String |
getParameterAttribute(String parameter,
String attribute)
Get an attribute for a parameter as specified in descriptor.xml. |
static String |
getParameterAttributes(String descriptor,
SourceResolver resolver,
boolean reloadable,
String constraintset,
String parameter,
String attribute,
Logger logger)
Get an attribute for a parameter as specified in descriptor.xml. |
ValidatorActionResult |
getParamResult(Map objectModel)
Extracts the validation results from the request attribute for the context's current request parameter |
static ValidatorActionResult |
getParamResult(Map objectModel,
String name)
Extracts the validation results from the request attribute for a specific request parameter |
static Map |
getResults(Map objectModel)
Extracts the validation results from the request attribute |
boolean |
isError(Map objectModel)
Test whether the validation returned an error for the context's current parameter. |
static boolean |
isError(Map objectModel,
String name)
Test whether the validation returned an error for this parameter. |
boolean |
isNoMatch(Map objectModel)
Test whether the context's current parameter wasn't matched by the requested regular expression. |
static boolean |
isNoMatch(Map objectModel,
String name)
Test whether the validated parameter wasn't matched by the requested regular expression. |
boolean |
isNotPresent(Map objectModel)
Test whether the context's current parameter wasn't validated |
static boolean |
isNotPresent(Map objectModel,
String name)
Test whether the validated parameter wasn't validated |
boolean |
isNull(Map objectModel)
Test whether the context's current parameter as validated was null but wasn't allowed to. |
static boolean |
isNull(Map objectModel,
String name)
Test whether the validated parameter was null but wasn't allowed to. |
boolean |
isOK(Map objectModel)
Test whether the validation returned no error for the context's current parameter. |
static boolean |
isOK(Map objectModel,
String name)
Test whether the validation returned no error for this parameter. |
boolean |
isTooLarge(Map objectModel)
Test whether the context's current parameter was too large. |
static boolean |
isTooLarge(Map objectModel,
String name)
Test whether the validated parameter was too large. |
boolean |
isTooSmall(Map objectModel)
Test whether the context's current parameter was too small. |
static boolean |
isTooSmall(Map objectModel,
String name)
Test whether the validated parameter was too small. |
void |
setConstraintSet(String constraintset)
keep track of current constraint-set context (probably this is not needed?) |
void |
setParameter(String parameter)
keep track of current parameter context |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FormValidatorHelper(String descriptor, boolean reloadable, Logger logger, SourceResolver resolver)
public FormValidatorHelper(String descriptor, boolean reloadable, Logger logger, SourceResolver resolver, String constraintset)
Method Detail |
---|
public void setParameter(String parameter)
public void setConstraintSet(String constraintset)
public static Object getAttribute(Map objectModel, String name)
objectModel
- The Map objectModelname
- The parameter namepublic static Map getResults(Map objectModel)
objectModel
- The Map objectModel
ValidatorActionResult
public static ValidatorActionResult getParamResult(Map objectModel, String name)
objectModel
- The Map objectModelname
- Request parameter's nameValidatorActionResult
public ValidatorActionResult getParamResult(Map objectModel)
objectModel
- The Map objectModelValidatorActionResult
public static boolean isOK(Map objectModel, String name)
objectModel
- The Map objectModelname
- Request parameter's name
public boolean isOK(Map objectModel)
objectModel
- The Map objectModel
public static boolean isError(Map objectModel, String name)
objectModel
- The Map objectModelname
- Request parameter's name
public boolean isError(Map objectModel)
objectModel
- The Map objectModel
public static boolean isNull(Map objectModel, String name)
objectModel
- The Map objectModelname
- Request parameter's name
public boolean isNull(Map objectModel)
objectModel
- The Map objectModel
public static boolean isTooSmall(Map objectModel, String name)
objectModel
- The Map objectModelname
- Request parameter's name
public boolean isTooSmall(Map objectModel)
objectModel
- The Map objectModel
public static boolean isTooLarge(Map objectModel, String name)
objectModel
- The Map objectModelname
- Request parameter's name
public boolean isTooLarge(Map objectModel)
objectModel
- The Map objectModel
public static boolean isNoMatch(Map objectModel, String name)
objectModel
- The Map objectModelname
- Request parameter's name
public boolean isNoMatch(Map objectModel)
objectModel
- The Map objectModel
public static boolean isNotPresent(Map objectModel, String name)
objectModel
- The Map objectModelname
- Request parameter's name
public boolean isNotPresent(Map objectModel)
objectModel
- The Map objectModel
protected static Configuration getConfiguration(String descriptor, SourceResolver resolver, boolean reloadable, Logger logger) throws ConfigurationException
descriptor
- URL of descriptor.xml file @see org.apache.cocoon.acting.AbstractComplimentaryConfigurableActionresolver
- reloadable
- set to true
if changes of
descriptor
should trigger a reload. Note that this
only works if Source
is able to determine the
modification time @see org.apache.cocoon.environment.Sourcelogger
- used to send debug and error messages to
ConfigurationException
protected static Configuration getConfigurationByName(Configuration[] conf, String name, Logger logger)
conf
- set of configurationsname
- name of configurationlogger
-
null
if not found.public static String getParameterAttributes(String descriptor, SourceResolver resolver, boolean reloadable, String constraintset, String parameter, String attribute, Logger logger)
descriptor
- URL of descriptor.xml file @see org.apache.cocoon.acting.AbstractComplimentaryConfigurableActionresolver
- reloadable
- set to true
if changes of
descriptor
should trigger a reload. Note that this
only works if Source
is able to determine the
modification time @see org.apache.cocoon.environment.Sourcelogger
- used to send debug and error messages toattribute
- attribute name
null
public String getParameterAttribute(String attribute)
attribute
- attribute name
null
public String getParameterAttribute(String parameter, String attribute)
attribute
- attribute name
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |