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