Examples of MethodParameter


Examples of com.lunatech.doclets.jax.jaxrs.model.MethodParameter

    }
    print(type.dimension());
  }

  private void printInput(PojoTypes types) {
    MethodParameter inputParameter = method.getInputParameter();
    if (inputParameter == null)
      return;
    open("dt");
    around("b", "Input:");
    close("dt");
    if (inputParameter.isWrapped()) {
      open("dd");
      String typeName = inputParameter.getWrappedType();
      JaxType returnType = null;
      try {
        returnType = Utils.parseType(typeName, method.getJavaDoc().containingClass(), doclet);
      } catch (InvalidJaxTypeException e) {
        doclet.warn("Invalid @returnWrapped type: " + typeName);
        e.printStackTrace();
      }
      if (returnType != null)
        printOutputType(returnType, types);
      else
        around("tt", escape(typeName));
    } else {
      open("dd");
      Type returnType = inputParameter.getType();
      printOutputType(returnType, types);
    }
    String doc = inputParameter.getDoc();
    if (!Utils.isEmptyOrNull(doc)) {
      print(" - ");
      print(doc);
    }
    close("dd");
View Full Code Here

Examples of jodd.paramo.MethodParameter

    MethodParameter[] methodParameters = Paramo.resolveParameters(method);

    paramNames = new String[methodParameters.length];

    for (int i = 0; i < methodParameters.length; i++) {
      MethodParameter methodParameter = methodParameters[i];

      paramNames[i] = methodParameter.getName();
    }
    return paramNames;
  }
View Full Code Here

Examples of org.exoplatform.services.rest.method.MethodParameter

      boolean form = false;
      for (int i = 0; i < l.size(); i++)
      {
         // Must be only: MatrixParam, QueryParam, PathParam, HeaderParam,
         // FormParam, CookieParam, Context and only one of it at each parameter
         MethodParameter mp = l.get(i);
         if (mp.getAnnotation() == null)
         {
            if (!entity)
            {
               entity = true;
               if (form) // form already met then check type of entity
                  checkFormParam(mp.getParameterClass(), mp.getGenericType());
            }
            else
            {
               String msg =
                  "Wrong or absent annotation at parameter with index " + i + " at "
                     + rmd.getParentResource().getObjectClass() + "#" + rmd.getMethod().getName();
               throw new RuntimeException(msg);
            }

         }
         else
         {
            if (mp.getAnnotation().annotationType() == FormParam.class)
            {
               form = true;
               if (entity) // entity already met then check type of entity
                  checkFormParam(mp.getParameterClass(), mp.getGenericType());
            }
         }
      }
   }
View Full Code Here

Examples of org.moresbycoffee.have.StepCandidate.MethodParameter

        final List<MethodParameter> returnValueParameters = new ArrayList<MethodParameter>();
        if (params != null) {
            for (int i = 0; i < params.length; i++) {
                final Param  param            = params[i];
                if (isReturnValueParameter(param)) {
                    returnValueParameters.add(new MethodParameter(param.getName(), i, param.getType()));
                }
            }
        }
        return returnValueParameters;
               
View Full Code Here

Examples of org.mule.util.generics.MethodParameter

    public static DataType createFromParameterType(Method m, int paramIndex, String mimeType)
    {
        if (Collection.class.isAssignableFrom(m.getParameterTypes()[paramIndex]))
        {
            Class<? extends Collection> cType = (Class<? extends Collection>) m.getParameterTypes()[paramIndex];
            Class itemType = GenericsUtils.getCollectionParameterType(new MethodParameter(m, paramIndex));

            if (itemType != null)
            {
                return new CollectionDataType(cType, itemType, mimeType);
            }
View Full Code Here

Examples of org.springframework.core.MethodParameter

    Map<String, PropertyDescriptor> properties = unsatisfiedNonSimpleProperties(mbd);
    for (Map.Entry<String, PropertyDescriptor> entry : properties.entrySet()) {
      String propertyName = entry.getKey();
      PropertyDescriptor pd = entry.getValue();
      if (Object.class.equals(pd.getPropertyType())) continue;
      MethodParameter methodParam = BeanUtils.getWriteMethodParameter(pd);
      List<String> beanNames = bindRegistry.getBeanNames(methodParam.getParameterType());
      boolean binded = false;
      if (beanNames.size() == 1) {
        mbd.getPropertyValues().add(propertyName, new RuntimeBeanReference(beanNames.get(0)));
        binded = true;
      } else if (beanNames.size() > 1) {
View Full Code Here

Examples of org.springframework.core.MethodParameter

    Context context = Context.getCurrentContext();
    Map<String, Object> data = (Map<String, Object>) context.getParams().get("data");
    Class<?>[] parameterTypes = method.getParameterTypes();
    MethodParameter[] parameters = new MethodParameter[parameterTypes.length];
    for (int i = 0; i < parameterTypes.length; i++) {
      parameters[i] = new MethodParameter(method, i);
      parameters[i].initParameterNameDiscovery(parameterNameDiscoverer);
    }
    Object[] args = new Object[parameters.length];
    for (int i = 0; i < parameters.length; i++) {
      String name = parameters[i].getParameterName();
View Full Code Here

Examples of org.springframework.core.MethodParameter

  }

  @Test
  public void doesNotSupportNonPageable() {

    MethodParameter parameter = TestUtils.getParameterOfMethod(getControllerClass(), "unsupportedMethod", String.class);
    assertThat(getResolver().supportsParameter(parameter), is(false));
  }
View Full Code Here

Examples of org.springframework.core.MethodParameter

  }

  @Test
  public void rejectsInvalidQulifiers() throws Exception {

    MethodParameter parameter = TestUtils.getParameterOfMethod(getControllerClass(), "invalidQualifiers",
        Pageable.class, Pageable.class);

    HandlerMethodArgumentResolver resolver = getResolver();
    assertThat(resolver.supportsParameter(parameter), is(true));
View Full Code Here

Examples of org.springframework.core.MethodParameter

  }

  @Test
  public void rejectsNoQualifiers() throws Exception {

    MethodParameter parameter = TestUtils.getParameterOfMethod(getControllerClass(), "noQualifiers", Pageable.class,
        Pageable.class);

    HandlerMethodArgumentResolver resolver = getResolver();
    assertThat(resolver.supportsParameter(parameter), is(true));
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.