Top Description Fields Constructors Methods
org.jboss.jandex

pack-priv final Class IndexWriterV1

extends IndexWriterImpl
Class Inheritance
Imports
java.io.BufferedOutputStream, .IOException, .OutputStream, java.util.Collection, .Iterator, .List, .Map.Entry, .Set, .TreeMap

Writes a Jandex index file to a stream. The write process is somewhat more expensive to allow for fast reads and a compact size. For more information on the index content, see the documentation on org.jboss.jandex.Indexer.

The IndexWriter operates on standard output streams, and also provides suitable buffering.

Thread-Safety

IndexWriter is not thread-safe and can not be shared between concurrent threads.
Author
Jason T. Greene
See Also
org.jboss.jandex.Indexer, org.jboss.jandex.Index

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 TreeMap<DotName, Integer>
private static final byte
private static final int
pack-priv static final int
private static final byte
private static final byte
pack-priv static final int
private final OutputStream
private StrongInternPool<String>
pack-priv StrongInternPool<String>.Index
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
IndexWriterV1(OutputStream
a stream to write an index to
out
,
int version)

Constructs an IndexWriter using the specified stream

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
private DotName
private String
intern(String name)

private int
private int
positionOf(DotName className)

pack-priv int

Returns:

the number of bytes written to the stream
write
(Index
the index to write to the stream
index
)

Implements abstract org.jboss.jandex.IndexWriterImpl.write.

Writes the specified index to the associated output stream.
private void
private void
private void
private void
private void
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 TreeMap<DotName, Integer> classTable
FIELD_TAGback to summary
private static final byte FIELD_TAG
MAGICback to summary
private static final int MAGIC
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
outback to summary
private final OutputStream out
poolback to summary
private StrongInternPool<String> pool
poolIndexback to summary
pack-priv StrongInternPool<String>.Index poolIndex
versionback to summary
private final int version

Constructor Detail

IndexWriterV1back to summary
pack-priv IndexWriterV1(OutputStream out, int version)

Constructs an IndexWriter using the specified stream

Parameters
out:OutputStream

a stream to write an index to

Method Detail

addClassNameback to summary
private void addClassName(DotName name)
buildAValueEntriesback to summary
private void buildAValueEntries(Index index, AnnotationValue value)
buildTablesback to summary
private void buildTables(Index index)
downgradeNameback to summary
private DotName downgradeName(DotName name)
internback to summary
private String intern(String name)
positionOfback to summary
private int positionOf(String string)
positionOfback to summary
private int positionOf(DotName className)
writeback to summary
pack-priv int write(Index index) throws IOException

Implements abstract org.jboss.jandex.IndexWriterImpl.write.

Writes the specified index to the associated output stream. This may be called multiple times in order to write multiple indexes.

Parameters
index:Index

the index to write to the stream

Returns:int

the number of bytes written to the stream

Exceptions
IOException:
if any i/o error occurs
writeAnnotationValueback to summary
private void writeAnnotationValue(PackedDataOutputStream stream, AnnotationValue value) throws IOException
writeAnnotationValuesback to summary
private void writeAnnotationValues(PackedDataOutputStream stream, Collection<AnnotationValue> values) throws IOException
writeClassesback to summary
private void writeClasses(PackedDataOutputStream stream, Index index) throws IOException
writeClassTableback to summary
private void writeClassTable(PackedDataOutputStream stream) throws IOException
writeStringTableback to summary
private void writeStringTable(PackedDataOutputStream stream) throws IOException
writeTypeback to summary
private void writeType(PackedDataOutputStream stream, Type type) throws IOException