    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *      http://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 *  Unless required by applicable law or agreed to in writing, software
    012 *  distributed under the License is distributed on an "AS IS" BASIS,
    013 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 *  See the License for the specific language governing permissions and
    015 *  limitations under the License.
    016 *
    017 */
    018package org.apache.bcel.classfile;
    019
    020/**
    021 * Interface to make use of the Visitor pattern programming style. I.e. a class
    022 * that implements this interface can traverse the contents of a Java class just
    023 * by calling the `accept' method which all classes have.
    024 *
    025 * @version $Id: Visitor.java 1851984 2019-01-23 21:33:58Z ggregory $
    026 */
    027public interface Visitor
    028{
    029    void visitCode(Code obj);
    030
    031    void visitCodeException(CodeException obj);
    032
    033    void visitConstantClass(ConstantClass obj);
    034
    035    void visitConstantDouble(ConstantDouble obj);
    036
    037    void visitConstantFieldref(ConstantFieldref obj);
    038
    039    void visitConstantFloat(ConstantFloat obj);
    040
    041    void visitConstantInteger(ConstantInteger obj);
    042
    043    void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj);
    044
    045    void visitConstantInvokeDynamic(ConstantInvokeDynamic obj);
    046
    047    void visitConstantLong(ConstantLong obj);
    048
    049    void visitConstantMethodref(ConstantMethodref obj);
    050
    051    void visitConstantNameAndType(ConstantNameAndType obj);
    052
    053    void visitConstantPool(ConstantPool obj);
    054
    055    void visitConstantString(ConstantString obj);
    056
    057    void visitConstantUtf8(ConstantUtf8 obj);
    058
    059    void visitConstantValue(ConstantValue obj);
    060
    061    void visitDeprecated(Deprecated obj);
    062
    063    void visitExceptionTable(ExceptionTable obj);
    064
    065    void visitField(Field obj);
    066
    067    void visitInnerClass(InnerClass obj);
    068
    069    void visitInnerClasses(InnerClasses obj);
    070
    071    void visitJavaClass(JavaClass obj);
    072
    073    void visitLineNumber(LineNumber obj);
    074
    075    void visitLineNumberTable(LineNumberTable obj);
    076
    077    void visitLocalVariable(LocalVariable obj);
    078
    079    void visitLocalVariableTable(LocalVariableTable obj);
    080
    081    void visitMethod(Method obj);
    082
    083    void visitSignature(Signature obj);
    084
    085    void visitSourceFile(SourceFile obj);
    086
    087    void visitSynthetic(Synthetic obj);
    088
    089    void visitUnknown(Unknown obj);
    090
    091    void visitStackMap(StackMap obj);
    092
    093    void visitStackMapEntry(StackMapEntry obj);
    094
    095    /**
    096     * @since 6.0
    097     */
    098    void visitAnnotation(Annotations obj);
    099
    100    /**
    101     * @since 6.0
    102     */
    103    void visitParameterAnnotation(ParameterAnnotations obj);
    104
    105    /**
    106     * @since 6.0
    107     */
    108    void visitAnnotationEntry(AnnotationEntry obj);
    109
    110    /**
    111     * @since 6.0
    112     */
    113    void visitAnnotationDefault(AnnotationDefault obj);
    114
    115    /**
    116     * @since 6.0
    117     */
    118    void visitLocalVariableTypeTable(LocalVariableTypeTable obj);
    119
    120    /**
    121     * @since 6.0
    122     */
    123    void visitEnclosingMethod(EnclosingMethod obj);
    124
    125    /**
    126     * @since 6.0
    127     */
    128    void visitBootstrapMethods(BootstrapMethods obj);
    129
    130    /**
    131     * @since 6.0
    132     */
    133    void visitMethodParameters(MethodParameters obj);
    134
    135    /**
    136     * @since 6.0
    137     */
    138    void visitConstantMethodType(ConstantMethodType obj);
    139
    140    /**
    141     * @since 6.0
    142     */
    143    void visitConstantMethodHandle(ConstantMethodHandle obj);
    144
    145    /**
    146     * @since 6.0
    147     */
    148    void visitParameterAnnotationEntry(ParameterAnnotationEntry obj);
    149
    150    /**
    151     * @since 6.1
    152     */
    153    void visitConstantPackage(ConstantPackage constantPackage);
    154
    155    /**
    156     * @since 6.1
    157     */
    158    void visitConstantModule(ConstantModule constantModule);
    159
    160    /**
    161     * @since 6.3
    162     */
    163    default void visitConstantDynamic(ConstantDynamic constantDynamic) {
    164        // empty
    165    }
    166}