public final class Indexer extends Object
The Indexer operates on input streams that point to class file data. Input streams do not need to be buffered, as the indexer already does this. There is also no limit to the number of class file streams the indexer can process, other than available memory.
The Indexer attempts to minimize the final memory state of the index, but to do this it must maintain additional in-process state (intern tables etc) until the index is complete.
Numerous optimizations are taken during indexing to attempt to minimize the CPU and I/O cost, however, the Java class file format was not designed for partial searching, which ultimately limits the efficiency of processing them.
Thread-Safety This class is not thread-safe can not be shared between threads. The index it produces however is thread-safe.
| Constructor and Description |
|---|
Indexer() |
| Modifier and Type | Method and Description |
|---|---|
Index |
complete()
Completes, finalizes, and returns the index after zero or more calls to
index(). |
void |
index(InputStream stream)
Analyze and index the class file data present in given input
stream. |
ClassInfo |
index$$bridge(InputStream stream) |
void |
indexClass(Class<?> clazz)
Analyze and index the class file data of given
clazz. |
ClassInfo |
indexClass$$bridge(Class<?> clazz) |
ClassSummary |
indexWithSummary(InputStream stream)
Analyze and index the class file data present in given input
stream. |
public void indexClass(Class<?> clazz) throws IOException
clazz.
Each call adds information to the final complete index.clazz - a previously-loaded classIOException - if the class file data is corrupt or the underlying stream failsIllegalArgumentException - if clazz is nullpublic ClassInfo indexClass$$bridge(Class<?> clazz) throws IOException
IOExceptionpublic void index(InputStream stream) throws IOException
stream.
Each call adds information to the final complete index. Closing the input stream
is the caller's responsibility.stream - the class bytecode to index, must not be nullIOException - if the class file data is corrupt or the stream failsIllegalArgumentException - if stream is nullpublic ClassInfo index$$bridge(InputStream stream) throws IOException
IOExceptionpublic ClassSummary indexWithSummary(InputStream stream) throws IOException
stream.
Each call adds information to the final complete index. Closing the input stream
is the caller's responsibility.
For reporting progress in batch indexers, this variant of index returns
a summary of the just-indexed class.
stream - the class bytecode to index, must not be nullIOException - if the class file data is corrupt or the stream failsIllegalArgumentException - if stream is nullpublic Index complete()
index(). Future calls to index() will result in a new index.Copyright © 2018–2022. All rights reserved.