Package rocket.generator.rebind.method

Examples of rocket.generator.rebind.method.Method


    final GeneratorContext context = this.getGeneratorContext();
    context.branch();
    context.info("Overriding " + Constants.CREATE_ROOT_LOGGER_METHOD);

    final List createDefaultLoggerMethodArguments = Collections.nCopies(1, context.getString());
    final Method method = loggerFactory.findMostDerivedMethod(Constants.CREATE_ROOT_LOGGER_METHOD,
        createDefaultLoggerMethodArguments);

    final NewMethod newMethod = method.copy(loggerFactory);
    newMethod.setAbstract(false);
    newMethod.setFinal(true);
    newMethod.setNative(false);

    final String category = LoggingConstants.ROOT_LOGGER_NAME;
View Full Code Here


      final Type serializer = this.getSerializer(field);
      template.setSerializer(serializer);

      final String readMethodName = this.selectReadMethod(fieldType);
      final Method readMethod = serializer.getMostDerivedMethod(readMethodName, Collections.nCopies(1, this.getJsonValue()));
      template.setReadMethod(readMethod);

      body.add(template);
    }
View Full Code Here

    final GeneratorContext context = this.getGeneratorContext();
    context.debug("override " + Constants.READ_COMPLEX_METHOD_NAME + "() for type \"" + type.getName() + "\".");

    final Type jsonSerializer = this.getJsonSerializer();

    final Method readObject = jsonSerializer.getMethod(Constants.READ_COMPLEX_METHOD_NAME, Arrays.asList(new Type[] { this
        .getJsonValue() }));
    final NewMethod newReadObject = readObject.copy(deserializer);
    newReadObject.setAbstract(false);
    newReadObject.setFinal(false);
    newReadObject.setNative(false);

    final NewMethodParameter jsonValue = (NewMethodParameter) newReadObject.getParameters().get(0);
View Full Code Here

    final GeneratorContext context = this.getGeneratorContext();
    context.debug("Override " + Constants.WRITE_JSON_METHOD_NAME + "() for type \"" + type.getName() + "\".");

    final Type jsonSerializer = this.getJsonSerializer();

    final Method writeJson = jsonSerializer.getMethod(Constants.WRITE_JSON_METHOD_NAME, Collections.nCopies(1, context.getObject()));
    final NewMethod newWriteJson = writeJson.copy(deserializer);
    newWriteJson.setAbstract(false);
    newWriteJson.setFinal(false);
    newWriteJson.setNative(false);

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

    final TreeSet<Method> sortedMethods = new TreeSet<Method>(MethodComparator.INSTANCE);
    sortedMethods.addAll(methods);
    final Iterator<Method> iterator = sortedMethods.iterator();
    while (iterator.hasNext()) {
      final Method method = (Method) iterator.next();
      final String prefetch = this.implementMethod(newType, method);
      if (prefetch != null) {
        urls.add(prefetch);
      }
    }
View Full Code Here

    final GeneratorContext context = this.getGeneratorContext();
    final String methodName = ImageFactoryConstants.GET_PRELOAD_URLS;
    context.branch();
    context.info("Overriding " + methodName + " to preload.");

    final Method method = newType.findMostDerivedMethod(methodName, Collections.<Type>emptyList());
    final NewMethod newMethod = method.copy(newType);
    newMethod.setAbstract(false);
    newMethod.setFinal(true);

    final CodeBlock commaSeparatedList = new CodeBlock() {
      public boolean isEmpty() {
View Full Code Here

   * @param serviceInterface
   *            The service interface recently created to trigger GWT to
   *            create a deserializer.
   */
  protected void implementCreateGwtRpcProxy(final NewConcreteType newType, final Type serviceInterface) {
    final Method method = newType.getMostDerivedMethod(Constants.CREATE_GWT_RPC_PROXY_METHOD, Collections.<Type>emptyList());
    final NewMethod newMethod = method.copy(newType);
    newMethod.setAbstract(false);
    newMethod.setFinal(true);

    final GwtCreateTemplatedFile template = new GwtCreateTemplatedFile();
    template.setType(serviceInterface);
View Full Code Here

    while (methodParameters.hasNext()) {
      final MethodParameter parameter = methodParameters.next();
      parameterTypes.add(parameter.getType());
    }

    final Method serviceMethod = serviceInterface.findMethod(method.getName(), parameterTypes);
    final List<Method> serviceMethods = new ArrayList<Method>();
    serviceMethods.addAll(serviceInterface.getMethods());
    final int methodNumber = serviceMethods.indexOf(serviceMethod);
    final String newNestedName = Constants.NESTED_SERIALIZATION_FACTORY_COMPOSER + methodNumber;
View Full Code Here

   * @param serviceInterface
   *            The service interface recently created to trigger GWT to
   *            create a deserializer.
   */
  protected void implementCreateGwtRpcProxy(final NewConcreteType newType, final Type serviceInterface) {
    final Method method = newType.getMostDerivedMethod(Constants.CREATE_GWT_RPC_PROXY_METHOD, Collections.<Type>emptyList());
    final NewMethod newMethod = method.copy(newType);
    newMethod.setAbstract(false);
    newMethod.setFinal(true);

    final GwtCreateTemplatedFile template = new GwtCreateTemplatedFile();
    template.setType(serviceInterface);
View Full Code Here

TOP

Related Classes of rocket.generator.rebind.method.Method

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.