Package org.apache.commons.validator

Examples of org.apache.commons.validator.Var


                // Loop through the field's variables.
                Iterator varsIterator = vars.keySet().iterator();
                while (varsIterator.hasNext())
                {
                    String varName = (String)varsIterator.next(); // TODO: escape?
                    Var var = (Var)vars.get(varName);
                    String varValue =
                        Resources.getVarValue(var, app, request, false);
                    String jsType = var.getJsType();

                    // skip requiredif variables field, fieldIndexed, fieldTest, fieldValue
                    if (varName.startsWith("field"))
                    {
                        continue;
View Full Code Here


     * @param required  Whether the variable is mandatory
     * @return The variable's value
     */
    public static String getVarValue(String varName, Field field,
        Validator validator, HttpServletRequest request, boolean required) {
        Var var = field.getVar(varName);

        if (var == null) {
            String msg = sysmsgs.getMessage("variable.missing", varName);

            if (required) {
View Full Code Here

                        Map vars = field.getVars();
                        // Loop through the field's variables.
                        Iterator varsIterator = vars.keySet().iterator();
                        while (varsIterator.hasNext()) {
                            String varName = (String) varsIterator.next();
                            Var var = (Var) vars.get(varName);
                            String varValue = var.getValue();
                            String jsType = var.getJsType();

                            // skip requiredif variables field, fieldIndexed,
                            // fieldTest, fieldValue
                            if (varName.startsWith("field")) {
                                continue;
View Full Code Here

                // Loop through the field's variables.
                Iterator varsIterator = vars.keySet().iterator();

                while (varsIterator.hasNext()) {
                    String varName = (String) varsIterator.next();
                    Var var = (Var) vars.get(varName);
                    String varValue =
                        Resources.getVarValue(var, application, request, false);
                    String jsType = var.getJsType();

                    // skip requiredif variables field, fieldIndexed, fieldTest,
                    // fieldValue
                    if (varName.startsWith("field")) {
                        continue;
View Full Code Here

                Map vars = field.getVars();
                // Loop through the field's variables.
                Iterator varsIterator = vars.keySet().iterator();
                while (varsIterator.hasNext()) {
                    String varName = (String) varsIterator.next();
                    Var var = (Var) vars.get(varName);
                    String varValue = var.getValue();
                    String jsType = var.getJsType();

                    // skip requiredif variables field, fieldIndexed, fieldTest, fieldValue
                    if (varName.startsWith("field")) {
                        continue;
                    }
View Full Code Here

                Map vars = field.getVars();
                // Loop through the field's variables.
                Iterator varsIterator = vars.keySet().iterator();
                while (varsIterator.hasNext()) {
                    String varName = (String) varsIterator.next();
                    Var var = (Var) vars.get(varName);
                    String varValue = var.getValue();
                    String jsType = var.getJsType();

                    // skip requiredif variables field, fieldIndexed, fieldTest, fieldValue
                    if (varName.startsWith("field")) {
                        continue;
                    }
View Full Code Here

                        Map vars = field.getVars();
                        // Loop through the field's variables.
                        Iterator varsIterator = vars.keySet().iterator();
                        while (varsIterator.hasNext()) {
                            String varName = (String) varsIterator.next();
                            Var var = (Var) vars.get(varName);
                            String varValue = var.getValue();
                            String jsType = var.getJsType();

                            // skip requiredif variables field, fieldIndexed, fieldTest, fieldValue
                            if (varName.startsWith("field")) {
                                continue;
                            }
View Full Code Here

                            Map hVars = field.getVars();
                            // Loop through the field's variables.
                            for (Iterator iVars = hVars.keySet().iterator(); iVars.hasNext();) {
                                String varKey = (String) iVars.next();
                                Var var = (Var) hVars.get(varKey);
                                String varValue = var.getValue();
                                String jsType = var.getJsType();

                                if (Var.JSTYPE_INT.equalsIgnoreCase(jsType)) {
                                    results.append(
                                        "this."
                                            + varKey
View Full Code Here

                  
                   Map hVars = field.getVars();
                   // Loop through the field's variables.
                   for (Iterator iVars = hVars.keySet().iterator(); iVars.hasNext(); ) {
                      String varKey = (String)iVars.next();
                      Var var = (Var)hVars.get(varKey);
                      String varValue = var.getValue();
                      String jsType = var.getJsType();
                
                 if (Var.JSTYPE_INT.equalsIgnoreCase(jsType))
                    results.append("this." + varKey + "=" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "; ");
                 else if (Var.JSTYPE_REGEXP.equalsIgnoreCase(jsType))
                    results.append("this." + varKey + "=/" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "/; ");
View Full Code Here

                  
                   Map hVars = field.getVars();
                   // Loop through the field's variables.
                   for (Iterator iVars = hVars.keySet().iterator(); iVars.hasNext(); ) {
                      String varKey = (String)iVars.next();
                      Var var = (Var)hVars.get(varKey);
                      String varValue = var.getValue();
                      String jsType = var.getJsType();
                
                 if (Var.JSTYPE_INT.equalsIgnoreCase(jsType)) {
                    results.append("this." + varKey + "=" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "; ");
                 } else if (Var.JSTYPE_REGEXP.equalsIgnoreCase(jsType)) {
                    results.append("this." + varKey + "=/" + ValidatorUtil.replace(varValue, "\\", "\\\\") + "/; ");
View Full Code Here

TOP

Related Classes of org.apache.commons.validator.Var

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.