final class IndexReaderV1 extends IndexReaderImpl
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.Modifier and Type | Field and Description |
---|---|
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 static byte |
CLASS_TAG |
private DotName[] |
classTable |
private static byte |
FIELD_TAG |
private PackedDataInputStream |
input |
private java.util.HashMap<DotName,java.util.List<AnnotationInstance>> |
masterAnnotations |
(package private) static int |
MAX_VERSION |
private static byte |
METHOD_PARAMATER_TAG |
private static byte |
METHOD_TAG |
(package private) static int |
MIN_VERSION |
private java.lang.String[] |
stringTable |
Constructor and Description |
---|
IndexReaderV1(PackedDataInputStream input)
Constructs a new IndedReader using the passed stream.
|
Modifier and Type | Method and Description |
---|---|
private void |
addClassToMap(java.util.HashMap<DotName,java.util.List<ClassInfo>> map,
DotName name,
ClassInfo currentClass) |
(package private) Index |
read(int version)
Read the index at the associated stream of this reader.
|
private void |
readAnnotations(PackedDataInputStream stream,
java.util.Map<DotName,java.util.List<AnnotationInstance>> annotations,
ClassInfo clazz) |
private AnnotationValue[] |
readAnnotationValues(PackedDataInputStream stream) |
private Index |
readClasses(PackedDataInputStream stream,
int version) |
private void |
readClassTable(PackedDataInputStream stream) |
private MethodInfo |
readMethod(ClassInfo clazz,
PackedDataInputStream stream) |
private void |
readStringTable(PackedDataInputStream stream) |
private Type |
readType(PackedDataInputStream stream) |
private void |
recordAnnotation(java.util.Map<DotName,java.util.List<AnnotationInstance>> annotations,
DotName annotation,
AnnotationInstance instance) |
(package private) int |
toDataVersion(int version) |
static final int MIN_VERSION
static final int MAX_VERSION
private static final byte FIELD_TAG
private static final byte METHOD_TAG
private static final byte METHOD_PARAMATER_TAG
private static final byte CLASS_TAG
private static final int AVALUE_BYTE
private static final int AVALUE_SHORT
private static final int AVALUE_INT
private static final int AVALUE_CHAR
private static final int AVALUE_FLOAT
private static final int AVALUE_DOUBLE
private static final int AVALUE_LONG
private static final int AVALUE_BOOLEAN
private static final int AVALUE_STRING
private static final int AVALUE_CLASS
private static final int AVALUE_ENUM
private static final int AVALUE_ARRAY
private static final int AVALUE_NESTED
private PackedDataInputStream input
private DotName[] classTable
private java.lang.String[] stringTable
private java.util.HashMap<DotName,java.util.List<AnnotationInstance>> masterAnnotations
IndexReaderV1(PackedDataInputStream input)
input
- a stream which points to a jandex index fileIndex read(int version) throws java.io.IOException
read
in class IndexReaderImpl
java.io.IOException
- if an I/O error occursjava.lang.IllegalArgumentException
- if the stream does not point to Jandex index dataUnsupportedVersion
- if the index data is tagged with a version not known to this readerprivate Index readClasses(PackedDataInputStream stream, int version) throws java.io.IOException
java.io.IOException
private void readAnnotations(PackedDataInputStream stream, java.util.Map<DotName,java.util.List<AnnotationInstance>> annotations, ClassInfo clazz) throws java.io.IOException
java.io.IOException
private AnnotationValue[] readAnnotationValues(PackedDataInputStream stream) throws java.io.IOException
java.io.IOException
private MethodInfo readMethod(ClassInfo clazz, PackedDataInputStream stream) throws java.io.IOException
java.io.IOException
private void recordAnnotation(java.util.Map<DotName,java.util.List<AnnotationInstance>> annotations, DotName annotation, AnnotationInstance instance)
private void addClassToMap(java.util.HashMap<DotName,java.util.List<ClassInfo>> map, DotName name, ClassInfo currentClass)
private Type readType(PackedDataInputStream stream) throws java.io.IOException
java.io.IOException
private void readStringTable(PackedDataInputStream stream) throws java.io.IOException
java.io.IOException
private void readClassTable(PackedDataInputStream stream) throws java.io.IOException
java.io.IOException
int toDataVersion(int version)
toDataVersion
in class IndexReaderImpl