Package eu.bandm.tools.util.classes
Class ClassFileVisitor<D>
java.lang.Object
eu.bandm.tools.util.classes.ClassFileVisitor<D>
- Type Parameters:
D- the type of class file document identifiers
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
AnnotationVisitor
Abstract algorithm for traversing a class file.
The callback method for error handling
receiveError(D, java.lang.String, java.lang.Object...)
must be overridden by the user.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidattribute(int index, int nameIndex, long length) protected voidconstantClass(int index, int nameIndex) protected voidconstantDouble(int index, double value) protected voidconstantFieldref(int index, int classIndex, int nameAndTypeIndex) protected voidconstantFloat(int index, float value) protected voidconstantInteger(int index, int value) protected voidconstantInterfaceMethodref(int index, int classIndex, int nameAndTypeIndex) protected voidconstantInvokeDynamic(int index, int bootstrapMethodAttrIndex, int nameAndTypeIndex) protected voidconstantLong(int index, long value) protected voidconstantMethodHandle(int index, int referenceKind, int referenceIndex) protected voidconstantMethodref(int index, int classIndex, int nameAndTypeIndex) protected voidconstantMethodType(int index, int descriptorIndex) protected voidconstantModule(int index, int nameIndex) protected voidconstantNameAndType(int index, int nameIndex, int descriptorIndex) protected voidconstantPackage(int index, int nameIndex) protected voidconstantString(int index, int stringIndex) protected voidconstantUtf8(int index, String text) protected voidconstantValue(int index, int valueIndex) protected voidelementValueBoolean(int valueIndex) protected voidelementValueByte(int valueIndex) protected voidelementValueChar(int valueIndex) protected voidelementValueClass(int typeIndex) protected voidelementValueDouble(int valueIndex) protected voidelementValueEnum(int typeIndex, int valueIndex) protected voidelementValueFloat(int valueIndex) protected voidelementValueInt(int valueIndex) protected voidelementValueLong(int valueIndex) protected voidelementValueShort(int valueIndex) protected voidelementValueString(int valueIndex) protected voidprotected voidprotected voidendClass()protected voidprotected voidendCode()protected voidprotected voidprotected voidprotected voidprotected voidprotected voidendField()protected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidexceptionHandler(int startPC, int endPC, int handlerPC, int catchType) protected voidexceptions(int index, int... exceptionIndexTable) protected StringgetUTF8(int index) protected voidinnerClass(int index, int innerClassIndex, int outerClassIndex, int innerNameIndex, int innerClassAccessFlags) protected voidlineNumber(int index, int startPC, int lineNumber) protected voidreceiveError(D docid, String text, Object... args) Hook method must be overridden by any user.voidrun()protected voidsourceFile(int index, int sourceFileIndex) protected voidstartAnnotation(int typeIndex, int length) protected voidstartAttributes(int length) protected voidstartClass(int accessFlags, int thisClass, int superClass, int... interfaces) protected voidstartClassFile(int major, int minor) protected voidstartCode(int index, int maxStack, int maxLocals, byte... code) protected voidstartConstantPool(int length) protected voidprotected voidstartElementValueArray(int length) protected voidstartElementValuePair(int index, int nameIndex) protected voidstartExceptionHandlers(int length) protected voidstartField(int index, int accessFlags, int nameIndex, int descriptorIndex) protected voidstartFields(int length) protected voidstartInnerClasses(int index, int length) protected voidstartLineNumberTable(int index, int length) protected voidstartMethod(int index, int accessFlags, int nameIndex, int descriptorIndex) protected voidstartMethods(int length) protected voidprotected voidprotected voidprotected voidvisitAttribute(int index) protected voidprotected voidprotected voidprotected voidvisitCodeAttribute(int index) protected voidvisitConstantClass(int index) protected voidvisitConstantDouble(int index) protected voidvisitConstantFieldref(int index) protected voidvisitConstantFloat(int index) protected voidvisitConstantInteger(int index) protected voidvisitConstantInterfaceMethodref(int index) protected voidvisitConstantInvokeDynamic(int index) protected voidvisitConstantLong(int index) protected voidvisitConstantMethodHandle(int index) protected voidvisitConstantMethodref(int index) protected voidvisitConstantMethodType(int index) protected voidvisitConstantModule(int index) protected voidvisitConstantNameAndType(int index) protected voidvisitConstantPackage(int index) protected voidprotected booleanvisitConstantPoolEntry(int index) protected voidvisitConstantString(int index) protected voidvisitConstantUtf8(int index) protected voidvisitConstantValueAttribute(int index) protected voidprotected voidvisitElementValuePair(int i) protected voidvisitExceptionsAttribute(int index) protected voidprotected voidvisitField(int index) protected voidprotected voidvisitInnerClassesAttribute(int index) protected int[]protected voidvisitLineNumberTableAttribute(int index) protected voidvisitMethod(int index) protected voidprotected voidvisitRuntimeInvisibleAnnotationsAttribute(int index) protected voidvisitRuntimeVisibleAnnotationsAttribute(int index) protected voidvisitSourceFileAttribute(int index)
-
Field Details
-
MAX_MAJOR
public static final int MAX_MAJOR- See Also:
-
MAX_MINOR
public static final int MAX_MINOR- See Also:
-
-
Constructor Details
-
ClassFileVisitor
-
-
Method Details
-
run
public void run() -
getUTF8
-
receiveError
Hook method must be overridden by any user.- Parameters:
docid- the identifier of the read class filetext- error textargs- error text arguments
-
error
-
visitClassFile
protected void visitClassFile() -
visitConstantPool
protected void visitConstantPool() -
visitConstantPoolEntry
protected boolean visitConstantPoolEntry(int index) -
visitConstantUtf8
protected void visitConstantUtf8(int index) -
visitConstantInteger
protected void visitConstantInteger(int index) -
visitConstantFloat
protected void visitConstantFloat(int index) -
visitConstantLong
protected void visitConstantLong(int index) -
visitConstantDouble
protected void visitConstantDouble(int index) -
visitConstantClass
protected void visitConstantClass(int index) -
visitConstantString
protected void visitConstantString(int index) -
visitConstantFieldref
protected void visitConstantFieldref(int index) -
visitConstantMethodref
protected void visitConstantMethodref(int index) -
visitConstantInterfaceMethodref
protected void visitConstantInterfaceMethodref(int index) -
visitConstantNameAndType
protected void visitConstantNameAndType(int index) -
visitConstantMethodHandle
protected void visitConstantMethodHandle(int index) -
visitConstantMethodType
protected void visitConstantMethodType(int index) -
visitConstantInvokeDynamic
protected void visitConstantInvokeDynamic(int index) -
visitConstantModule
protected void visitConstantModule(int index) -
visitConstantPackage
protected void visitConstantPackage(int index) -
visitClass
protected void visitClass() -
visitInterfaces
protected int[] visitInterfaces() -
visitFields
protected void visitFields() -
visitField
protected void visitField(int index) -
visitMethods
protected void visitMethods() -
visitMethod
protected void visitMethod(int index) -
visitAttributes
protected void visitAttributes() -
visitAttribute
protected void visitAttribute(int index) -
visitConstantValueAttribute
protected void visitConstantValueAttribute(int index) -
visitCodeAttribute
protected void visitCodeAttribute(int index) -
visitExceptionTable
protected void visitExceptionTable() -
visitExceptionsAttribute
protected void visitExceptionsAttribute(int index) -
visitInnerClassesAttribute
protected void visitInnerClassesAttribute(int index) -
visitSourceFileAttribute
protected void visitSourceFileAttribute(int index) -
visitLineNumberTableAttribute
protected void visitLineNumberTableAttribute(int index) -
visitRuntimeVisibleAnnotationsAttribute
protected void visitRuntimeVisibleAnnotationsAttribute(int index) -
visitRuntimeInvisibleAnnotationsAttribute
protected void visitRuntimeInvisibleAnnotationsAttribute(int index) -
visitAnnotation
protected void visitAnnotation() -
visitElementValuePair
protected void visitElementValuePair(int i) -
visitElementValue
protected void visitElementValue() -
startClassFile
protected void startClassFile(int major, int minor) -
endClassFile
protected void endClassFile() -
startConstantPool
protected void startConstantPool(int length) -
endConstantPool
protected void endConstantPool() -
constantUtf8
-
constantInteger
protected void constantInteger(int index, int value) -
constantFloat
protected void constantFloat(int index, float value) -
constantLong
protected void constantLong(int index, long value) -
constantDouble
protected void constantDouble(int index, double value) -
constantClass
protected void constantClass(int index, int nameIndex) -
constantString
protected void constantString(int index, int stringIndex) -
constantFieldref
protected void constantFieldref(int index, int classIndex, int nameAndTypeIndex) -
constantMethodref
protected void constantMethodref(int index, int classIndex, int nameAndTypeIndex) -
constantInterfaceMethodref
protected void constantInterfaceMethodref(int index, int classIndex, int nameAndTypeIndex) -
constantNameAndType
protected void constantNameAndType(int index, int nameIndex, int descriptorIndex) -
constantMethodHandle
protected void constantMethodHandle(int index, int referenceKind, int referenceIndex) -
constantMethodType
protected void constantMethodType(int index, int descriptorIndex) -
constantInvokeDynamic
protected void constantInvokeDynamic(int index, int bootstrapMethodAttrIndex, int nameAndTypeIndex) -
constantModule
protected void constantModule(int index, int nameIndex) -
constantPackage
protected void constantPackage(int index, int nameIndex) -
startClass
protected void startClass(int accessFlags, int thisClass, int superClass, int... interfaces) -
endClass
protected void endClass() -
startFields
protected void startFields(int length) -
endFields
protected void endFields() -
startField
protected void startField(int index, int accessFlags, int nameIndex, int descriptorIndex) -
endField
protected void endField() -
startMethods
protected void startMethods(int length) -
endMethods
protected void endMethods() -
startMethod
protected void startMethod(int index, int accessFlags, int nameIndex, int descriptorIndex) -
endMethod
protected void endMethod() -
startAttributes
protected void startAttributes(int length) -
endAttributes
protected void endAttributes() -
constantValue
protected void constantValue(int index, int valueIndex) -
startCode
protected void startCode(int index, int maxStack, int maxLocals, byte... code) -
endCode
protected void endCode() -
startExceptionHandlers
protected void startExceptionHandlers(int length) -
endExceptionHandlers
protected void endExceptionHandlers() -
exceptionHandler
protected void exceptionHandler(int startPC, int endPC, int handlerPC, int catchType) -
exceptions
protected void exceptions(int index, int... exceptionIndexTable) -
startInnerClasses
protected void startInnerClasses(int index, int length) -
endInnerClasses
protected void endInnerClasses() -
innerClass
protected void innerClass(int index, int innerClassIndex, int outerClassIndex, int innerNameIndex, int innerClassAccessFlags) -
sourceFile
protected void sourceFile(int index, int sourceFileIndex) -
startLineNumberTable
protected void startLineNumberTable(int index, int length) -
endLineNumberTable
protected void endLineNumberTable() -
lineNumber
protected void lineNumber(int index, int startPC, int lineNumber) -
attribute
protected void attribute(int index, int nameIndex, long length) -
startRuntimeVisibleAnnotations
protected void startRuntimeVisibleAnnotations() -
endRuntimeVisibleAnnotations
protected void endRuntimeVisibleAnnotations() -
startRuntimeInvisibleAnnotations
protected void startRuntimeInvisibleAnnotations() -
endRuntimeInvisibleAnnotations
protected void endRuntimeInvisibleAnnotations() -
startAnnotation
protected void startAnnotation(int typeIndex, int length) -
endAnnotation
protected void endAnnotation() -
startElementValuePair
protected void startElementValuePair(int index, int nameIndex) -
endElementValuePair
protected void endElementValuePair() -
elementValueByte
protected void elementValueByte(int valueIndex) -
elementValueChar
protected void elementValueChar(int valueIndex) -
elementValueDouble
protected void elementValueDouble(int valueIndex) -
elementValueFloat
protected void elementValueFloat(int valueIndex) -
elementValueInt
protected void elementValueInt(int valueIndex) -
elementValueLong
protected void elementValueLong(int valueIndex) -
elementValueShort
protected void elementValueShort(int valueIndex) -
elementValueBoolean
protected void elementValueBoolean(int valueIndex) -
elementValueString
protected void elementValueString(int valueIndex) -
elementValueEnum
protected void elementValueEnum(int typeIndex, int valueIndex) -
elementValueClass
protected void elementValueClass(int typeIndex) -
startElementValueAnnotation
protected void startElementValueAnnotation() -
endElementValueAnnotation
protected void endElementValueAnnotation() -
startElementValueArray
protected void startElementValueArray(int length) -
endElementValueArray
protected void endElementValueArray()
-