Package eu.bandm.tools.util.classes
Class AnnotationVisitor<D>
java.lang.Object
eu.bandm.tools.util.classes.ClassFileVisitor<D>
eu.bandm.tools.util.classes.AnnotationVisitor<D>
- All Implemented Interfaces:
Runnable
Visits the bytecode of a class and collects annotations.
The callback method for error handling must be overridden by the
user, see superclass documentation.
Warning: not all aspects of annotations are implemented.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic class(package private) static @interfacestatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AnnotationVisitor.Annotationprotected final List<AnnotationVisitor.Annotation> protected final Deque<Consumer<AnnotationVisitor.ElementValue>> protected booleanprotected final Deque<AnnotationVisitor.Annotation> Fields inherited from class eu.bandm.tools.util.classes.ClassFileVisitor
MAX_MAJOR, MAX_MINOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconstantClass(int index, int nameIndex) protected voidelementValueString(int valueIndex) protected voidprotected voidprotected voidprotected voidprotected voidprotected StringgetClassName(int typeIndex) static voidprotected voidstartAnnotation(int typeIndex, int length) protected voidstartClass(int accessFlags, int thisClass, int superClass, int... interfaces) protected voidprotected voidstartElementValueArray(int length) protected voidstartElementValuePair(int index, int nameIndex) protected StringunmangleClassName(String fieldDescriptor) Methods inherited from class eu.bandm.tools.util.classes.ClassFileVisitor
attribute, constantDouble, constantFieldref, constantFloat, constantInteger, constantInterfaceMethodref, constantInvokeDynamic, constantLong, constantMethodHandle, constantMethodref, constantMethodType, constantModule, constantNameAndType, constantPackage, constantString, constantUtf8, constantValue, elementValueBoolean, elementValueByte, elementValueChar, elementValueClass, elementValueDouble, elementValueEnum, elementValueFloat, elementValueInt, elementValueLong, elementValueShort, endAttributes, endClass, endClassFile, endCode, endConstantPool, endExceptionHandlers, endField, endFields, endInnerClasses, endLineNumberTable, endMethod, endRuntimeInvisibleAnnotations, endRuntimeVisibleAnnotations, error, exceptionHandler, exceptions, getUTF8, innerClass, lineNumber, receiveError, run, sourceFile, startAttributes, startClassFile, startCode, startConstantPool, startExceptionHandlers, startField, startFields, startInnerClasses, startLineNumberTable, startMethod, startMethods, startRuntimeInvisibleAnnotations, startRuntimeVisibleAnnotations, visitAnnotation, visitAttribute, visitAttributes, visitClass, visitClassFile, visitCodeAttribute, visitConstantClass, visitConstantDouble, visitConstantFieldref, visitConstantFloat, visitConstantInteger, visitConstantInterfaceMethodref, visitConstantInvokeDynamic, visitConstantLong, visitConstantMethodHandle, visitConstantMethodref, visitConstantMethodType, visitConstantModule, visitConstantNameAndType, visitConstantPackage, visitConstantPool, visitConstantPoolEntry, visitConstantString, visitConstantUtf8, visitConstantValueAttribute, visitElementValue, visitElementValuePair, visitExceptionsAttribute, visitExceptionTable, visitField, visitFields, visitInnerClassesAttribute, visitInterfaces, visitLineNumberTableAttribute, visitMethod, visitMethods, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitSourceFileAttribute
-
Field Details
-
classNames
-
forClass
protected boolean forClass -
annotation
-
savedAnnotations
-
elementValueConsumer
-
classAnnotations
-
-
Constructor Details
-
AnnotationVisitor
-
-
Method Details
-
getClassAnnotations
-
getClassName
-
unmangleClassName
-
constantClass
protected void constantClass(int index, int nameIndex) - Overrides:
constantClassin classClassFileVisitor<D>
-
startClass
protected void startClass(int accessFlags, int thisClass, int superClass, int... interfaces) - Overrides:
startClassin classClassFileVisitor<D>
-
endMethods
protected void endMethods()- Overrides:
endMethodsin classClassFileVisitor<D>
-
startAnnotation
protected void startAnnotation(int typeIndex, int length) - Overrides:
startAnnotationin classClassFileVisitor<D>
-
endAnnotation
protected void endAnnotation()- Overrides:
endAnnotationin classClassFileVisitor<D>
-
startElementValuePair
protected void startElementValuePair(int index, int nameIndex) - Overrides:
startElementValuePairin classClassFileVisitor<D>
-
endElementValuePair
protected void endElementValuePair()- Overrides:
endElementValuePairin classClassFileVisitor<D>
-
elementValueString
protected void elementValueString(int valueIndex) - Overrides:
elementValueStringin classClassFileVisitor<D>
-
startElementValueArray
protected void startElementValueArray(int length) - Overrides:
startElementValueArrayin classClassFileVisitor<D>
-
endElementValueArray
protected void endElementValueArray()- Overrides:
endElementValueArrayin classClassFileVisitor<D>
-
startElementValueAnnotation
protected void startElementValueAnnotation()- Overrides:
startElementValueAnnotationin classClassFileVisitor<D>
-
endElementValueAnnotation
protected void endElementValueAnnotation()- Overrides:
endElementValueAnnotationin classClassFileVisitor<D>
-
main
- Throws:
Exception
-