use of scenelib.annotations.Annotation in project checker-framework by typetools.
the class ToIndexFileConverter method visitType.
/**
* Copies information from an AST type node to an {@link ATypeElement}.
*/
private Void visitType(Type type, final ATypeElement elem) {
List<AnnotationExpr> exprs = type.getAnnotations();
if (exprs != null) {
for (AnnotationExpr expr : exprs) {
Annotation anno = extractAnnotation(expr);
if (anno != null) {
elem.tlAnnotationsHere.add(anno);
}
}
}
visitInnerTypes(type, elem);
return null;
}
use of scenelib.annotations.Annotation in project checker-framework by typetools.
the class ToIndexFileConverter method visitDecl.
/**
* Copies information from an AST declaration node to an {@link ADeclaration}. Called by
* visitors for BodyDeclaration subclasses.
*/
private Void visitDecl(BodyDeclaration<?> decl, ADeclaration elem) {
NodeList<AnnotationExpr> annoExprs = decl.getAnnotations();
if (annoExprs != null) {
for (AnnotationExpr annoExpr : annoExprs) {
Annotation anno = extractAnnotation(annoExpr);
elem.tlAnnotationsHere.add(anno);
}
}
return null;
}
use of scenelib.annotations.Annotation in project checker-framework by typetools.
the class ToIndexFileConverter method visit.
@Override
public Void visit(ConstructorDeclaration decl, AElement elem) {
List<Parameter> params = decl.getParameters();
List<AnnotationExpr> rcvrAnnos = decl.getAnnotations();
BlockStmt body = decl.getBody();
StringBuilder sb = new StringBuilder("<init>(");
AClass clazz = (AClass) elem;
AMethod method;
// an empty list.
if (params != null) {
for (Parameter param : params) {
Type ptype = param.getType();
sb.append(getJVML(ptype));
}
}
sb.append(")V");
method = clazz.methods.vivify(sb.toString());
visitDecl(decl, method);
if (params != null) {
for (int i = 0; i < params.size(); i++) {
Parameter param = params.get(i);
AField field = method.parameters.vivify(i);
visitType(param.getType(), field.type);
}
}
if (rcvrAnnos != null) {
for (AnnotationExpr expr : rcvrAnnos) {
Annotation anno = extractAnnotation(expr);
method.receiver.tlAnnotationsHere.add(anno);
}
}
return body == null ? null : body.accept(this, method);
// return super.visit(decl, elem);
}
Aggregations