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.
Warning: not all aspects of annotations are implemented.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
(package private) static @interface
static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected AnnotationVisitor.Annotation
protected final List<AnnotationVisitor.Annotation>
protected final Deque<Consumer<AnnotationVisitor.ElementValue>>
protected boolean
Fields inherited from class eu.bandm.tools.util.classes.ClassFileVisitor
MAX_MAJOR, MAX_MINOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
constantClass
(int index, int nameIndex) protected void
elementValueString
(int valueIndex) protected void
protected void
protected void
protected void
protected String
getClassName
(int typeIndex) static void
protected void
startAnnotation
(int typeIndex, int length) protected void
startClass
(int accessFlags, int thisClass, int superClass, int... interfaces) protected void
startElementValueArray
(int length) protected void
startElementValuePair
(int index, int nameIndex) protected String
unmangleClassName
(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, endElementValueAnnotation, endExceptionHandlers, endField, endFields, endInnerClasses, endLineNumberTable, endMethod, endRuntimeInvisibleAnnotations, endRuntimeVisibleAnnotations, error, exceptionHandler, exceptions, getUTF8, innerClass, lineNumber, receiveError, run, sourceFile, startAttributes, startClassFile, startCode, startConstantPool, startElementValueAnnotation, 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
-
elementValueConsumer
-
classAnnotations
-
-
Constructor Details
-
AnnotationVisitor
-
-
Method Details
-
getClassAnnotations
-
getClassName
-
unmangleClassName
-
constantClass
protected void constantClass(int index, int nameIndex) - Overrides:
constantClass
in classClassFileVisitor<D>
-
startClass
protected void startClass(int accessFlags, int thisClass, int superClass, int... interfaces) - Overrides:
startClass
in classClassFileVisitor<D>
-
endMethods
protected void endMethods()- Overrides:
endMethods
in classClassFileVisitor<D>
-
startAnnotation
protected void startAnnotation(int typeIndex, int length) - Overrides:
startAnnotation
in classClassFileVisitor<D>
-
endAnnotation
protected void endAnnotation()- Overrides:
endAnnotation
in classClassFileVisitor<D>
-
startElementValuePair
protected void startElementValuePair(int index, int nameIndex) - Overrides:
startElementValuePair
in classClassFileVisitor<D>
-
endElementValuePair
protected void endElementValuePair()- Overrides:
endElementValuePair
in classClassFileVisitor<D>
-
elementValueString
protected void elementValueString(int valueIndex) - Overrides:
elementValueString
in classClassFileVisitor<D>
-
startElementValueArray
protected void startElementValueArray(int length) - Overrides:
startElementValueArray
in classClassFileVisitor<D>
-
endElementValueArray
protected void endElementValueArray()- Overrides:
endElementValueArray
in classClassFileVisitor<D>
-
main
- Throws:
Exception
-