Package juzu

Examples of juzu.Param


              String path = (String)annotation.get("value");
              Integer priority = (Integer)annotation.get("priority");
              HashMap<String, ParamDescriptor> parameters = null;
              ExecutableElement exe = metaModel.processingContext.get(method.getMethod());
              for (VariableElement ve : exe.getParameters()) {
                Param param = ve.getAnnotation(Param.class);
                if (param != null) {
                  if (parameters == null) {
                    parameters = new HashMap<String, ParamDescriptor>();
                  }
                  String name = ve.getSimpleName().toString();
                  ParameterMetaModel a = method.parameterBy(name);
                  if (a instanceof PhaseParameterMetaModel) {
                    PhaseParameterMetaModel b = (PhaseParameterMetaModel)a;
                    String pattern = param.pattern().length() == 0 ? null : param.pattern();
                    parameters.put(b.getMappedName(), new ParamDescriptor(pattern,  param.preservePath(),  param.captureGroup()));
                  } else {
                    throw new UnsupportedOperationException("Handle me gracefully");
                  }
                }
              }
View Full Code Here


      String type,
      String valueType) {
    // Not sure we should use @Param for this (i.e for now it looks hackish)
    // however it does make sense later to use the regex part for non router
    // parameters
    Param param = parameterVariableElt.getAnnotation(Param.class);
    String alias = param != null && param.name().length() > 0 ? param.name() : null;
    return new PhaseParameterMetaModel(parameterName, parameterCardinality, type, valueType, alias);
  }
View Full Code Here

TOP

Related Classes of juzu.Param

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.