final class IndexWriterV2 extends IndexWriterImpl
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.Modifier and Type | Class and Description |
---|---|
(package private) static class |
IndexWriterV2.ReferenceEntry |
(package private) static class |
IndexWriterV2.ReferenceTable<T> |
Modifier and Type | Field and Description |
---|---|
private IndexWriterV2.ReferenceTable<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 static byte |
CLASS_EXTENDS_TYPE_TAG |
private static byte |
CLASS_TAG |
private static byte |
EMPTY_TYPE_TAG |
private static byte |
FIELD_TAG |
private static int |
HAS_ENCLOSING_METHOD |
private static int |
HAS_NESTING |
private static int |
MAGIC |
(package private) static int |
MAX_VERSION |
private static byte |
METHOD_PARAMATER_TAG |
private static byte |
METHOD_PARAMETER_TYPE_TAG |
private static byte |
METHOD_TAG |
(package private) static int |
MIN_VERSION |
private NameTable |
names |
private java.util.TreeMap<DotName,java.lang.Integer> |
nameTable |
private static int |
NO_ENCLOSING_METHOD |
private static int |
NO_NESTING |
private static byte |
NULL_TARGET_TAG |
private java.io.OutputStream |
out |
private static byte |
THROWS_TYPE_TAG |
private static byte |
TYPE_PARAMETER_BOUND_TAG |
private static byte |
TYPE_PARAMETER_TAG |
private IndexWriterV2.ReferenceTable<Type[]> |
typeListTable |
private IndexWriterV2.ReferenceTable<Type> |
typeTable |
Constructor and Description |
---|
IndexWriterV2(java.io.OutputStream out)
Constructs an IndexWriter using the specified stream
|
static final int MIN_VERSION
static final int MAX_VERSION
private static final int MAGIC
private static final byte NULL_TARGET_TAG
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 byte EMPTY_TYPE_TAG
private static final byte CLASS_EXTENDS_TYPE_TAG
private static final byte TYPE_PARAMETER_TAG
private static final byte TYPE_PARAMETER_BOUND_TAG
private static final byte METHOD_PARAMETER_TYPE_TAG
private static final byte THROWS_TYPE_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 static final int HAS_ENCLOSING_METHOD
private static final int NO_ENCLOSING_METHOD
private static final int NO_NESTING
private static final int HAS_NESTING
private final java.io.OutputStream out
private NameTable names
private java.util.TreeMap<DotName,java.lang.Integer> nameTable
private IndexWriterV2.ReferenceTable<AnnotationInstance> annotationTable
private IndexWriterV2.ReferenceTable<Type> typeTable
private IndexWriterV2.ReferenceTable<Type[]> typeListTable
IndexWriterV2(java.io.OutputStream out)
out
- a stream to write an index toint write(Index index, int version) throws java.io.IOException
write
in class IndexWriterImpl
index
- the index to write to the streamversion
- the index file versionjava.io.IOException
- if any i/o error occursprivate void writeStringTable(PackedDataOutputStream stream) throws java.io.IOException
java.io.IOException
private void writeByteTable(PackedDataOutputStream stream) throws java.io.IOException
java.io.IOException
private void writeTypeTable(PackedDataOutputStream stream) throws java.io.IOException
java.io.IOException
private void writeTypeListTable(PackedDataOutputStream stream) throws java.io.IOException
java.io.IOException
private void writeTypeListEntry(PackedDataOutputStream stream, Type[] types) throws java.io.IOException
java.io.IOException
private void writeMethodTable(PackedDataOutputStream stream, int version) throws java.io.IOException
java.io.IOException
private void writeFieldTable(PackedDataOutputStream stream) throws java.io.IOException
java.io.IOException
private void writeFieldEntry(PackedDataOutputStream stream, FieldInternal field) throws java.io.IOException
java.io.IOException
private void writeMethodEntry(PackedDataOutputStream stream, int version, MethodInternal method) throws java.io.IOException
java.io.IOException
private void writeAnnotation(PackedDataOutputStream stream, AnnotationInstance instance) throws java.io.IOException
java.io.IOException
private void writeAnnotationTarget(PackedDataOutputStream stream, AnnotationTarget target) throws java.io.IOException
java.io.IOException
private void writeTypeTarget(PackedDataOutputStream stream, TypeTarget typeTarget) throws java.io.IOException
java.io.IOException
private void writeTypeTargetFields(PackedDataOutputStream stream, byte tag, TypeTarget target) throws java.io.IOException
java.io.IOException
private void writeNameTable(PackedDataOutputStream stream) throws java.io.IOException
java.io.IOException
private int positionOf(java.lang.String string)
private int positionOf(byte[] bytes)
private int positionOf(MethodInternal method)
private int positionOf(FieldInternal field)
private int positionOf(DotName className)
private int positionOf(Type type)
private int positionOf(Type[] types)
private int positionOf(AnnotationInstance instance)
private boolean markWritten(Type[] types)
private boolean markWritten(AnnotationInstance annotation)
private void writeClasses(PackedDataOutputStream stream, Index index, int version) throws java.io.IOException
java.io.IOException
private void writeClassEntry(PackedDataOutputStream stream, ClassInfo clazz, int version) throws java.io.IOException
java.io.IOException
private void writeAnnotationValues(PackedDataOutputStream stream, java.util.Collection<AnnotationValue> values) throws java.io.IOException
java.io.IOException
private void writeAnnotationValue(PackedDataOutputStream stream, AnnotationValue value) throws java.io.IOException
java.io.IOException
private void writeReference(PackedDataOutputStream stream, Type type, boolean nullable) throws java.io.IOException
java.io.IOException
private void writeReferenceOrFull(PackedDataOutputStream stream, AnnotationInstance annotation) throws java.io.IOException
java.io.IOException
private void writeReference(PackedDataOutputStream stream, AnnotationInstance annotation) throws java.io.IOException
java.io.IOException
private void writeReferenceOrFull(PackedDataOutputStream stream, Type[] types) throws java.io.IOException
java.io.IOException
private void writeTypeEntry(PackedDataOutputStream stream, Type type) throws java.io.IOException
java.io.IOException
private void buildTables(Index index)
private void addClass(ClassInfo clazz)
private void addAnnotation(AnnotationInstance instance)
private void addAnnotationTarget(AnnotationTarget target)
private void addFieldList(FieldInternal[] fields)
private void deepIntern(FieldInternal field)
private void addMethodList(MethodInternal[] methods)
private void deepIntern(MethodInternal method)
private void addEnclosingMethod(ClassInfo.EnclosingMethodInfo enclosingMethod)
private void addTypeList(Type[] types)
private void addType(Type type)
private void buildAValueEntries(AnnotationValue value)
private java.lang.String addString(java.lang.String name)
private void addClassName(DotName name)