Examples of PathParameter


Examples of com.ocpsoft.pretty.faces.config.mapping.PathParameter

            if (segmentMatcher.find())
            {
               for (int j = 0; j < segment.numParameters(); j++)
               {
                  String value = segmentMatcher.group(j + 1);
                  PathParameter param = segment.getParameter(j).copy();
                  param.setValue(value);
                  result.add(param);
               }

               int regionEnd = segmentMatcher.end();
View Full Code Here

Examples of com.ocpsoft.pretty.faces.config.mapping.PathParameter

   private void validatePathParams(final FacesContext context, final URL url, final UrlMapping mapping)
   {
      List<PathParameter> params = mapping.getPatternParser().parse(url);

      PathParameter currentParameter = new PathParameter();
      PathValidator currentPathValidator = new PathValidator();
      String currentValidatorId = "";
      try
      {
         for (PathParameter param : params)
         {
            currentParameter = param;

            List<PathValidator> validators = mapping.getValidatorsForPathParam(param);

            if (validators != null && validators.size() > 0)
            {
               String value = param.getValue();
               Object coerced = elUtils.coerceToType(context, param.getExpression().getELExpression(), value);
               for (PathValidator pv : validators)
               {
                  currentPathValidator = pv;
                  for (String id : pv.getValidatorIdList())
                  {
                     currentValidatorId = id;
                     Validator validator = context.getApplication().createValidator(id);
                     validator.validate(context, new NullComponent(), coerced);
                  }
                  if (pv.getValidatorExpression() != null)
                  {
                     elUtils.invokeMethod(context, pv.getValidatorExpression().getELExpression(),
                              new Class<?>[] { FacesContext.class, UIComponent.class, Object.class },
                              new Object[] { context, new NullComponent(), coerced });
                  }
               }
            }
         }
      }
      catch (ELException e)
      {
         FacesMessage message = new FacesMessage("Could not coerce value [" + currentParameter.getValue()
                  + "] on mappingId [" + mapping.getId() + "] to type in location [" + currentParameter.getExpression()
                  + "]");
         handleValidationFailure(context, message, currentPathValidator.getOnError());
      }
      catch (ValidatorException e)
      {
         handleValidationFailure(context, e.getFacesMessage(), currentPathValidator.getOnError());
      }
      catch (FacesException e)
      {
         FacesMessage message = new FacesMessage("Error occurred invoking validator with id [" + currentValidatorId
                  + "] on mappingId [" + mapping.getId() + "] parameter [" + currentParameter.getExpression()
                  + "] at position [" + currentParameter.getPosition() + "]");
         handleValidationFailure(context, message, currentPathValidator.getOnError());
      }
   }
View Full Code Here

Examples of org.apache.mahout.common.parameters.PathParameter

  private Vector weights;
 
  @Override
  public void createParameters(String prefix, JobConf jobConf) {
    parameters = new ArrayList<Parameter<?>>();
    weightsFile = new PathParameter(prefix, "weightsFile", jobConf, null,
        "Path on DFS to a file containing the weights.");
    parameters.add(weightsFile);
    vectorClass = new ClassParameter(prefix, "vectorClass", jobConf, DenseVector.class,
        "Class<Vector> file specified in parameter weightsFile has been serialized with.");
    parameters.add(vectorClass);
View Full Code Here

Examples of org.apache.mahout.common.parameters.PathParameter

  }
 
  @Override
  public void createParameters(String prefix, Configuration jobConf) {
    parameters = new ArrayList<Parameter<?>>();
    inverseCovarianceFile = new PathParameter(prefix, "inverseCovarianceFile", jobConf, null,
                                              "Path on DFS to a file containing the inverse covariance matrix.");
    parameters.add(inverseCovarianceFile);

    ClassParameter matrixClass =
        new ClassParameter(prefix, "maxtrixClass", jobConf, DenseMatrix.class,
                           "Class<Matix> file specified in parameter inverseCovarianceFile has been serialized with.");
    parameters.add(matrixClass);     
   
    meanVectorFile = new PathParameter(prefix, "meanVectorFile", jobConf, null,
                                       "Path on DFS to a file containing the mean Vector.");
    parameters.add(meanVectorFile);
   
    vectorClass = new ClassParameter(prefix, "vectorClass", jobConf, DenseVector.class,
                                     "Class file specified in parameter meanVectorFile has been serialized with.");
View Full Code Here

Examples of org.apache.mahout.common.parameters.PathParameter

  private Vector weights;
 
  @Override
  public void createParameters(String prefix, Configuration jobConf) {
    parameters = new ArrayList<Parameter<?>>();
    weightsFile = new PathParameter(prefix, "weightsFile", jobConf, null,
        "Path on DFS to a file containing the weights.");
    parameters.add(weightsFile);
    vectorClass = new ClassParameter(prefix, "vectorClass", jobConf, DenseVector.class,
        "Class<Vector> file specified in parameter weightsFile has been serialized with.");
    parameters.add(vectorClass);
View Full Code Here

Examples of org.apache.mahout.common.parameters.PathParameter

  }

  @Override
  public void createParameters(String prefix, Configuration jobConf) {
    parameters = Lists.newArrayList();
    inverseCovarianceFile = new PathParameter(prefix, "inverseCovarianceFile", jobConf, null,
            "Path on DFS to a file containing the inverse covariance matrix.");
    parameters.add(inverseCovarianceFile);

    matrixClass = new ClassParameter(prefix, "maxtrixClass", jobConf, DenseMatrix.class,
            "Class<Matix> file specified in parameter inverseCovarianceFile has been serialized with.");
    parameters.add(matrixClass);

    meanVectorFile = new PathParameter(prefix, "meanVectorFile", jobConf, null,
            "Path on DFS to a file containing the mean Vector.");
    parameters.add(meanVectorFile);

    vectorClass = new ClassParameter(prefix, "vectorClass", jobConf, DenseVector.class,
            "Class file specified in parameter meanVectorFile has been serialized with.");
View Full Code Here

Examples of org.apache.mahout.common.parameters.PathParameter

  }

  @Override
  public void createParameters(String prefix, Configuration jobConf) {
    parameters = Lists.newArrayList();
    inverseCovarianceFile = new PathParameter(prefix, "inverseCovarianceFile", jobConf, null,
            "Path on DFS to a file containing the inverse covariance matrix.");
    parameters.add(inverseCovarianceFile);

    matrixClass = new ClassParameter(prefix, "maxtrixClass", jobConf, DenseMatrix.class,
            "Class<Matix> file specified in parameter inverseCovarianceFile has been serialized with.");
    parameters.add(matrixClass);

    meanVectorFile = new PathParameter(prefix, "meanVectorFile", jobConf, null,
            "Path on DFS to a file containing the mean Vector.");
    parameters.add(meanVectorFile);

    vectorClass = new ClassParameter(prefix, "vectorClass", jobConf, DenseVector.class,
            "Class file specified in parameter meanVectorFile has been serialized with.");
View Full Code Here

Examples of org.apache.mahout.common.parameters.PathParameter

  private Vector weights;
 
  @Override
  public void createParameters(String prefix, Configuration jobConf) {
    parameters = Lists.newArrayList();
    weightsFile = new PathParameter(prefix, "weightsFile", jobConf, null,
        "Path on DFS to a file containing the weights.");
    parameters.add(weightsFile);
    vectorClass = new ClassParameter(prefix, "vectorClass", jobConf, DenseVector.class,
        "Class<Vector> file specified in parameter weightsFile has been serialized with.");
    parameters.add(vectorClass);
View Full Code Here

Examples of org.apache.mahout.common.parameters.PathParameter

  private Vector weights;

  @Override
  public void createParameters(String prefix, JobConf jobConf) {
    parameters = new ArrayList<Parameter<?>>();
    weightsFile = new PathParameter(prefix, "weightsFile", jobConf, null, "Path on DFS to a file containing the weights.");
    parameters.add(weightsFile);
    vectorClass = new ClassParameter(prefix, "vectorClass", jobConf, DenseVector.class, "Class<Vector> file specified in parameter weightsFile has been serialized with.");
    parameters.add(vectorClass);
  }
View Full Code Here

Examples of org.apache.mahout.common.parameters.PathParameter

  }
 
  @Override
  public void createParameters(String prefix, Configuration jobConf) {
    parameters = new ArrayList<Parameter<?>>();
    inverseCovarianceFile = new PathParameter(prefix, "inverseCovarianceFile", jobConf, null,
                                              "Path on DFS to a file containing the inverse covariance matrix.");
    parameters.add(inverseCovarianceFile);

    matrixClass =
        new ClassParameter(prefix, "maxtrixClass", jobConf, DenseMatrix.class,
                           "Class<Matix> file specified in parameter inverseCovarianceFile has been serialized with.");
    parameters.add(matrixClass);     
   
    meanVectorFile = new PathParameter(prefix, "meanVectorFile", jobConf, null,
                                       "Path on DFS to a file containing the mean Vector.");
    parameters.add(meanVectorFile);
   
    vectorClass = new ClassParameter(prefix, "vectorClass", jobConf, DenseVector.class,
                                     "Class file specified in parameter meanVectorFile has been serialized with.");
View Full Code Here
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.