rlm@10
|
1 /***
|
rlm@10
|
2 * ASM: a very small and fast Java bytecode manipulation framework
|
rlm@10
|
3 * Copyright (c) 2000-2005 INRIA, France Telecom
|
rlm@10
|
4 * All rights reserved.
|
rlm@10
|
5 *
|
rlm@10
|
6 * Redistribution and use in source and binary forms, with or without
|
rlm@10
|
7 * modification, are permitted provided that the following conditions
|
rlm@10
|
8 * are met:
|
rlm@10
|
9 * 1. Redistributions of source code must retain the above copyright
|
rlm@10
|
10 * notice, this list of conditions and the following disclaimer.
|
rlm@10
|
11 * 2. Redistributions in binary form must reproduce the above copyright
|
rlm@10
|
12 * notice, this list of conditions and the following disclaimer in the
|
rlm@10
|
13 * documentation and/or other materials provided with the distribution.
|
rlm@10
|
14 * 3. Neither the name of the copyright holders nor the names of its
|
rlm@10
|
15 * contributors may be used to endorse or promote products derived from
|
rlm@10
|
16 * this software without specific prior written permission.
|
rlm@10
|
17 *
|
rlm@10
|
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
rlm@10
|
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
rlm@10
|
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
rlm@10
|
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
rlm@10
|
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
rlm@10
|
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
rlm@10
|
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
rlm@10
|
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
rlm@10
|
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
rlm@10
|
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
rlm@10
|
28 * THE POSSIBILITY OF SUCH DAMAGE.
|
rlm@10
|
29 */
|
rlm@10
|
30 package clojure.asm;
|
rlm@10
|
31
|
rlm@10
|
32 /**
|
rlm@10
|
33 * A visitor to visit a Java annotation. The methods of this interface must be
|
rlm@10
|
34 * called in the following order: (<tt>visit<tt> | <tt>visitEnum<tt> |
|
rlm@10
|
35 * <tt>visitAnnotation<tt> | <tt>visitArray<tt>)* <tt>visitEnd<tt>.
|
rlm@10
|
36 *
|
rlm@10
|
37 * @author Eric Bruneton
|
rlm@10
|
38 * @author Eugene Kuleshov
|
rlm@10
|
39 */
|
rlm@10
|
40 public interface AnnotationVisitor{
|
rlm@10
|
41
|
rlm@10
|
42 /**
|
rlm@10
|
43 * Visits a primitive value of the annotation.
|
rlm@10
|
44 *
|
rlm@10
|
45 * @param name the value name.
|
rlm@10
|
46 * @param value the actual value, whose type must be {@link Byte},
|
rlm@10
|
47 * {@link Boolean}, {@link Character}, {@link Short},
|
rlm@10
|
48 * {@link Integer}, {@link Long}, {@link Float}, {@link Double},
|
rlm@10
|
49 * {@link String} or {@link Type}. This value can also be an array
|
rlm@10
|
50 * of byte, boolean, short, char, int, long, float or double values
|
rlm@10
|
51 * (this is equivalent to using {@link #visitArray visitArray} and
|
rlm@10
|
52 * visiting each array element in turn, but is more convenient).
|
rlm@10
|
53 */
|
rlm@10
|
54 void visit(String name, Object value);
|
rlm@10
|
55
|
rlm@10
|
56 /**
|
rlm@10
|
57 * Visits an enumeration value of the annotation.
|
rlm@10
|
58 *
|
rlm@10
|
59 * @param name the value name.
|
rlm@10
|
60 * @param desc the class descriptor of the enumeration class.
|
rlm@10
|
61 * @param value the actual enumeration value.
|
rlm@10
|
62 */
|
rlm@10
|
63 void visitEnum(String name, String desc, String value);
|
rlm@10
|
64
|
rlm@10
|
65 /**
|
rlm@10
|
66 * Visits a nested annotation value of the annotation.
|
rlm@10
|
67 *
|
rlm@10
|
68 * @param name the value name.
|
rlm@10
|
69 * @param desc the class descriptor of the nested annotation class.
|
rlm@10
|
70 * @return a visitor to visit the actual nested annotation value, or
|
rlm@10
|
71 * <tt>null</tt> if this visitor is not interested in visiting
|
rlm@10
|
72 * this nested annotation. <i>The nested annotation value must be
|
rlm@10
|
73 * fully visited before calling other methods on this annotation
|
rlm@10
|
74 * visitor</i>.
|
rlm@10
|
75 */
|
rlm@10
|
76 AnnotationVisitor visitAnnotation(String name, String desc);
|
rlm@10
|
77
|
rlm@10
|
78 /**
|
rlm@10
|
79 * Visits an array value of the annotation. Note that arrays of primitive
|
rlm@10
|
80 * types (such as byte, boolean, short, char, int, long, float or double)
|
rlm@10
|
81 * can be passed as value to {@link #visit visit}. This is what
|
rlm@10
|
82 * {@link ClassReader} does.
|
rlm@10
|
83 *
|
rlm@10
|
84 * @param name the value name.
|
rlm@10
|
85 * @return a visitor to visit the actual array value elements, or
|
rlm@10
|
86 * <tt>null</tt> if this visitor is not interested in visiting
|
rlm@10
|
87 * these values. The 'name' parameters passed to the methods of this
|
rlm@10
|
88 * visitor are ignored. <i>All the array values must be visited
|
rlm@10
|
89 * before calling other methods on this annotation visitor</i>.
|
rlm@10
|
90 */
|
rlm@10
|
91 AnnotationVisitor visitArray(String name);
|
rlm@10
|
92
|
rlm@10
|
93 /**
|
rlm@10
|
94 * Visits the end of the annotation.
|
rlm@10
|
95 */
|
rlm@10
|
96 void visitEnd();
|
rlm@10
|
97 }
|