private void addFeatureMetadata(FeatureMethod feature) {
    AnnotationNode ann = new AnnotationNode(nodeCache.FeatureMetadata);
    ann.setMember(FeatureMetadata.NAME, new ConstantExpression(feature.getName()));
    ann.setMember(FeatureMetadata.ORDINAL, primitiveConstExpression(feature.getOrdinal()));
    ann.setMember(FeatureMetadata.LINE, primitiveConstExpression(feature.getAst().getLineNumber()));
    ann.setMember(FeatureMetadata.BLOCKS, blockAnnElems = new ListExpression());

    ListExpression paramNames = new ListExpression();
    for (Parameter param : feature.getAst().getParameters()) {
      paramNames.addExpression(new ConstantExpression(param.getName()));
    }
    ann.setMember(FeatureMetadata.PARAMETER_NAMES, paramNames);

    feature.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