1 package org.apache.maven.tools.plugin.extractor.annotations.scanner.visitors;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.HashMap;
23 import java.util.Map;
24
25 import org.codehaus.plexus.logging.Logger;
26 import org.objectweb.asm.AnnotationVisitor;
27 import org.objectweb.asm.Opcodes;
28
29
30
31
32
33 public class MojoAnnotationVisitor
34 extends AnnotationVisitor
35 {
36 private Logger logger;
37
38 private String annotationClassName;
39
40 private Map<String, Object> annotationValues = new HashMap<String, Object>();
41
42 MojoAnnotationVisitor( Logger logger, String annotationClassName )
43 {
44 super( Opcodes.ASM5 );
45 this.logger = logger;
46 this.annotationClassName = annotationClassName;
47 }
48
49 public Map<String, Object> getAnnotationValues()
50 {
51 return annotationValues;
52 }
53
54 public void visit( String name, Object value )
55 {
56 annotationValues.put( name, value );
57 }
58
59 public void visitEnum( String name, String desc, String value )
60 {
61 annotationValues.put( name, value );
62 }
63
64 public AnnotationVisitor visitAnnotation( String name, String desc )
65 {
66 return new MojoAnnotationVisitor( logger, this.annotationClassName );
67 }
68
69 public AnnotationVisitor visitArray( String s )
70 {
71 return new MojoAnnotationVisitor( logger, this.annotationClassName );
72 }
73
74 public void visitEnd()
75 {
76
77 }
78
79 public String getAnnotationClassName()
80 {
81 return annotationClassName;
82 }
83 }