rlm@10: /*** rlm@10: * ASM: a very small and fast Java bytecode manipulation framework rlm@10: * Copyright (c) 2000-2005 INRIA, France Telecom rlm@10: * All rights reserved. rlm@10: * rlm@10: * Redistribution and use in source and binary forms, with or without rlm@10: * modification, are permitted provided that the following conditions rlm@10: * are met: rlm@10: * 1. Redistributions of source code must retain the above copyright rlm@10: * notice, this list of conditions and the following disclaimer. rlm@10: * 2. Redistributions in binary form must reproduce the above copyright rlm@10: * notice, this list of conditions and the following disclaimer in the rlm@10: * documentation and/or other materials provided with the distribution. rlm@10: * 3. Neither the name of the copyright holders nor the names of its rlm@10: * contributors may be used to endorse or promote products derived from rlm@10: * this software without specific prior written permission. rlm@10: * rlm@10: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" rlm@10: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE rlm@10: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE rlm@10: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE rlm@10: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR rlm@10: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF rlm@10: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS rlm@10: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN rlm@10: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) rlm@10: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF rlm@10: * THE POSSIBILITY OF SUCH DAMAGE. rlm@10: */ rlm@10: package clojure.asm; rlm@10: rlm@10: /** rlm@10: * A visitor to visit a Java annotation. The methods of this interface must be rlm@10: * called in the following order: (visit | visitEnum | rlm@10: * visitAnnotation | visitArray)* visitEnd. rlm@10: * rlm@10: * @author Eric Bruneton rlm@10: * @author Eugene Kuleshov rlm@10: */ rlm@10: public interface AnnotationVisitor{ rlm@10: rlm@10: /** rlm@10: * Visits a primitive value of the annotation. rlm@10: * rlm@10: * @param name the value name. rlm@10: * @param value the actual value, whose type must be {@link Byte}, rlm@10: * {@link Boolean}, {@link Character}, {@link Short}, rlm@10: * {@link Integer}, {@link Long}, {@link Float}, {@link Double}, rlm@10: * {@link String} or {@link Type}. This value can also be an array rlm@10: * of byte, boolean, short, char, int, long, float or double values rlm@10: * (this is equivalent to using {@link #visitArray visitArray} and rlm@10: * visiting each array element in turn, but is more convenient). rlm@10: */ rlm@10: void visit(String name, Object value); rlm@10: rlm@10: /** rlm@10: * Visits an enumeration value of the annotation. rlm@10: * rlm@10: * @param name the value name. rlm@10: * @param desc the class descriptor of the enumeration class. rlm@10: * @param value the actual enumeration value. rlm@10: */ rlm@10: void visitEnum(String name, String desc, String value); rlm@10: rlm@10: /** rlm@10: * Visits a nested annotation value of the annotation. rlm@10: * rlm@10: * @param name the value name. rlm@10: * @param desc the class descriptor of the nested annotation class. rlm@10: * @return a visitor to visit the actual nested annotation value, or rlm@10: * null if this visitor is not interested in visiting rlm@10: * this nested annotation. The nested annotation value must be rlm@10: * fully visited before calling other methods on this annotation rlm@10: * visitor. rlm@10: */ rlm@10: AnnotationVisitor visitAnnotation(String name, String desc); rlm@10: rlm@10: /** rlm@10: * Visits an array value of the annotation. Note that arrays of primitive rlm@10: * types (such as byte, boolean, short, char, int, long, float or double) rlm@10: * can be passed as value to {@link #visit visit}. This is what rlm@10: * {@link ClassReader} does. rlm@10: * rlm@10: * @param name the value name. rlm@10: * @return a visitor to visit the actual array value elements, or rlm@10: * null if this visitor is not interested in visiting rlm@10: * these values. The 'name' parameters passed to the methods of this rlm@10: * visitor are ignored. All the array values must be visited rlm@10: * before calling other methods on this annotation visitor. rlm@10: */ rlm@10: AnnotationVisitor visitArray(String name); rlm@10: rlm@10: /** rlm@10: * Visits the end of the annotation. rlm@10: */ rlm@10: void visitEnd(); rlm@10: }