Package rocket.generator.rebind.methodparameter

Examples of rocket.generator.rebind.methodparameter.MethodParameter


  @Override
  protected String getResourceName() {
    String fileName = null;

    while (true) {
      final MethodParameter parameter = this.getParameter();
      final GeneratorContext context = parameter.getGeneratorContext();
      final Type type = parameter.getType();
      if (type.equals(context.getBoolean())) {
        fileName = Constants.BOOLEAN;
        break;
      }
      if (type.equals(context.getByte())) {
View Full Code Here


    this.setter = setter;
  }

  protected Type getFieldType() {
    // the new field value is the 2nd parameter
    final MethodParameter parameter = (MethodParameter) this.getSetter().getParameters().get(1);
    return parameter.getType();
  }
View Full Code Here

    final StringBuilder templateContent = new StringBuilder();
    final Iterator<MethodParameter> iterator = parameters.iterator();
    int i = 0;
    while (iterator.hasNext()) {
      final MethodParameter parameter = iterator.next();

      final String key = "parameter" + i;
      bindings.put(key, parameter);

      templateContent.append("${");
View Full Code Here

    // build up a list of the parameter types for the async method...
    final List<Type> asyncMethodParameters = new ArrayList<Type>();
    final Iterator<MethodParameter> serviceMethodParameters = method.getParameters().iterator();
    while (serviceMethodParameters.hasNext()) {
      final MethodParameter methodParameter = serviceMethodParameters.next();
      asyncMethodParameters.add(methodParameter.getType());
    }
    asyncMethodParameters.add(this.getAsyncCallback());

    // make sure that a method with the same signature actually exists on
    // the async interface...
View Full Code Here

    this.getGeneratorContext().debug("Implementing method that sends method parameters as request parameters, method: " + method);

    final Iterator parameters = method.getParameters().iterator();
    while (parameters.hasNext()) {
      final MethodParameter parameter = (MethodParameter) parameters.next();
      final Type parameterType = parameter.getType();
      if (false == this.isSimpleType(parameterType)) {
        this.throwUnsupportedParameterTypeException(parameter);
      }
    }

    final NewMethod asyncMethod = this.createCorrespondingAsyncServiceInterfaceMethod(method, asyncServiceInterface,
        remoteJsonClient);

    final RequestParametersInvokerTemplatedFile body = new RequestParametersInvokerTemplatedFile();
    body.setHttpRequestParameterNames(this.getHttpRequestParameterNamesFromMethodAnnotation(method));
    body.setInvokerType(this.getInvokerTypeFromMethodAnnotation(method));
    body.setParameters(asyncMethod.getParameters());
    body.setReturnType(method.getReturnType());

    final Iterator newMethodParameters = asyncMethod.getParameters().iterator();
    while (newMethodParameters.hasNext()) {
      final NewMethodParameter parameter = (NewMethodParameter) newMethodParameters.next();
      parameter.setFinal(true);

      if (false == newMethodParameters.hasNext()) {
        parameter.setName(RequestParametersConstants.REQUEST_PARAMETERS_CALLBACK_PARAMETER);
      }
    }

    asyncMethod.setBody(body);
  }
View Full Code Here

            final List<MethodParameter> parameters = method.getParameters();
            if (parameters.size() != 1) {
              break;
            }

            final MethodParameter parameter = (MethodParameter) parameters.get(0);
            final Type propertyType = parameter.getType();
            if (false == value.isCompatibleWith(propertyType)) {
              break;
            }

            value.setPropertyType(propertyType);
View Full Code Here

    body.setTargetMethod(method);

    final Type methodInterceptor = this.getMethodInterceptor();
    final List<Type> methodInvocationParameterList = Arrays.asList(new Type[] { this.getMethodInvocation() });
    final Method invoke = methodInterceptor.getMethod(Constants.METHOD_INTERCEPTOR_INVOKE, methodInvocationParameterList);
    final MethodParameter target = (MethodParameter) invoke.getParameters().get(0);

    body.setTarget(target);
    newMethod.setBody(body);
  }
View Full Code Here

    newMethod.setAbstract(false);
    newMethod.setFinal(true);
    newMethod.setNative(false);

    // add a new constructor...
    final MethodParameter targetBeanParameter = (MethodParameter) newMethod.getParameters().get(0);

    final Type proxy = bean.getProxy();
    final Constructor constructor = proxy.getConstructor(Collections.<Type>emptyList());

    final CreateProxyTemplatedFile body = new CreateProxyTemplatedFile();
View Full Code Here

      public void write(final SourceWriter writer) {
        writer.print("new String[]{");

        final Iterator<MethodParameter> iterator = parameters.iterator();
        while (iterator.hasNext()) {
          final MethodParameter parameter = iterator.next();

          // write a quoted string holding the parameter type
          new StringLiteral(parameter.getType().getRuntimeName()).write(writer);

          if (iterator.hasNext()) {
            writer.print(",");
          }
        }
View Full Code Here

    buf.append(this.getName());
    buf.append('(');

    final Iterator<MethodParameter> parameters = this.getParameters().iterator();
    while (parameters.hasNext()) {
      final MethodParameter parameter = parameters.next();
      final Type parameterType = parameter.getType();
      buf.append(parameterType.getName());

      if (parameters.hasNext()) {
        buf.append(',');
      }
View Full Code Here

TOP

Related Classes of rocket.generator.rebind.methodparameter.MethodParameter

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.