001: /*
002: * Copyright (c) 2001-2007, Jean Tessier
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions
007: * are met:
008: *
009: * * Redistributions of source code must retain the above copyright
010: * notice, this list of conditions and the following disclaimer.
011: *
012: * * Redistributions in binary form must reproduce the above copyright
013: * notice, this list of conditions and the following disclaimer in the
014: * documentation and/or other materials provided with the distribution.
015: *
016: * * Neither the name of Jean Tessier nor the names of his contributors
017: * may be used to endorse or promote products derived from this software
018: * without specific prior written permission.
019: *
020: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
021: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
022: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
023: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
024: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
025: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
026: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
027: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
028: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
029: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
030: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
031: */
032:
033: package com.jeantessier.classreader;
034:
035: import java.util.*;
036:
037: public interface Visitor {
038: // Classfile
039: public void visitClassfiles(Collection<Classfile> classfiles);
040:
041: public void visitClassfile(Classfile classfile);
042:
043: // ConstantPool entries
044: public void visitConstantPool(ConstantPool constantPool);
045:
046: public void visitClass_info(Class_info entry);
047:
048: public void visitFieldRef_info(FieldRef_info entry);
049:
050: public void visitMethodRef_info(MethodRef_info entry);
051:
052: public void visitInterfaceMethodRef_info(
053: InterfaceMethodRef_info entry);
054:
055: public void visitString_info(String_info entry);
056:
057: public void visitInteger_info(Integer_info entry);
058:
059: public void visitFloat_info(Float_info entry);
060:
061: public void visitLong_info(Long_info entry);
062:
063: public void visitDouble_info(Double_info entry);
064:
065: public void visitNameAndType_info(NameAndType_info entry);
066:
067: public void visitUTF8_info(UTF8_info entry);
068:
069: // Features
070: public void visitField_info(Field_info entry);
071:
072: public void visitMethod_info(Method_info entry);
073:
074: // Attributes
075: public void visitConstantValue_attribute(
076: ConstantValue_attribute attribute);
077:
078: public void visitCode_attribute(Code_attribute attribute);
079:
080: public void visitExceptions_attribute(Exceptions_attribute attribute);
081:
082: public void visitInnerClasses_attribute(
083: InnerClasses_attribute attribute);
084:
085: public void visitSynthetic_attribute(Synthetic_attribute attribute);
086:
087: public void visitSourceFile_attribute(SourceFile_attribute attribute);
088:
089: public void visitLineNumberTable_attribute(
090: LineNumberTable_attribute attribute);
091:
092: public void visitLocalVariableTable_attribute(
093: LocalVariableTable_attribute attribute);
094:
095: public void visitDeprecated_attribute(Deprecated_attribute attribute);
096:
097: public void visitCustom_attribute(Custom_attribute attribute);
098:
099: // Attribute helpers
100: public void visitInstruction(Instruction instruction);
101:
102: public void visitExceptionHandler(ExceptionHandler helper);
103:
104: public void visitInnerClass(InnerClass helper);
105:
106: public void visitLineNumber(LineNumber helper);
107:
108: public void visitLocalVariable(LocalVariable helper);
109: }
|