Package org.jboss.jandex
Class IndexReaderV2
- java.lang.Object
-
- org.jboss.jandex.IndexReaderImpl
-
- org.jboss.jandex.IndexReaderV2
-
final class IndexReaderV2 extends IndexReaderImpl
Reads a Jandex index file and returns the saved index. SeeIndexer
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
Fields Modifier and Type Field Description private AnnotationInstance[]
annotationTable
private static int
AVALUE_ARRAY
private static int
AVALUE_BOOLEAN
private static int
AVALUE_BYTE
private static int
AVALUE_CHAR
private static int
AVALUE_CLASS
private static int
AVALUE_DOUBLE
private static int
AVALUE_ENUM
private static int
AVALUE_FLOAT
private static int
AVALUE_INT
private static int
AVALUE_LONG
private static int
AVALUE_NESTED
private static int
AVALUE_SHORT
private static int
AVALUE_STRING
private byte[][]
byteTable
private static byte
CLASS_EXTENDS_TYPE_TAG
private static byte
CLASS_TAG
private static byte
EMPTY_TYPE_TAG
private static byte
FIELD_TAG
private FieldInternal[]
fieldTable
private static int
HAS_ENCLOSING_METHOD
private PackedDataInputStream
input
(package private) static int
MAX_VERSION
private static byte
METHOD_PARAMETER_TAG
private static byte
METHOD_PARAMETER_TYPE_TAG
private static byte
METHOD_TAG
private MethodInternal[]
methodTable
(package private) static int
MIN_VERSION
private DotName[]
nameTable
private static byte
NULL_TARGET_TAG
private static byte
RECORD_COMPONENT_TAG
private RecordComponentInternal[]
recordComponentTable
private java.lang.String[]
stringTable
private static byte
THROWS_TYPE_TAG
private static byte
TYPE_PARAMETER_BOUND_TAG
private static byte
TYPE_PARAMETER_TAG
private Type[][]
typeListTable
private Type[]
typeTable
private java.util.HashMap<DotName,java.util.Set<DotName>>
users
private int
version
-
Constructor Summary
Constructors Constructor Description IndexReaderV2(PackedDataInputStream input, int version)
-
Method Summary
-
-
-
Field Detail
-
MIN_VERSION
static final int MIN_VERSION
- See Also:
- Constant Field Values
-
MAX_VERSION
static final int MAX_VERSION
- See Also:
- Constant Field Values
-
NULL_TARGET_TAG
private static final byte NULL_TARGET_TAG
- See Also:
- Constant Field Values
-
FIELD_TAG
private static final byte FIELD_TAG
- See Also:
- Constant Field Values
-
METHOD_TAG
private static final byte METHOD_TAG
- See Also:
- Constant Field Values
-
METHOD_PARAMETER_TAG
private static final byte METHOD_PARAMETER_TAG
- See Also:
- Constant Field Values
-
CLASS_TAG
private static final byte CLASS_TAG
- See Also:
- Constant Field Values
-
EMPTY_TYPE_TAG
private static final byte EMPTY_TYPE_TAG
- See Also:
- Constant Field Values
-
CLASS_EXTENDS_TYPE_TAG
private static final byte CLASS_EXTENDS_TYPE_TAG
- See Also:
- Constant Field Values
-
TYPE_PARAMETER_TAG
private static final byte TYPE_PARAMETER_TAG
- See Also:
- Constant Field Values
-
TYPE_PARAMETER_BOUND_TAG
private static final byte TYPE_PARAMETER_BOUND_TAG
- See Also:
- Constant Field Values
-
METHOD_PARAMETER_TYPE_TAG
private static final byte METHOD_PARAMETER_TYPE_TAG
- See Also:
- Constant Field Values
-
THROWS_TYPE_TAG
private static final byte THROWS_TYPE_TAG
- See Also:
- Constant Field Values
-
RECORD_COMPONENT_TAG
private static final byte RECORD_COMPONENT_TAG
- See Also:
- Constant Field Values
-
AVALUE_BYTE
private static final int AVALUE_BYTE
- See Also:
- Constant Field Values
-
AVALUE_SHORT
private static final int AVALUE_SHORT
- See Also:
- Constant Field Values
-
AVALUE_INT
private static final int AVALUE_INT
- See Also:
- Constant Field Values
-
AVALUE_CHAR
private static final int AVALUE_CHAR
- See Also:
- Constant Field Values
-
AVALUE_FLOAT
private static final int AVALUE_FLOAT
- See Also:
- Constant Field Values
-
AVALUE_DOUBLE
private static final int AVALUE_DOUBLE
- See Also:
- Constant Field Values
-
AVALUE_LONG
private static final int AVALUE_LONG
- See Also:
- Constant Field Values
-
AVALUE_BOOLEAN
private static final int AVALUE_BOOLEAN
- See Also:
- Constant Field Values
-
AVALUE_STRING
private static final int AVALUE_STRING
- See Also:
- Constant Field Values
-
AVALUE_CLASS
private static final int AVALUE_CLASS
- See Also:
- Constant Field Values
-
AVALUE_ENUM
private static final int AVALUE_ENUM
- See Also:
- Constant Field Values
-
AVALUE_ARRAY
private static final int AVALUE_ARRAY
- See Also:
- Constant Field Values
-
AVALUE_NESTED
private static final int AVALUE_NESTED
- See Also:
- Constant Field Values
-
HAS_ENCLOSING_METHOD
private static final int HAS_ENCLOSING_METHOD
- See Also:
- Constant Field Values
-
input
private final PackedDataInputStream input
-
version
private final int version
-
byteTable
private byte[][] byteTable
-
stringTable
private java.lang.String[] stringTable
-
nameTable
private DotName[] nameTable
-
typeTable
private Type[] typeTable
-
typeListTable
private Type[][] typeListTable
-
annotationTable
private AnnotationInstance[] annotationTable
-
methodTable
private MethodInternal[] methodTable
-
fieldTable
private FieldInternal[] fieldTable
-
recordComponentTable
private RecordComponentInternal[] recordComponentTable
-
-
Constructor Detail
-
IndexReaderV2
IndexReaderV2(PackedDataInputStream input, int version)
-
-
Method Detail
-
read
Index read() throws java.io.IOException
- Specified by:
read
in classIndexReaderImpl
- Throws:
java.io.IOException
-
readUsers
private void readUsers(PackedDataInputStream stream, int usersSize) throws java.io.IOException
- Throws:
java.io.IOException
-
readByteTable
private void readByteTable(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readStringTable
private void readStringTable(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readNameTable
private void readNameTable(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readTypeTable
private void readTypeTable(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
findNextNull
private int findNextNull(java.lang.Object[] array, int start)
-
readTypeListTable
private void readTypeListTable(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readAnnotations
private AnnotationInstance[] readAnnotations(PackedDataInputStream stream, AnnotationTarget target) throws java.io.IOException
- Throws:
java.io.IOException
-
readAnnotationValues
private AnnotationValue[] readAnnotationValues(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readAnnotationValue
private AnnotationValue readAnnotationValue(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readAnnotationEntry
private AnnotationInstance readAnnotationEntry(PackedDataInputStream stream, AnnotationTarget caller) throws java.io.IOException
- Throws:
java.io.IOException
-
readTypeListReference
private Type[] readTypeListReference(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readTypeListEntry
private Type[] readTypeListEntry(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readTypeEntry
private Type readTypeEntry(PackedDataInputStream stream, java.util.Map<TypeVariableReference,java.lang.Integer> references) throws java.io.IOException
- Throws:
java.io.IOException
-
readAnnotationTarget
private AnnotationTarget readAnnotationTarget(PackedDataInputStream stream, AnnotationTarget caller) throws java.io.IOException
- Throws:
java.io.IOException
-
readMethodTable
private void readMethodTable(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readFieldTable
private void readFieldTable(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readRecordComponentTable
private void readRecordComponentTable(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readMethodEntry
private MethodInternal readMethodEntry(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readFieldEntry
private FieldInternal readFieldEntry(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readRecordComponentEntry
private RecordComponentInternal readRecordComponentEntry(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readClassEntry
private ClassInfo readClassEntry(PackedDataInputStream stream, java.util.Map<DotName,java.util.List<AnnotationInstance>> masterAnnotations) throws java.io.IOException
- Throws:
java.io.IOException
-
readModuleEntry
private ModuleInfo readModuleEntry(PackedDataInputStream stream, ClassInfo moduleInfoClass) throws java.io.IOException
- Throws:
java.io.IOException
-
readDotNames
private java.util.List<DotName> readDotNames(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
addToMaster
private void addToMaster(java.util.Map<DotName,java.util.List<AnnotationInstance>> masterAnnotations, DotName name, java.util.List<AnnotationInstance> annotations)
-
convertToList
private java.util.List<AnnotationInstance> convertToList(AnnotationInstance[] annotationInstances)
-
addClassToMap
private void addClassToMap(java.util.HashMap<DotName,java.util.List<ClassInfo>> map, DotName name, ClassInfo currentClass)
-
readClassFields
private FieldInternal[] readClassFields(PackedDataInputStream stream, ClassInfo clazz) throws java.io.IOException
- Throws:
java.io.IOException
-
readClassRecordComponents
private RecordComponentInternal[] readClassRecordComponents(PackedDataInputStream stream, ClassInfo clazz) throws java.io.IOException
- Throws:
java.io.IOException
-
readClassMethods
private MethodInternal[] readClassMethods(PackedDataInputStream stream, ClassInfo clazz) throws java.io.IOException
- Throws:
java.io.IOException
-
updateAnnotationTargetInfo
private void updateAnnotationTargetInfo(AnnotationInstance[] annotations, ClassInfo clazz)
-
readEnclosingMethod
private ClassInfo.EnclosingMethodInfo readEnclosingMethod(PackedDataInputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
readClasses
private Index readClasses(PackedDataInputStream stream, int annotationsSize, int implementorsSize, int subinterfacesSize, int subclassesSize) throws java.io.IOException
- Throws:
java.io.IOException
-
readModules
private java.util.Map<DotName,ModuleInfo> readModules(PackedDataInputStream stream, java.util.Map<DotName,java.util.List<AnnotationInstance>> masterAnnotations) throws java.io.IOException
- Throws:
java.io.IOException
-
-