Package com.opensymphony.xwork2.validator

Examples of com.opensymphony.xwork2.validator.FieldValidator


        List all = ActionValidatorManagerFactory.getInstance().getValidators(actionClass, (String) getParameters().get("actionName"));
        List validators = new ArrayList();
        for (Iterator iterator = all.iterator(); iterator.hasNext();) {
            Validator validator = (Validator) iterator.next();
            if (validator instanceof FieldValidator) {
                FieldValidator fieldValidator = (FieldValidator) validator;
                if (fieldValidator.getFieldName().equals(name)) {
                    validators.add(fieldValidator);
                }
            }
        }
View Full Code Here


        List<Validator> all = actionValidatorManager.getValidators(actionClass, (String) getParameters().get("actionName"));
        List<Validator> validators = new ArrayList<Validator>();
        for (Validator validator : all) {
            if (validator instanceof FieldValidator) {
                FieldValidator fieldValidator = (FieldValidator) validator;
                if (fieldValidator.getFieldName().equals(name)) {
                    validators.add(fieldValidator);
                }
            }
        }
View Full Code Here

        List<Validator> all = actionValidatorManager.getValidators(actionClass, (String) getParameters().get("actionName"));
        List<Validator> validators = new ArrayList<Validator>();
        for (Validator validator : all) {
            if (validator instanceof FieldValidator) {
                FieldValidator fieldValidator = (FieldValidator) validator;
                if (fieldValidator.getFieldName().equals(name)) {
                    validators.add(fieldValidator);
                }
            }
        }
View Full Code Here

    private void findFieldValidators(String name, Class actionClass, String actionName,
            List<Validator> validatorList, List<Validator> retultValidators, String prefix) {

        for (Validator validator : validatorList) {
            if (validator instanceof FieldValidator) {
                FieldValidator fieldValidator = (FieldValidator) validator;

                if (validator instanceof VisitorFieldValidator) {
                    VisitorFieldValidator vfValidator = (VisitorFieldValidator) fieldValidator;
                    Class clazz = getVisitorReturnType(actionClass, vfValidator.getFieldName());
                    if (clazz == null) {
                        continue;
                    }

                    List<Validator> visitorValidators = actionValidatorManager.getValidators(clazz, actionName);
                    String vPrefix = prefix + (vfValidator.isAppendPrefix() ? vfValidator.getFieldName() + "." : "");
                    findFieldValidators(name, clazz, actionName, visitorValidators, retultValidators, vPrefix);
                } else if ((prefix + fieldValidator.getFieldName()).equals(name)) {
                    if (StringUtils.isNotBlank(prefix)) {
                        //fixing field name for js side
                        FieldVisitorValidatorWrapper wrap = new FieldVisitorValidatorWrapper(fieldValidator, prefix);
                        retultValidators.add(wrap);
                    } else {
View Full Code Here

        List<Validator> all = ActionValidatorManagerFactory.getInstance().getValidators(actionClass, (String) getParameters().get("actionName"));
        List<Validator> validators = new ArrayList<Validator>();
        for (Validator validator : all) {
            if (validator instanceof FieldValidator) {
                FieldValidator fieldValidator = (FieldValidator) validator;
                if (fieldValidator.getFieldName().equals(name)) {
                    validators.add(fieldValidator);
                }
            }
        }
View Full Code Here

        List<Validator> all = actionValidatorManager.getValidators(actionClass, (String) getParameters().get("actionName"));
        List<Validator> validators = new ArrayList<Validator>();
        for (Validator validator : all) {
            if (validator instanceof FieldValidator) {
                FieldValidator fieldValidator = (FieldValidator) validator;
                if (fieldValidator.getFieldName().equals(name)) {
                    validators.add(fieldValidator);
                }
            }
        }
View Full Code Here

        List<Validator> all = actionValidatorManager.getValidators(actionClass, (String) getParameters().get("actionName"));
        List<Validator> validators = new ArrayList<Validator>();
        for (Validator validator : all) {
            if (validator instanceof FieldValidator) {
                FieldValidator fieldValidator = (FieldValidator) validator;
                if (fieldValidator.getFieldName().equals(name)) {
                    validators.add(fieldValidator);
                }
            }
        }
View Full Code Here

        List<Validator> all = actionValidatorManager.getValidators(actionClass, (String) getParameters().get("actionName"));
        List<Validator> validators = new ArrayList<Validator>();
        for (Validator validator : all) {
            if (validator instanceof FieldValidator) {
                FieldValidator fieldValidator = (FieldValidator) validator;
                if (fieldValidator.getFieldName().equals(name)) {
                    validators.add(fieldValidator);
                }
            }
        }
View Full Code Here

    private void findFieldValidators(String name, Class actionClass, String actionName,
            List<Validator> validatorList, List<Validator> retultValidators, String prefix) {

        for (Validator validator : validatorList) {
            if (validator instanceof FieldValidator) {
                FieldValidator fieldValidator = (FieldValidator) validator;

                if (validator instanceof VisitorFieldValidator) {
                    VisitorFieldValidator vfValidator = (VisitorFieldValidator) fieldValidator;
                    Class clazz = getVisitorReturnType(actionClass, vfValidator.getFieldName());
                    if (clazz == null) {
                        continue;
                    }

                    List<Validator> visitorValidators = actionValidatorManager.getValidators(clazz, actionName);
                    String vPrefix = prefix + (vfValidator.isAppendPrefix() ? vfValidator.getFieldName() + "." : "");
                    findFieldValidators(name, clazz, actionName, visitorValidators, retultValidators, vPrefix);
                } else if ((prefix + fieldValidator.getFieldName()).equals(name)) {
                    if (StringUtils.isNotBlank(prefix)) {
                        //fixing field name for js side
                        FieldVisitorValidatorWrapper wrap = new FieldVisitorValidatorWrapper(fieldValidator, prefix);
                        retultValidators.add(wrap);
                    } else {
View Full Code Here

        // happen
        // This is a critical exception, so we better throw a
        // ValidationException
        // no need to continue
        logger.error(e);
        throw new ValidationException("Could not open inputstream for "
            + i);
      }
      imageSize = (int) i.length();
    } else {
      // it's .. uhm, something else. A football ? A hot blonde's address
      // ? Fourty Two ? We'll never know ..
      throw new ValidationException(
          "Invalid object. Expect either a String or File object. Object is "
              + image.getClass().getName());
    }
    if (!ii.check()) {
      setMessageKey(getMessageKey() + ".invalid");
View Full Code Here

TOP

Related Classes of com.opensymphony.xwork2.validator.FieldValidator

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.