@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; }
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; }
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; }