Top Description Fields Constructors Methods
org.jboss.jandex

pack-priv final Class IndexReaderV1

extends IndexReaderImpl
Class Inheritance
Imports
java.io.IOException, java.util.ArrayList, .Collections, .HashMap, .List, .Map

Reads a Jandex index file and returns the saved index. See org.jboss.jandex.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.
Author
Jason T. Greene

Field Summary

Modifier and TypeField and Description
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 static final byte
private DotName[]
private static final byte
private final PackedDataInputStream
private HashMap<DotName, List<AnnotationInstance>>
pack-priv static final int
private static final byte
private static final byte
pack-priv static final int
private String[]
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
IndexReaderV1(PackedDataInputStream
a stream which points to a jandex index file
input
,
int version)

Constructs a new IndedReader using the passed stream.

Method Summary

Modifier and TypeMethod and Description
private void
pack-priv Index

Returns:

the Index contained in the stream
read
()

Implements abstract org.jboss.jandex.IndexReaderImpl.read.

Read the index at the associated stream of this reader.
private void
private AnnotationValue[]
private Index
private void
private MethodInfo
private void
private Type
private void

Field Detail

AVALUE_ARRAYback to summary
private static final int AVALUE_ARRAY
AVALUE_BOOLEANback to summary
private static final int AVALUE_BOOLEAN
AVALUE_BYTEback to summary
private static final int AVALUE_BYTE
AVALUE_CHARback to summary
private static final int AVALUE_CHAR
AVALUE_CLASSback to summary
private static final int AVALUE_CLASS
AVALUE_DOUBLEback to summary
private static final int AVALUE_DOUBLE
AVALUE_ENUMback to summary
private static final int AVALUE_ENUM
AVALUE_FLOATback to summary
private static final int AVALUE_FLOAT
AVALUE_INTback to summary
private static final int AVALUE_INT
AVALUE_LONGback to summary
private static final int AVALUE_LONG
AVALUE_NESTEDback to summary
private static final int AVALUE_NESTED
AVALUE_SHORTback to summary
private static final int AVALUE_SHORT
AVALUE_STRINGback to summary
private static final int AVALUE_STRING
CLASS_TAGback to summary
private static final byte CLASS_TAG
classTableback to summary
private DotName[] classTable
FIELD_TAGback to summary
private static final byte FIELD_TAG
inputback to summary
private final PackedDataInputStream input
masterAnnotationsback to summary
private HashMap<DotName, List<AnnotationInstance>> masterAnnotations
MAX_VERSIONback to summary
pack-priv static final int MAX_VERSION
METHOD_PARAMETER_TAGback to summary
private static final byte METHOD_PARAMETER_TAG
METHOD_TAGback to summary
private static final byte METHOD_TAG
MIN_VERSIONback to summary
pack-priv static final int MIN_VERSION
stringTableback to summary
private String[] stringTable
versionback to summary
private final int version

Constructor Detail

IndexReaderV1back to summary
pack-priv IndexReaderV1(PackedDataInputStream input, int version)

Constructs a new IndedReader using the passed stream. The stream is not read from until the read method is called.

Parameters
input:PackedDataInputStream

a stream which points to a jandex index file

Method Detail

addClassToMapback to summary
private void addClassToMap(HashMap<DotName, List<ClassInfo>> map, DotName name, ClassInfo currentClass)
readback to summary
pack-priv Index read() throws IOException

Implements abstract org.jboss.jandex.IndexReaderImpl.read.

Read the index at the associated stream of this reader. This method can be called multiple times if the stream contains multiple index files.

Returns:Index

the Index contained in the stream

Exceptions
IOException:
if an I/O error occurs
IllegalArgumentException:
if the stream does not point to Jandex index data
UnsupportedVersion:
if the index data is tagged with a version not known to this reader
readAnnotationsback to summary
private void readAnnotations(PackedDataInputStream stream, Map<DotName, List<AnnotationInstance>> annotations, ClassInfo clazz) throws IOException
readAnnotationValuesback to summary
private AnnotationValue[] readAnnotationValues(PackedDataInputStream stream) throws IOException
readClassesback to summary
private Index readClasses(PackedDataInputStream stream) throws IOException
readClassTableback to summary
private void readClassTable(PackedDataInputStream stream) throws IOException
readMethodback to summary
private MethodInfo readMethod(ClassInfo clazz, PackedDataInputStream stream) throws IOException
readStringTableback to summary
private void readStringTable(PackedDataInputStream stream) throws IOException
readTypeback to summary
private Type readType(PackedDataInputStream stream) throws IOException
recordAnnotationback to summary
private void recordAnnotation(Map<DotName, List<AnnotationInstance>> annotations, DotName annotation, AnnotationInstance instance)