Package org.jboss.jandex
Class IndexReaderV2
java.lang.Object
org.jboss.jandex.IndexReaderImpl
org.jboss.jandex.IndexReaderV2
Reads a Jandex index file and returns the saved index. See
Indexer
for a thorough description of how the Index data is produced.
An IndexReader loads the stream passed to it's constructor and applies the appropriate buffering. The Jandex index format is designed for efficient reading and low final memory storage.
Thread-Safety
IndexReader is not thread-safe and can not be shared between concurrent threads. The resulting index, however, is.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AnnotationInstance[]
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private byte[][]
private static final byte
private static final byte
private static final byte
private static final byte
private FieldInternal[]
private static final int
private static final byte[]
private PackedDataInputStream
(package private) static final int
(package private) static final int
private static final byte
private static final byte
private static final byte
private MethodInternal[]
(package private) static final int
private DotName[]
private static final byte
private static final byte
private RecordComponentInternal[]
private String[]
private static final byte
private static final byte
private static final byte
private Type[][]
private Type[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
addToMaster
(Map<DotName, List<AnnotationInstance>> masterAnnotations, DotName name, List<AnnotationInstance> annotations) private List
<AnnotationInstance> convertToList
(AnnotationInstance[] annotationInstances) private int
findNextNull
(Object[] array, int start) (package private) Index
read
(int version) private AnnotationInstance
readAnnotationEntry
(PackedDataInputStream stream, AnnotationTarget caller) private AnnotationInstance[]
readAnnotations
(PackedDataInputStream stream, AnnotationTarget target) private AnnotationTarget
readAnnotationTarget
(PackedDataInputStream stream, AnnotationTarget caller) private AnnotationValue
private AnnotationValue[]
private void
readByteTable
(PackedDataInputStream stream) private ClassInfo
readClassEntry
(PackedDataInputStream stream, Map<DotName, List<AnnotationInstance>> masterAnnotations, int version) private Index
readClasses
(PackedDataInputStream stream, int annotationsSize, int implementorsSize, int subclassesSize, int version) private FieldInternal[]
readClassFields
(PackedDataInputStream stream, ClassInfo clazz) private MethodInternal[]
readClassMethods
(PackedDataInputStream stream, ClassInfo clazz) private RecordComponentInternal[]
readClassRecordComponents
(PackedDataInputStream stream, ClassInfo clazz) readDotNames
(PackedDataInputStream stream) private ClassInfo.EnclosingMethodInfo
readEnclosingMethod
(PackedDataInputStream stream, int version) private FieldInternal
readFieldEntry
(PackedDataInputStream stream) private void
readFieldTable
(PackedDataInputStream stream) private MethodInternal
readMethodEntry
(PackedDataInputStream stream, int version) private void
readMethodTable
(PackedDataInputStream stream, int version) private ModuleInfo
readModuleEntry
(PackedDataInputStream stream, ClassInfo moduleInfoClass) private Map
<DotName, ModuleInfo> readModules
(PackedDataInputStream stream, Map<DotName, List<AnnotationInstance>> masterAnnotations, int version) private void
readNameTable
(PackedDataInputStream stream) private RecordComponentInternal
private void
private void
readStringTable
(PackedDataInputStream stream) private Type
readTypeEntry
(PackedDataInputStream stream) private Type[]
private Type[]
private void
private void
readTypeTable
(PackedDataInputStream stream) private void
readUsers
(PackedDataInputStream stream, int usersSize) (package private) int
toDataVersion
(int version) private void
updateAnnotationTargetInfo
(AnnotationInstance[] annotations, ClassInfo clazz)
-
Field Details
-
MIN_VERSION
static final int MIN_VERSION- See Also:
-
MAX_VERSION
static final int MAX_VERSION- See Also:
-
MAX_DATA_VERSION
static final int MAX_DATA_VERSION- See Also:
-
NULL_TARGET_TAG
private static final byte NULL_TARGET_TAG- See Also:
-
FIELD_TAG
private static final byte FIELD_TAG- See Also:
-
METHOD_TAG
private static final byte METHOD_TAG- See Also:
-
METHOD_PARAMETER_TAG
private static final byte METHOD_PARAMETER_TAG- See Also:
-
CLASS_TAG
private static final byte CLASS_TAG- See Also:
-
EMPTY_TYPE_TAG
private static final byte EMPTY_TYPE_TAG- See Also:
-
CLASS_EXTENDS_TYPE_TAG
private static final byte CLASS_EXTENDS_TYPE_TAG- See Also:
-
TYPE_PARAMETER_TAG
private static final byte TYPE_PARAMETER_TAG- See Also:
-
TYPE_PARAMETER_BOUND_TAG
private static final byte TYPE_PARAMETER_BOUND_TAG- See Also:
-
METHOD_PARAMETER_TYPE_TAG
private static final byte METHOD_PARAMETER_TYPE_TAG- See Also:
-
THROWS_TYPE_TAG
private static final byte THROWS_TYPE_TAG- See Also:
-
RECORD_COMPONENT_TAG
private static final byte RECORD_COMPONENT_TAG- See Also:
-
AVALUE_BYTE
private static final int AVALUE_BYTE- See Also:
-
AVALUE_SHORT
private static final int AVALUE_SHORT- See Also:
-
AVALUE_INT
private static final int AVALUE_INT- See Also:
-
AVALUE_CHAR
private static final int AVALUE_CHAR- See Also:
-
AVALUE_FLOAT
private static final int AVALUE_FLOAT- See Also:
-
AVALUE_DOUBLE
private static final int AVALUE_DOUBLE- See Also:
-
AVALUE_LONG
private static final int AVALUE_LONG- See Also:
-
AVALUE_BOOLEAN
private static final int AVALUE_BOOLEAN- See Also:
-
AVALUE_STRING
private static final int AVALUE_STRING- See Also:
-
AVALUE_CLASS
private static final int AVALUE_CLASS- See Also:
-
AVALUE_ENUM
private static final int AVALUE_ENUM- See Also:
-
AVALUE_ARRAY
private static final int AVALUE_ARRAY- See Also:
-
AVALUE_NESTED
private static final int AVALUE_NESTED- See Also:
-
HAS_ENCLOSING_METHOD
private static final int HAS_ENCLOSING_METHOD- See Also:
-
INIT_METHOD_NAME
private static final byte[] INIT_METHOD_NAME -
input
-
byteTable
private byte[][] byteTable -
stringTable
-
nameTable
-
typeTable
-
typeListTable
-
annotationTable
-
methodTable
-
fieldTable
-
recordComponentTable
-
users
-
-
Constructor Details
-
IndexReaderV2
IndexReaderV2(PackedDataInputStream input)
-
-
Method Details
-
read
- Specified by:
read
in classIndexReaderImpl
- Throws:
IOException
-
readUsers
- Throws:
IOException
-
readByteTable
- Throws:
IOException
-
readStringTable
- Throws:
IOException
-
readNameTable
- Throws:
IOException
-
readTypeTable
- Throws:
IOException
-
findNextNull
-
readTypeListTable
- Throws:
IOException
-
readAnnotations
private AnnotationInstance[] readAnnotations(PackedDataInputStream stream, AnnotationTarget target) throws IOException - Throws:
IOException
-
readAnnotationValues
- Throws:
IOException
-
readAnnotationValue
- Throws:
IOException
-
readAnnotationEntry
private AnnotationInstance readAnnotationEntry(PackedDataInputStream stream, AnnotationTarget caller) throws IOException - Throws:
IOException
-
readTypeListReference
- Throws:
IOException
-
readTypeListEntry
- Throws:
IOException
-
readTypeEntry
- Throws:
IOException
-
readAnnotationTarget
private AnnotationTarget readAnnotationTarget(PackedDataInputStream stream, AnnotationTarget caller) throws IOException - Throws:
IOException
-
readMethodTable
- Throws:
IOException
-
readFieldTable
- Throws:
IOException
-
readRecordComponentTable
- Throws:
IOException
-
readMethodEntry
private MethodInternal readMethodEntry(PackedDataInputStream stream, int version) throws IOException - Throws:
IOException
-
readFieldEntry
- Throws:
IOException
-
readRecordComponentEntry
private RecordComponentInternal readRecordComponentEntry(PackedDataInputStream stream) throws IOException - Throws:
IOException
-
readClassEntry
private ClassInfo readClassEntry(PackedDataInputStream stream, Map<DotName, List<AnnotationInstance>> masterAnnotations, int version) throws IOException- Throws:
IOException
-
readModuleEntry
private ModuleInfo readModuleEntry(PackedDataInputStream stream, ClassInfo moduleInfoClass) throws IOException - Throws:
IOException
-
readDotNames
- Throws:
IOException
-
addToMaster
private void addToMaster(Map<DotName, List<AnnotationInstance>> masterAnnotations, DotName name, List<AnnotationInstance> annotations) -
convertToList
-
addClassToMap
-
readClassFields
private FieldInternal[] readClassFields(PackedDataInputStream stream, ClassInfo clazz) throws IOException - Throws:
IOException
-
readClassRecordComponents
private RecordComponentInternal[] readClassRecordComponents(PackedDataInputStream stream, ClassInfo clazz) throws IOException - Throws:
IOException
-
readClassMethods
private MethodInternal[] readClassMethods(PackedDataInputStream stream, ClassInfo clazz) throws IOException - Throws:
IOException
-
updateAnnotationTargetInfo
-
readEnclosingMethod
private ClassInfo.EnclosingMethodInfo readEnclosingMethod(PackedDataInputStream stream, int version) throws IOException - Throws:
IOException
-
readClasses
private Index readClasses(PackedDataInputStream stream, int annotationsSize, int implementorsSize, int subclassesSize, int version) throws IOException - Throws:
IOException
-
readModules
private Map<DotName,ModuleInfo> readModules(PackedDataInputStream stream, Map<DotName, List<AnnotationInstance>> masterAnnotations, int version) throws IOException- Throws:
IOException
-
toDataVersion
int toDataVersion(int version) - Specified by:
toDataVersion
in classIndexReaderImpl
-