| java.lang.Object org.apache.cocoon.transformation.helpers.FormValidatorHelper
FormValidatorHelper | public class FormValidatorHelper (Code) | | The ValidatorActionResult object helper
author: Christian Haul version: CVS $Id: FormValidatorHelper.java 433543 2006-08-22 06:22:54Z crossley $ |
Method Summary | |
public static Object | getAttribute(Map objectModel, String name) | 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. | public static ValidatorActionResult | getParamResult(Map objectModel, String name) | public ValidatorActionResult | getParamResult(Map objectModel) | public String | getParameterAttribute(String attribute) Get an attribute for the context's current parameter as specified in
descriptor.xml. | public String | getParameterAttribute(String parameter, String attribute) Get an attribute for a parameter as specified in
descriptor.xml. | public 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.
Parameters: descriptor - URL of descriptor.xml file @see org.apache.cocoon.acting.AbstractComplimentaryConfigurableAction Parameters: resolver - Parameters: reloadable - set to true if changes ofdescriptor should trigger a reload. | public static Map | getResults(Map objectModel) | public static boolean | isError(Map objectModel, String name) Test whether the validation returned an error for this
parameter. | public boolean | isError(Map objectModel) Test whether the validation returned an error for the
context's current parameter. | public static boolean | isNoMatch(Map objectModel, String name) Test whether the validated parameter wasn't matched by the requested
regular expression. | public boolean | isNoMatch(Map objectModel) Test whether the context's current parameter wasn't matched by the requested
regular expression. | public static boolean | isNotPresent(Map objectModel, String name) | public boolean | isNotPresent(Map objectModel) | public static boolean | isNull(Map objectModel, String name) Test whether the validated parameter was null but wasn't allowed to. | public boolean | isNull(Map objectModel) Test whether the context's current parameter as validated was null but
wasn't allowed to. | public static boolean | isOK(Map objectModel, String name) Test whether the validation returned no error for this
parameter. | public boolean | isOK(Map objectModel) Test whether the validation returned no error for the
context's current parameter. | public static boolean | isTooLarge(Map objectModel, String name) Test whether the validated parameter was too large. | public boolean | isTooLarge(Map objectModel) Test whether the context's current parameter was too large. | public static boolean | isTooSmall(Map objectModel, String name) Test whether the validated parameter was too small. | public boolean | isTooSmall(Map objectModel) Test whether the context's current parameter was too small. | public void | setConstraintSet(String constraintset) | public void | setParameter(String parameter) |
current_descriptor | String current_descriptor(Code) | | these make it easier for the xsl
|
current_logger | Logger current_logger(Code) | | |
current_reloadable | boolean current_reloadable(Code) | | |
FormValidatorHelper | public FormValidatorHelper(String descriptor, boolean reloadable, Logger logger, SourceResolver resolver)(Code) | | |
getAttribute | public static Object getAttribute(Map objectModel, String name)(Code) | | Get the specified attribute
Parameters: objectModel - The Map objectModel Parameters: name - The parameter name |
getConfiguration | protected static Configuration getConfiguration(String descriptor, SourceResolver resolver, boolean reloadable, Logger logger) throws ConfigurationException(Code) | | Set up the complementary configuration file. Please note that
multiple Actions can share the same configurations. By using
this approach, we can limit the number of config files.
Also note that the configuration file does not have to be a file.
This is based on the similar named functions in
org.apache.cocoon.acting.AbstractComplimentaryConfigurableAction
with the addition of reloadable configuration files, reloadable
flagg, manager, and logger parameter.
Parameters: descriptor - URL of descriptor.xml file @see org.apache.cocoon.acting.AbstractComplimentaryConfigurableAction Parameters: resolver - Parameters: reloadable - set to true if changes ofdescriptor should trigger a reload. Note that thisonly works if Source is able to determine themodification time @see org.apache.cocoon.environment.Source Parameters: logger - used to send debug and error messages to up-to-date configuration, either (re)loaded or cached. |
getConfigurationByName | protected static Configuration getConfigurationByName(Configuration[] conf, String name, Logger logger)(Code) | | Iterate over a set of configurations and return the one whose
name matches the given one.
Parameters: conf - set of configurations Parameters: name - name of configuration Parameters: logger - specified configuration or null if not found. |
getParameterAttribute | public String getParameterAttribute(String attribute)(Code) | | Get an attribute for the context's current parameter as specified in
descriptor.xml.
Parameters: attribute - attribute name attribute value or null |
getParameterAttribute | public String getParameterAttribute(String parameter, String attribute)(Code) | | Get an attribute for a parameter as specified in
descriptor.xml.
Parameters: attribute - attribute name attribute value or null |
getParameterAttributes | public static String getParameterAttributes(String descriptor, SourceResolver resolver, boolean reloadable, String constraintset, String parameter, String attribute, Logger logger)(Code) | | Get an attribute for a parameter as specified in
descriptor.xml.
Parameters: descriptor - URL of descriptor.xml file @see org.apache.cocoon.acting.AbstractComplimentaryConfigurableAction Parameters: resolver - Parameters: reloadable - set to true if changes ofdescriptor should trigger a reload. Note that thisonly works if Source is able to determine themodification time @see org.apache.cocoon.environment.Source Parameters: logger - used to send debug and error messages to Parameters: attribute - attribute name attribute value or null |
isError | public static boolean isError(Map objectModel, String name)(Code) | | Test whether the validation returned an error for this
parameter.
Parameters: objectModel - The Map objectModel Parameters: name - Request parameter's name true if the parameter was either not validated or the validationreturned an error. |
isError | public boolean isError(Map objectModel)(Code) | | Test whether the validation returned an error for the
context's current parameter.
Parameters: objectModel - The Map objectModel true if the parameter was either not validated or the validationreturned an error. |
isNoMatch | public static boolean isNoMatch(Map objectModel, String name)(Code) | | Test whether the validated parameter wasn't matched by the requested
regular expression.
Parameters: objectModel - The Map objectModel Parameters: name - Request parameter's name true if the parameter was validated and the validationreturned an error because its value wasn't matched by the requestedregular expression. |
isNoMatch | public boolean isNoMatch(Map objectModel)(Code) | | Test whether the context's current parameter wasn't matched by the requested
regular expression.
Parameters: objectModel - The Map objectModel true if the parameter was validated and the validationreturned an error because its value wasn't matched by the requestedregular expression. |
isNotPresent | public static boolean isNotPresent(Map objectModel, String name)(Code) | | Test whether the validated parameter wasn't validated
Parameters: objectModel - The Map objectModel Parameters: name - Request parameter's name true if the parameter was not validated. |
isNotPresent | public boolean isNotPresent(Map objectModel)(Code) | | Test whether the context's current parameter wasn't validated
Parameters: objectModel - The Map objectModel true if the parameter was not validated. |
isNull | public static boolean isNull(Map objectModel, String name)(Code) | | Test whether the validated parameter was null but wasn't allowed to.
Parameters: objectModel - The Map objectModel Parameters: name - Request parameter's name true if the parameter was validated and the validationreturned an error because the parameter was null but wasn't allowd to. |
isNull | public boolean isNull(Map objectModel)(Code) | | Test whether the context's current parameter as validated was null but
wasn't allowed to.
Parameters: objectModel - The Map objectModel true if the parameter was validated and the validationreturned an error because the parameter was null but wasn't allowd to. |
isOK | public static boolean isOK(Map objectModel, String name)(Code) | | Test whether the validation returned no error for this
parameter.
Parameters: objectModel - The Map objectModel Parameters: name - Request parameter's name true only if the parameter was validated and the validationdid not return an error. |
isOK | public boolean isOK(Map objectModel)(Code) | | Test whether the validation returned no error for the
context's current parameter.
Parameters: objectModel - The Map objectModel true only if the parameter was validated and the validationdid not return an error. |
isTooLarge | public static boolean isTooLarge(Map objectModel, String name)(Code) | | Test whether the validated parameter was too large.
Parameters: objectModel - The Map objectModel Parameters: name - Request parameter's name true if the parameter was validated and the validationreturned an error because either its value or its length wastoo large. |
isTooLarge | public boolean isTooLarge(Map objectModel)(Code) | | Test whether the context's current parameter was too large.
Parameters: objectModel - The Map objectModel true if the parameter was validated and the validationreturned an error because either its value or its length wastoo large. |
isTooSmall | public static boolean isTooSmall(Map objectModel, String name)(Code) | | Test whether the validated parameter was too small.
Parameters: objectModel - The Map objectModel Parameters: name - Request parameter's name true if the parameter was validated and the validationreturned an error because either its value or its length wastoo small. |
isTooSmall | public boolean isTooSmall(Map objectModel)(Code) | | Test whether the context's current parameter was too small.
Parameters: objectModel - The Map objectModel true if the parameter was validated and the validationreturned an error because either its value or its length wastoo small. |
setConstraintSet | public void setConstraintSet(String constraintset)(Code) | | keep track of current constraint-set context
(probably this is not needed?)
|
setParameter | public void setParameter(String parameter)(Code) | | keep track of current parameter context
|
|
|