Package org.jboss.jandex
Class IndexWriterV1
java.lang.Object
org.jboss.jandex.IndexWriterImpl
org.jboss.jandex.IndexWriterV1
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
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.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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 static final byte
private static final int
(package private) static final int
private static final byte
private static final byte
(package private) static final int
private final OutputStream
private StrongInternPool
<String> (package private) StrongInternPool<String>.Index
private final int
-
Constructor Summary
ConstructorsConstructorDescriptionIndexWriterV1
(OutputStream out, int version) Constructs an IndexWriter using the specified stream -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addClassName
(DotName name) private void
buildAValueEntries
(Index index, AnnotationValue value) private void
buildTables
(Index index) private DotName
downgradeName
(DotName name) private String
private int
positionOf
(String string) private int
positionOf
(DotName className) (package private) int
Writes the specified index to the associated output stream.private void
writeAnnotationValue
(PackedDataOutputStream stream, AnnotationValue value) private void
writeAnnotationValues
(PackedDataOutputStream stream, Collection<AnnotationValue> values) private void
writeClasses
(PackedDataOutputStream stream, Index index) private void
private void
private void
writeType
(PackedDataOutputStream stream, Type type)
-
Field Details
-
MAGIC
private static final int MAGIC- See Also:
-
MIN_VERSION
static final int MIN_VERSION- See Also:
-
MAX_VERSION
static final int MAX_VERSION- 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:
-
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:
-
out
-
version
private final int version -
pool
-
poolIndex
StrongInternPool<String>.Index poolIndex -
classTable
-
-
Constructor Details
-
IndexWriterV1
IndexWriterV1(OutputStream out, int version) Constructs an IndexWriter using the specified stream- Parameters:
out
- a stream to write an index to
-
-
Method Details
-
write
Writes the specified index to the associated output stream. This may be called multiple times in order to write multiple indexes.- Specified by:
write
in classIndexWriterImpl
- Parameters:
index
- the index to write to the streamversion
- the index file version- Returns:
- the number of bytes written to the stream
- Throws:
IOException
- if any i/o error occurs
-
writeStringTable
- Throws:
IOException
-
writeClassTable
- Throws:
IOException
-
positionOf
-
positionOf
-
writeClasses
- Throws:
IOException
-
writeAnnotationValues
private void writeAnnotationValues(PackedDataOutputStream stream, Collection<AnnotationValue> values) throws IOException - Throws:
IOException
-
writeAnnotationValue
private void writeAnnotationValue(PackedDataOutputStream stream, AnnotationValue value) throws IOException - Throws:
IOException
-
writeType
- Throws:
IOException
-
buildTables
-
buildAValueEntries
-
intern
-
addClassName
-
downgradeName
-