    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 that implements this interface can
    022 * traverse the contents of a Java class just by calling the `accept' method which all classes have.
    023 */
    024public interface Visitor {
    025    /**
    026     * @since 6.0
    027     */
    028    void visitAnnotation(Annotations obj);
    029
    030    /**
    031     * @since 6.0
    032     */
    033    void visitAnnotationDefault(AnnotationDefault obj);
    034
    035    /**
    036     * @since 6.0
    037     */
    038    void visitAnnotationEntry(AnnotationEntry obj);
    039
    040    /**
    041     * @since 6.0
    042     */
    043    void visitBootstrapMethods(BootstrapMethods obj);
    044
    045    void visitCode(Code obj);
    046
    047    void visitCodeException(CodeException obj);
    048
    049    void visitConstantClass(ConstantClass obj);
    050
    051    void visitConstantDouble(ConstantDouble obj);
    052
    053    /**
    054     * @since 6.3
    055     */
    056    default void visitConstantDynamic(final ConstantDynamic constantDynamic) {
    057        // empty
    058    }
    059
    060    void visitConstantFieldref(ConstantFieldref obj);
    061
    062    void visitConstantFloat(ConstantFloat obj);
    063
    064    void visitConstantInteger(ConstantInteger obj);
    065
    066    void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj);
    067
    068    void visitConstantInvokeDynamic(ConstantInvokeDynamic obj);
    069
    070    void visitConstantLong(ConstantLong obj);
    071
    072    /**
    073     * @since 6.0
    074     */
    075    void visitConstantMethodHandle(ConstantMethodHandle obj);
    076
    077    void visitConstantMethodref(ConstantMethodref obj);
    078
    079    /**
    080     * @since 6.0
    081     */
    082    void visitConstantMethodType(ConstantMethodType obj);
    083
    084    /**
    085     * @since 6.1
    086     */
    087    void visitConstantModule(ConstantModule constantModule);
    088
    089    void visitConstantNameAndType(ConstantNameAndType obj);
    090
    091    /**
    092     * @since 6.1
    093     */
    094    void visitConstantPackage(ConstantPackage constantPackage);
    095
    096    void visitConstantPool(ConstantPool obj);
    097
    098    void visitConstantString(ConstantString obj);
    099
    100    void visitConstantUtf8(ConstantUtf8 obj);
    101
    102    void visitConstantValue(ConstantValue obj);
    103
    104    void visitDeprecated(Deprecated obj);
    105
    106    /**
    107     * @since 6.0
    108     */
    109    void visitEnclosingMethod(EnclosingMethod obj);
    110
    111    void visitExceptionTable(ExceptionTable obj);
    112
    113    void visitField(Field obj);
    114
    115    void visitInnerClass(InnerClass obj);
    116
    117    void visitInnerClasses(InnerClasses obj);
    118
    119    void visitJavaClass(JavaClass obj);
    120
    121    void visitLineNumber(LineNumber obj);
    122
    123    void visitLineNumberTable(LineNumberTable obj);
    124
    125    void visitLocalVariable(LocalVariable obj);
    126
    127    void visitLocalVariableTable(LocalVariableTable obj);
    128
    129    /**
    130     * @since 6.0
    131     */
    132    void visitLocalVariableTypeTable(LocalVariableTypeTable obj);
    133
    134    void visitMethod(Method obj);
    135
    136    /**
    137     * @since 6.4.0
    138     */
    139    default void visitMethodParameter(final MethodParameter obj) {
    140        // empty
    141    }
    142
    143    /**
    144     * @since 6.0
    145     */
    146    void visitMethodParameters(MethodParameters obj);
    147
    148    /**
    149     * @since 6.4.0
    150     */
    151    default void visitModule(final Module constantModule) {
    152        // empty
    153    }
    154
    155    /**
    156     * @since 6.4.0
    157     */
    158    default void visitModuleExports(final ModuleExports constantModule) {
    159        // empty
    160    }
    161
    162    /**
    163     * @since 6.4.0
    164     */
    165    default void visitModuleMainClass(final ModuleMainClass obj) {
    166        // empty
    167    }
    168
    169    /**
    170     * @since 6.4.0
    171     */
    172    default void visitModuleOpens(final ModuleOpens constantModule) {
    173        // empty
    174    }
    175
    176    /**
    177     * @since 6.4.0
    178     */
    179    default void visitModulePackages(final ModulePackages constantModule) {
    180        // empty
    181    }
    182
    183    /**
    184     * @since 6.4.0
    185     */
    186    default void visitModuleProvides(final ModuleProvides constantModule) {
    187        // empty
    188    }
    189
    190    /**
    191     * @since 6.4.0
    192     */
    193    default void visitModuleRequires(final ModuleRequires constantModule) {
    194        // empty
    195    }
    196
    197    /**
    198     * @since 6.4.0
    199     */
    200    default void visitNestHost(final NestHost obj) {
    201        // empty
    202    }
    203
    204    /**
    205     * @since 6.4.0
    206     */
    207    default void visitNestMembers(final NestMembers obj) {
    208        // empty
    209    }
    210
    211    /**
    212     * @since 6.0
    213     */
    214    void visitParameterAnnotation(ParameterAnnotations obj);
    215
    216    /**
    217     * @since 6.0
    218     */
    219    void visitParameterAnnotationEntry(ParameterAnnotationEntry obj);
    220
    221    void visitSignature(Signature obj);
    222
    223    void visitSourceFile(SourceFile obj);
    224
    225    void visitStackMap(StackMap obj);
    226
    227    void visitStackMapEntry(StackMapEntry obj);
    228
    229    void visitSynthetic(Synthetic obj);
    230
    231    void visitUnknown(Unknown obj);
    232}