Examples of ValidatorBean


Examples of com.sun.faces.config.beans.ValidatorBean

                                       digester.getMatch() +
                                       "} Push " + CLASS_NAME);
        }
        Class clazz =
            digester.getClassLoader().loadClass(CLASS_NAME);
        ValidatorBean vb = (ValidatorBean) clazz.newInstance();
        digester.push(vb);

    }

Examples of com.sun.faces.config.beans.ValidatorBean

     * @exception IllegalStateException if the popped object is not
     *  of the correct type
     */
    public void end(String namespace, String name) throws Exception {

        ValidatorBean top = null;
        try {
            top = (ValidatorBean) digester.pop();
        } catch (Exception e) {
            throw new IllegalStateException("Popped object is not a " +
                                            CLASS_NAME + " instance");
        }
        FacesConfigBean fcb = (FacesConfigBean) digester.peek();
        ValidatorBean old = fcb.getValidator(top.getValidatorId());
        if (old == null) {
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug("[ValidatorRule]{" +
                                           digester.getMatch() +
                                           "} New(" +

Examples of com.sun.faces.config.beans.ValidatorBean

        /*
         * Wrap these in braces to allow repetition of the ivar name
         */
        {
            ValidatorBean validator = new ValidatorBean();
            validator.setValidatorId("javax.faces.DoubleRange");
            validator.setValidatorClass("javax.faces.validator.DoubleRangeValidator");
            validators.add(validator);
        }
        {
            ValidatorBean validator = new ValidatorBean();
            validator.setValidatorId("javax.faces.Length");
            validator.setValidatorClass("javax.faces.validator.LengthValidator");
            validators.add(validator);
        }
        {
            ValidatorBean validator = new ValidatorBean();
            validator.setValidatorId("javax.faces.LongRange");
            validator.setValidatorClass("javax.faces.validator.LongRangeValidator");
            validators.add(validator);
        }

        /*
         * Wrap these in braces to allow repetition of the ivar name

Examples of com.sun.faces.config.beans.ValidatorBean

                                       digester.getMatch() +
                                       "} Push " + CLASS_NAME);
        }
        Class clazz =
            digester.getClassLoader().loadClass(CLASS_NAME);
        ValidatorBean vb = (ValidatorBean) clazz.newInstance();
        digester.push(vb);

    }

Examples of com.sun.faces.config.beans.ValidatorBean

     * @exception IllegalStateException if the popped object is not
     *  of the correct type
     */
    public void end(String namespace, String name) throws Exception {

        ValidatorBean top = null;
        try {
            top = (ValidatorBean) digester.pop();
        } catch (Exception e) {
            throw new IllegalStateException("Popped object is not a " +
                                            CLASS_NAME + " instance");
        }
        FacesConfigBean fcb = (FacesConfigBean) digester.peek();
        ValidatorBean old = fcb.getValidator(top.getValidatorId());
        if (old == null) {
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug("[ValidatorRule]{" +
                                           digester.getMatch() +
                                           "} New(" +

Examples of org.ajax4jsf.builder.config.ValidatorBean

      }
    }
   
    List<ValidatorBean> validators = new ArrayList<ValidatorBean>();
    for (Iterator iter = config.getValidators().iterator(); iter.hasNext();) {
      ValidatorBean validator = (ValidatorBean) iter.next();
      boolean includeValidator = true;
      // Check include patterns
      if (validator.getTag() != null || validator.getTaghandler() != null) {
        includeValidator = isIncludeComponent(validator);
        if (includeValidator) {
          info("Validator "+validator.getName() +" included to taglib "+getShortname());
          validators.add(validator);
        } else {
          info("Validator "+validator.getName() +" excluded from taglib "+getShortname());           
        }
      }
    }
   
    List<ConverterBean> converters = new ArrayList<ConverterBean>();

Examples of org.ajax4jsf.builder.config.ValidatorBean

    VelocityContext context = new VelocityContext();
    Template template = getTemplate();
    context.put("generator",this);
    // Put common properties
    for (Iterator iter = config.getValidators().iterator(); iter.hasNext();) {
      ValidatorBean validator = (ValidatorBean) iter.next();
      info("Create class file "+validator.getClassname());
      if (validator.isGenerate()) {
        context.put("validator", validator);
        context.put("package", validator.getPackageName());
        Set<String> importClasses = new HashSet<String>();
        for (Iterator it = validator.getProperties().iterator(); it
            .hasNext();) {
          PropertyBean property = (PropertyBean) it.next();
          // For non-primitive types, add import declaration.
          if (!property.isSimpleType() && !property.isExist()) {
            importClasses.add(property.getClassname());
          }
        }
        importClasses.add(validator.getSuperclass());
        context.put("imports", importClasses);
        String resultPath = validator.getClassname().replace('.', '/')
            + ".java";
        File javaFile = new File(getDestDir(), resultPath);
        File javaDir = javaFile.getParentFile();
        if (!javaDir.exists()) {
          javaDir.mkdirs();
        }
        try {
          if (javaFile.exists()) {
            javaFile.delete();
          }
          Writer out = new BufferedWriter(new FileWriter(javaFile));
          template.merge(context, out);
          out.flush();
          out.close();
        } catch (Exception e) {
          throw new GeneratorException(
              "Error generating validator: " + validator.getClassname(), e);
        }
      }
    }
   
  }

Examples of org.ajax4jsf.builder.config.ValidatorBean

          }
        }
      }
         List<ValidatorBean> validators = new ArrayList<ValidatorBean>();
         for (Iterator<ValidatorBean> iter = config.getValidators().iterator(); iter.hasNext();) {
            ValidatorBean validator = iter.next();
            boolean includeComponent = true;
            // Check include patterns
            if (validator.getTag() != null && (validator.getTag().getTaglib() == null || validator.getTag().getTaglib().equals(getShortname()))) {
               includeComponent = isIncludeComponent(validator);
               if (includeComponent) {
                  info("Validator "+validator.getName() +" included in taglib "+getShortname());
                  validators.add(validator);
               } else {
                  info("Validator "+validator.getName() +" excluded from taglib "+getShortname());               
               }
            }
         }
         List<ConverterBean> converters = new ArrayList<ConverterBean>();
         for (Iterator<ConverterBean> iter = config.getConverters().iterator(); iter.hasNext();) {

Examples of org.ajax4jsf.builder.config.ValidatorBean

    VelocityContext context = new VelocityContext();
    context.put("generator",this);
    Template template = getTemplate();
    // Put common properties
    for (Iterator iter = config.getValidators().iterator(); iter.hasNext();) {
      ValidatorBean validator = (ValidatorBean) iter.next();
      TagBean tag = validator.getTag();
      if ( null !=  tag && null !=tag.getClassname() && tag.isGenerate()) {
        info("Create tag class file "+validator.getClassname());
        context.put("validator", validator);
       
        context.put("tag", validator.getTag());
        context.put("package", validator.getTag().getPackageName());
        Set<String> importClasses = new HashSet<String>();
        for (Iterator it = validator.getProperties().iterator(); it
            .hasNext();) {
          PropertyBean property = (PropertyBean) it.next();
          // For non-primitive types, add import declaration.
          if (!property.isSimpleType() && !property.isHidden()) {
            importClasses.add(property.getClassname());
          }
        }
        importClasses.add(validator.getTag().getSuperclass());
        context.put("imports", importClasses);
        String resultPath = validator.getTag().getClassname().replace('.', '/')
            + ".java";
        File javaFile = new File(getDestDir(), resultPath);
        File javaDir = javaFile.getParentFile();
        if (!javaDir.exists()) {
          javaDir.mkdirs();
        }
        try {
          if (javaFile.exists()) {
            javaFile.delete();
          }
          Writer out = new BufferedWriter(new FileWriter(javaFile));
          template.merge(context, out);
          out.flush();
          out.close();
        } catch (Exception e) {
          throw new GeneratorException(
              "Error generating JSP Tag Java file for validator " + validator.getName(), e);
        }
      }
    }
  }

Examples of org.apache.shale.clay.config.beans.ValidatorBean

     *
     * @param node markup
     * @param target child config bean
     */
    protected void addValidator(Node node, ElementBean target) {
       ValidatorBean targetValidator = new ValidatorBean();

       String jsfid = getJsfid(node);
       targetValidator.setJsfid(jsfid);

       // resolve inheritance and attribute overrides
       realizeComponent(node, targetValidator);
       //attach to the target element
       target.addValidator(targetValidator);
TOP
Copyright © 2018 www.massapi.com. 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.