Package rocket.generator.rebind.methodparameter

Examples of rocket.generator.rebind.methodparameter.NewMethodParameter


  public static void renameParametersToParameterN(final NewMethod method) {
    Checker.notNull("parameter:method", method);

    final MethodParameterVisitor visitor = new MethodParameterVisitor() {
      protected boolean visit(final MethodParameter parameter) {
        final NewMethodParameter parameter0 = (NewMethodParameter) parameter;
        parameter0.setName("parameter" + counter);
        counter++;
        return false;
      }

      int counter = 0;
View Full Code Here


  static public void makeAllParametersFinal(final NewMethod method) {
    Checker.notNull("parameter:method", method);

    final Iterator<MethodParameter> parameters = method.getParameters().iterator();
    while (parameters.hasNext()) {
      final NewMethodParameter parameter = (NewMethodParameter) parameters.next();
      parameter.setFinal(true);
    }
  }
View Full Code Here

    newMethod.setNative(false);
    newMethod.setReturnType(context.getVoid());
    newMethod.setStatic(false);
    newMethod.setVisibility(Visibility.PUBLIC);

    final NewMethodParameter callback = newMethod.newParameter();
    callback.setFinal(true);
    callback.setName(Constants.ASYNC_CALLBACK_PARAMETER_NAME);
    callback.setType(this.getAsyncCallback());

    context.unbranch();
  }
View Full Code Here

      template.register(name, loggingLevelLogger, logger);
    }

    // rename parameter to a known name which matches the variable named
    // used in templates.
    final NewMethodParameter parameter = (NewMethodParameter) newMethod.getParameters().get(0);
    parameter.setName(Constants.FIND_LOGGER_NAME_PARAMETER);
    parameter.setFinal(true);

    context.unbranch();
  }
View Full Code Here

    createLogger.setLogger(this.getTargetLoggerConstructor(typeName));

    context.debug("Type: " + typeName);

    // rename parameter to a known name.
    final NewMethodParameter parameter = (NewMethodParameter) newMethod.getParameters().get(0);
    parameter.setName(Constants.CREATE_ROOT_NAME_PARAMETER);
    parameter.setFinal(true);

    context.unbranch();
  }
View Full Code Here

    newMethod.setNative(false);
    newMethod.setReturnType(context.getVoid());
    newMethod.setStatic(false);
    newMethod.setVisibility(Visibility.PUBLIC);

    final NewMethodParameter callback = newMethod.newParameter();
    callback.setFinal(true);
    callback.setName(Constants.ASYNC_CALLBACK_PARAMETER_NAME);
    callback.setType(this.getAsyncCallback());

    context.debug(newMethod.toString());
    context.unbranch();
  }
View Full Code Here

TOP

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

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.