public class TypeAnnotationMover extends com.github.javaparser.ast.visitor.VoidVisitorAdapter<Void>
When parsing a method or field such as @Tainted String myField
, JavaParser puts all
annotations on the declaration.
For each non-declaration annotation on a method or field declaration, this class moves it to
the type position. A non-declaration annotation is one with a TYPE_USE
target but no
declaration target.
Constructor and Description |
---|
TypeAnnotationMover(Map<String,TypeElement> allAnnotations,
Elements elements)
Constructs a
TypeAnnotationMover . |
Modifier and Type | Method and Description |
---|---|
void |
visit(com.github.javaparser.ast.body.FieldDeclaration node,
Void p) |
void |
visit(com.github.javaparser.ast.body.MethodDeclaration node,
Void p) |
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
public TypeAnnotationMover(Map<String,TypeElement> allAnnotations, Elements elements)
TypeAnnotationMover
.allAnnotations
- the annotations imported by the file, as a mapping from annotation name
to TypeElement. There should be two entries for each annotation: the annotation's simple
name and its fully-qualified name both mapped to its TypeElement.elements
- the Element utilitiespublic void visit(com.github.javaparser.ast.body.FieldDeclaration node, Void p)