Package rocket.generator.rebind.field

Examples of rocket.generator.rebind.field.NewField


    this.getGeneratorContext().debug("Created field.");

    // add a field to hold the new imageFactory type.
    final NewType beanFactory = this.getBeanFactory();
    final NewField field = beanFactory.newField();
    field.setFinal(false);
    field.setName(Constants.IMAGE_FACTORY_FIELDNAME);
    field.setStatic(false);
    field.setTransient(false);
    field.setType(imageFactory);
    field.setValue(EmptyCodeBlock.INSTANCE);
    field.setVisibility(Visibility.PRIVATE);
  }
View Full Code Here


    constructor.setBody(EmptyCodeBlock.INSTANCE);
    constructor.setVisibility(Visibility.PUBLIC);

    // add a field of type target bean this will be set by the
    // ProxyFactoryBean.createProxy0 method.
    final NewField field = proxy.newField();
    field.setFinal(false);
    field.setName(Constants.PROXY_TARGET_FIELD);
    field.setStatic(false);
    field.setTransient(false);
    field.setType(targetBeanType);
    field.setValue(EmptyCodeBlock.INSTANCE);
    field.setVisibility(Visibility.PUBLIC);

    final List<Aspect> aspects = bean.getAspects();

    final VirtualMethodVisitor visitor = new VirtualMethodVisitor() {
View Full Code Here

   * @param type
   */
  protected void addSingletonField(final NewConcreteType type) {
    Checker.notNull("parameter:type", type);

    final NewField singleton = type.newField();

    final NewInstanceTemplatedFile body = new NewInstanceTemplatedFile();
    final Constructor constructor = type.getConstructor(Collections.<Type>emptyList());
    body.setConstructor(constructor);

    singleton.setValue(body);

    singleton.setFinal(true);
    singleton.setName(SerializationConstants.SINGLETON);
    final Type returnType = type;
    singleton.setType(returnType);
    singleton.setStatic(true);
    singleton.setVisibility(Visibility.PUBLIC);

    this.getGeneratorContext().debug(type.getName());
  }
View Full Code Here

      public InputStream getInputStream() {
        return new StringBufferInputStream("new ${deserializer}();");
      }
    };

    final NewField singleton = deserializer.newField();
    singleton.setFinal(true);
    singleton.setName(Constants.SERIALIZER_SINGLETON);
    singleton.setStatic(true);
    singleton.setTransient(false);
    singleton.setType(deserializer);
    singleton.setValue(value);
    singleton.setVisibility(Visibility.PUBLIC);
  }
View Full Code Here

TOP

Related Classes of rocket.generator.rebind.field.NewField

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.