private void addFieldMetadata(Field field) {
    AnnotationNode ann = new AnnotationNode(nodeCache.FieldMetadata);
    ann.setMember(FieldMetadata.NAME, new ConstantExpression(field.getName()));
    ann.setMember(FieldMetadata.ORDINAL, primitiveConstExpression(field.getOrdinal()));
    ann.setMember(FieldMetadata.LINE, primitiveConstExpression(field.getAst().getLineNumber()));
    ann.setMember(FieldMetadata.INITIALIZER, primitiveConstExpression(field.hasInitialExpression()));
    field.getAst().addAnnotation(ann);
  }
Puts all spec information required at runtime into annotations
attached to class members.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/compiler/SpecAnnotator.java