1 package org.apache.maven.tools.plugin.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 org.codehaus.plexus.logging.Logger;
23 import org.objectweb.asm.AnnotationVisitor;
24
25 import java.util.HashMap;
26 import java.util.Map;
27
28
29
30
31
32 public class MojoAnnotationVisitor
33 implements AnnotationVisitor
34 {
35 private Logger logger;
36
37 private String annotationClassName;
38
39 private Map<String, Object> annotationValues = new HashMap<String, Object>();
40
41 MojoAnnotationVisitor( Logger logger, String annotationClassName )
42 {
43 this.logger = logger;
44 this.annotationClassName = annotationClassName;
45 }
46
47 public Map<String, Object> getAnnotationValues()
48 {
49 return annotationValues;
50 }
51
52 public void visit( String name, Object value )
53 {
54 annotationValues.put( name, value );
55 logger.debug( "MojoAnnotationVisitor#visit:" + name + ":" + value );
56 }
57
58 public void visitEnum( String name, String desc, String value )
59 {
60 annotationValues.put( name, value );
61 logger.debug( "MojoAnnotationVisitor#visitEnum:" + name + ":" + desc + ":" + value );
62 }
63
64 public AnnotationVisitor visitAnnotation( String name, String desc )
65 {
66 logger.debug( "MojoAnnotationVisitor#visitAnnotation:" + name + ":" + desc );
67 return new MojoAnnotationVisitor( logger, this.annotationClassName );
68 }
69
70 public AnnotationVisitor visitArray( String s )
71 {
72 logger.debug( "MojoAnnotationVisitor#visitArray" );
73 return new MojoAnnotationVisitor( logger, this.annotationClassName );
74 }
75
76 public void visitEnd()
77 {
78
79 }
80
81 public String getAnnotationClassName()
82 {
83 return annotationClassName;
84 }
85 }