Exemplo n.º 1
0
  @Override
  public Void visitField(ClassDefinition classDefinition, FieldDefinition fieldDefinition) {
    // print annotations first
    for (AnnotationDefinition annotationDefinition : fieldDefinition.getAnnotations()) {
      visitAnnotation(fieldDefinition, annotationDefinition);
    }

    // print field declaration
    line()
        .addAll(fieldDefinition.getAccess())
        .add(fieldDefinition.getType().getJavaClassName())
        .add(fieldDefinition.getName())
        .add(";")
        .print();

    printLine();
    return null;
  }
Exemplo n.º 2
0
 public Block putStaticField(ParameterizedType target, FieldDefinition field) {
   checkArgument(field.getAccess().contains(STATIC), "Field is not static: %s", field);
   putStaticField(target, field.getName(), field.getType());
   return this;
 }
Exemplo n.º 3
0
 public Block putField(FieldDefinition field) {
   checkArgument(!field.getAccess().contains(STATIC), "Field is static: %s", field);
   putField(field.getDeclaringClass().getType(), field.getName(), field.getType());
   return this;
 }