Top Description Fields Constructors Methods
org.jboss.jandex

public final Class Index

extends Object
implements IndexView
Class Inheritance
All Implemented Interfaces
org.jboss.jandex.IndexView
Imports
java.io.ByteArrayInputStream, .File, .FileFilter, .FileInputStream, .IOException, .InputStream, java.lang.reflect.Modifier, java.util.ArrayDeque, .ArrayList, .Arrays, .Collection, .Collections, .Enumeration, .HashMap, .HashSet, .Iterator, .List, .Map, .Queue, .Set, java.util.jar.JarEntry, .JarFile

An index useful for quickly processing annotations. The index is read-only and supports concurrent access. Also, the index is optimized for memory efficiency by using componentized DotName values.

It contains the following information:

  1. All annotations and a collection of targets they refer to
  2. All classes (including interfaces) scanned during the indexing process (typically all classes in a jar)
  3. All modules scanned during the indexing process (typically one module in a jar)
  4. All subclasses for each class known to this index
  5. All subinterfaces for each interface known to this index
  6. All implementors for each interface known to this index
  7. All users of each class known to this index
Author
Jason T. Greene

Field Summary

Modifier and TypeField and Description
pack-priv final Map<DotName, List<AnnotationInstance>>
pack-priv final Map<DotName, ClassInfo>
pack-priv volatile Map<DotName, Collection<ClassInfo>>
private static final List<AnnotationInstance>
private static final List<ClassInfo>
pack-priv final Map<DotName, List<ClassInfo>>
pack-priv final Map<DotName, ModuleInfo>
pack-priv static final DotName
pack-priv final Map<DotName, List<ClassInfo>>
pack-priv final Map<DotName, List<ClassInfo>>
pack-priv volatile Map<DotName, Set<DotName>>
pack-priv final Map<DotName, List<ClassInfo>>

Constructor Summary

AccessConstructor and Description
pack-priv
Index(Map<DotName, List<AnnotationInstance>> annotations, Map<DotName, List<ClassInfo>> subclasses, Map<DotName, List<ClassInfo>> subinterfaces, Map<DotName, List<ClassInfo>> implementors, Map<DotName, ClassInfo> classes, Map<DotName, ModuleInfo> modules, Map<DotName, List<ClassInfo>> users)

Method Summary

Modifier and TypeMethod and Description
public static Index

Returns:

the index
create
(Map<DotName, List<AnnotationInstance>>
A map to lookup annotation instances by class name
annotations
,
Map<DotName, List<ClassInfo>>
A map to lookup subclasses by super class name
subclasses
,
Map<DotName, List<ClassInfo>>
A map to lookup implementing classes by interface name
implementors
,
Map<DotName, ClassInfo>
A map to lookup classes by class name
classes
)

Constructs a "mock" Index using the passed values.

public static Index

Returns:

the index
create
(Map<DotName, List<AnnotationInstance>>
A map to lookup annotation instances by class name
annotations
,
Map<DotName, List<ClassInfo>>
A map to lookup subclasses by super class name
subclasses
,
Map<DotName, List<ClassInfo>>
A map to lookup implementing classes by interface name
implementors
,
Map<DotName, ClassInfo>
A map to lookup classes by class name
classes
,
Map<DotName, List<ClassInfo>>
A map to lookup class users
users
)

Constructs a "mock" Index using the passed values.

public static Index

Returns:

the index
create
(Map<DotName, List<AnnotationInstance>>
A map to lookup annotation instances by class name
annotations
,
Map<DotName, List<ClassInfo>>
A map to lookup subclasses by super class name
subclasses
,
Map<DotName, List<ClassInfo>>
A map to lookup subinterfaces by super interface name
subinterfaces
,
Map<DotName, List<ClassInfo>>
A map to lookup implementing classes by interface name
implementors
,
Map<DotName, ClassInfo>
A map to lookup classes by class name
classes
,
Map<DotName, List<ClassInfo>>
A map to lookup class users
users
)

Constructs a "mock" Index using the passed values.

public Set<ClassInfo>
getAllKnownImplementors(final DotName
The interface
interfaceName
)

Implements org.jboss.jandex.IndexView.getAllKnownImplementors.

Returns all known classes that implement the given interface, directly and indirectly.
public Collection<ClassInfo>
getAllKnownSubclasses(DotName
The class
className
)

Implements org.jboss.jandex.IndexView.getAllKnownSubclasses.

Returns all known (including non-direct) subclasses of the given class.
private void
getAllKnownSubClasses(DotName className, Set<ClassInfo> allKnown, Set<DotName> processedClasses)

private void
getAllKnownSubClasses(DotName name, Set<ClassInfo> allKnown, Set<DotName> subClassesToProcess, Set<DotName> processedClasses)

public Collection<ClassInfo>
getAllKnownSubinterfaces(DotName
The interace
interfaceName
)

Implements org.jboss.jandex.IndexView.getAllKnownSubinterfaces.

Returns all known interfaces that extend the given interface, directly and indirectly.
public List<AnnotationInstance>
getAnnotations(DotName
the name of the annotation to look for
annotationName
)

Implements org.jboss.jandex.IndexView.getAnnotations.

Obtains a list of instances for the specified annotation.
public Collection<AnnotationInstance>
getAnnotationsWithRepeatable(DotName
the name of the repeatable annotation
annotationName
,
IndexView
the index containing the annotation class
index
)

Implements org.jboss.jandex.IndexView.getAnnotationsWithRepeatable.

Obtains a list of instances for the specified annotation.
public ClassInfo
getClassByName(DotName
the name of the class
className
)

Implements org.jboss.jandex.IndexView.getClassByName.

Gets the class (or interface, or annotation) that was scanned during the indexing phase.
public Collection<ClassInfo>
getClassesInPackage(DotName
package name in the common, dot-separated form (e.g. com.example.foobar); null means the unnamed package
packageName
)

Implements org.jboss.jandex.IndexView.getClassesInPackage.

Returns all classes known to this index that are present in given package.
public Collection<ClassInfo>
getKnownClasses()

Implements org.jboss.jandex.IndexView.getKnownClasses.

Gets all known classes by this index (those which were scanned).
public List<ClassInfo>
getKnownDirectImplementors(DotName
the super class of the desired subclasses
className
)

Implements org.jboss.jandex.IndexView.getKnownDirectImplementors.

Gets all known direct implementors of the specified interface.
public List<ClassInfo>
getKnownDirectSubclasses(DotName
the super class of the desired subclasses
className
)

Implements org.jboss.jandex.IndexView.getKnownDirectSubclasses.

Gets all known direct subclasses of the specified class.
public List<ClassInfo>
getKnownDirectSubinterfaces(DotName
the super interface of the desired subinterfaces
interfaceName
)

Implements org.jboss.jandex.IndexView.getKnownDirectSubinterfaces.

Gets all known direct subinterfaces of the specified interface.
private void
getKnownImplementors(DotName name, Set<ClassInfo> allKnown, Set<DotName> subInterfacesToProcess, Set<DotName> processedClasses)

public Collection<ModuleInfo>
getKnownModules()

Implements org.jboss.jandex.IndexView.getKnownModules.

Gets all known modules by this index (those which were scanned).
public List<ClassInfo>
getKnownUsers(DotName
the name of the class to look for
className
)

Implements org.jboss.jandex.IndexView.getKnownUsers.

Obtains a list of classes that use the specified class.
public ModuleInfo
getModuleByName(DotName
the name of the module
moduleName
)

Implements org.jboss.jandex.IndexView.getModuleByName.

Gets the module that was scanned during the indexing phase.
private Collection<AnnotationInstance>
getRepeatableAnnotations(DotName annotationName, DotName containingAnnotationName)

public Set<DotName>
getSubpackages(DotName
package name in the common, dot-separated form (e.g. com.example.foobar); null means the unnamed package
packageName
)

Implements org.jboss.jandex.IndexView.getSubpackages.

Returns a set of packages known to this index that are direct subpackages of given package.
public static Index

Returns:

the index
of
(Iterable<Class<?>>
Classes to index
classes
)

Constructs an Index of the passed classes.

public static Index

Returns:

the index
of
(Class<?>...
Classes to index
classes
)

Constructs an Index of the passed classes.

public static Index

Returns:

the index
of
(File...
class files, JAR files or directories containing class files to index
files
)

Constructs an Index of the passed files and directories.

public void
printAnnotations()

Print all annotations known by this index to stdout.

public void
printSubclasses()

Print all classes that have known subclasses, and all their subclasses

public static ClassInfo

Returns:

the corresponding ClassInfo
singleClass
(Class<?>
the class to index, must not be null
clazz
)

Creates a temporary Indexer, indexes given clazz, and returns the corresponding ClassInfo.

public static ClassInfo

Returns:

the corresponding ClassInfo
singleClass
(byte[]
the class bytecode to index, must not be null
classData
)

Creates a temporary Indexer, indexes given classData, and returns the corresponding ClassInfo.

public static ClassInfo

Returns:

the corresponding ClassInfo
singleClass
(InputStream
the class bytecode to index, must not be null
classData
)

Creates a temporary Indexer, indexes given classData, and returns the corresponding ClassInfo.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

annotationsback to summary
pack-priv final Map<DotName, List<AnnotationInstance>> annotations
classesback to summary
pack-priv final Map<DotName, ClassInfo> classes
classesInPackageback to summary
pack-priv volatile Map<DotName, Collection<ClassInfo>> classesInPackage
EMPTY_ANNOTATION_LISTback to summary
private static final List<AnnotationInstance> EMPTY_ANNOTATION_LIST
EMPTY_CLASSINFO_LISTback to summary
private static final List<ClassInfo> EMPTY_CLASSINFO_LIST
implementorsback to summary
pack-priv final Map<DotName, List<ClassInfo>> implementors
modulesback to summary
pack-priv final Map<DotName, ModuleInfo> modules
REPEATABLEback to summary
pack-priv static final DotName REPEATABLE
subclassesback to summary
pack-priv final Map<DotName, List<ClassInfo>> subclasses
subinterfacesback to summary
pack-priv final Map<DotName, List<ClassInfo>> subinterfaces
subpackagesback to summary
pack-priv volatile Map<DotName, Set<DotName>> subpackages
usersback to summary
pack-priv final Map<DotName, List<ClassInfo>> users

Constructor Detail

Indexback to summary
pack-priv Index(Map<DotName, List<AnnotationInstance>> annotations, Map<DotName, List<ClassInfo>> subclasses, Map<DotName, List<ClassInfo>> subinterfaces, Map<DotName, List<ClassInfo>> implementors, Map<DotName, ClassInfo> classes, Map<DotName, ModuleInfo> modules, Map<DotName, List<ClassInfo>> users)

Method Detail

createback to summary
public static Index create(Map<DotName, List<AnnotationInstance>> annotations, Map<DotName, List<ClassInfo>> subclasses, Map<DotName, List<ClassInfo>> implementors, Map<DotName, ClassInfo> classes)

Constructs a "mock" Index using the passed values. All passed values MUST NOT BE MODIFIED AFTER THIS CALL. Otherwise the resulting object would not conform to the contract outlined above. Also, to conform to the memory efficiency contract this method should be passed componentized DotNames, which all share common root instances. Of course for testing code this doesn't really matter.

Parameters
annotations:Map<DotName, List<AnnotationInstance>>

A map to lookup annotation instances by class name

subclasses:Map<DotName, List<ClassInfo>>

A map to lookup subclasses by super class name

implementors:Map<DotName, List<ClassInfo>>

A map to lookup implementing classes by interface name

classes:Map<DotName, ClassInfo>

A map to lookup classes by class name

Returns:Index

the index

createback to summary
public static Index create(Map<DotName, List<AnnotationInstance>> annotations, Map<DotName, List<ClassInfo>> subclasses, Map<DotName, List<ClassInfo>> implementors, Map<DotName, ClassInfo> classes, Map<DotName, List<ClassInfo>> users)

Constructs a "mock" Index using the passed values. All passed values MUST NOT BE MODIFIED AFTER THIS CALL. Otherwise the resulting object would not conform to the contract outlined above. Also, to conform to the memory efficiency contract this method should be passed componentized DotNames, which all share common root instances. Of course for testing code this doesn't really matter.

Parameters
annotations:Map<DotName, List<AnnotationInstance>>

A map to lookup annotation instances by class name

subclasses:Map<DotName, List<ClassInfo>>

A map to lookup subclasses by super class name

implementors:Map<DotName, List<ClassInfo>>

A map to lookup implementing classes by interface name

classes:Map<DotName, ClassInfo>

A map to lookup classes by class name

users:Map<DotName, List<ClassInfo>>

A map to lookup class users

Returns:Index

the index

createback to summary
public static Index create(Map<DotName, List<AnnotationInstance>> annotations, Map<DotName, List<ClassInfo>> subclasses, Map<DotName, List<ClassInfo>> subinterfaces, Map<DotName, List<ClassInfo>> implementors, Map<DotName, ClassInfo> classes, Map<DotName, List<ClassInfo>> users)

Constructs a "mock" Index using the passed values. All passed values MUST NOT BE MODIFIED AFTER THIS CALL. Otherwise the resulting object would not conform to the contract outlined above. Also, to conform to the memory efficiency contract this method should be passed componentized DotNames, which all share common root instances. Of course for testing code this doesn't really matter.

Parameters
annotations:Map<DotName, List<AnnotationInstance>>

A map to lookup annotation instances by class name

subclasses:Map<DotName, List<ClassInfo>>

A map to lookup subclasses by super class name

subinterfaces:Map<DotName, List<ClassInfo>>

A map to lookup subinterfaces by super interface name

implementors:Map<DotName, List<ClassInfo>>

A map to lookup implementing classes by interface name

classes:Map<DotName, ClassInfo>

A map to lookup classes by class name

users:Map<DotName, List<ClassInfo>>

A map to lookup class users

Returns:Index

the index

getAllKnownImplementorsback to summary
public Set<ClassInfo> getAllKnownImplementors(final DotName interfaceName)

Implements org.jboss.jandex.IndexView.getAllKnownImplementors.

Doc from org.jboss.jandex.IndexView.getAllKnownImplementors.

Returns all known classes that implement the given interface, directly and indirectly. This will return all classes that implement the interface and its subinterfaces, as well as subclasses of classes that implement the interface and its subinterfaces. (In short, it will return every class in the index that is assignable to the interface.)

Note that this method only returns classes. Unlike getKnownDirectImplementors(DotName), this method does not return subinterfaces of given interface.

Parameters
interfaceName:DotName

The interface

Returns:Set<ClassInfo>

All known implementors of the interface

Annotations
@Override
getAllKnownSubclassesback to summary
public Collection<ClassInfo> getAllKnownSubclasses(DotName className)

Implements org.jboss.jandex.IndexView.getAllKnownSubclasses.

Doc from org.jboss.jandex.IndexView.getAllKnownSubclasses.

Returns all known (including non-direct) subclasses of the given class. I.e., returns all known classes that are assignable to the given class.

Parameters
className:DotName

The class

Returns:Collection<ClassInfo>

All known subclasses

Annotations
@Override
getAllKnownSubClassesback to summary
private void getAllKnownSubClasses(DotName className, Set<ClassInfo> allKnown, Set<DotName> processedClasses)
getAllKnownSubClassesback to summary
private void getAllKnownSubClasses(DotName name, Set<ClassInfo> allKnown, Set<DotName> subClassesToProcess, Set<DotName> processedClasses)
getAllKnownSubinterfacesback to summary
public Collection<ClassInfo> getAllKnownSubinterfaces(DotName interfaceName)

Implements org.jboss.jandex.IndexView.getAllKnownSubinterfaces.

Doc from org.jboss.jandex.IndexView.getAllKnownSubinterfaces.

Returns all known interfaces that extend the given interface, directly and indirectly. I.e., returns every interface in the index that is assignable to the given interface.

Parameters
interfaceName:DotName

The interace

Returns:Collection<ClassInfo>

all known subinterfaces

Annotations
@Override
getAnnotationsback to summary
public List<AnnotationInstance> getAnnotations(DotName annotationName)

Implements org.jboss.jandex.IndexView.getAnnotations.

Doc from org.jboss.jandex.IndexView.getAnnotations.

Obtains a list of instances for the specified annotation. This is done using an O(1) lookup. Valid instance targets include field, method, parameter, and class.

Parameters
annotationName:DotName

the name of the annotation to look for

Returns:List<AnnotationInstance>

a non-null list of annotation instances

Annotations
@Override
getAnnotationsWithRepeatableback to summary
public Collection<AnnotationInstance> getAnnotationsWithRepeatable(DotName annotationName, IndexView index)

Implements org.jboss.jandex.IndexView.getAnnotationsWithRepeatable.

Doc from org.jboss.jandex.IndexView.getAnnotationsWithRepeatable.

Obtains a list of instances for the specified annotation. If the specified annotation is repeatable (JLS 9.6), the result also contains all values from all instances of the container annotation. In this case, the AnnotationInstance#target() returns the target of the container annotation instance.

Parameters
annotationName:DotName

the name of the repeatable annotation

index:IndexView

the index containing the annotation class

Returns:Collection<AnnotationInstance>

a non-null list of annotation instances

Annotations
@Override
getClassByNameback to summary
public ClassInfo getClassByName(DotName className)

Implements org.jboss.jandex.IndexView.getClassByName.

Doc from org.jboss.jandex.IndexView.getClassByName.

Gets the class (or interface, or annotation) that was scanned during the indexing phase.

Parameters
className:DotName

the name of the class

Returns:ClassInfo

information about the class or null if it is not known

Annotations
@Override
getClassesInPackageback to summary
public Collection<ClassInfo> getClassesInPackage(DotName packageName)

Implements org.jboss.jandex.IndexView.getClassesInPackage.

Doc from org.jboss.jandex.IndexView.getClassesInPackage.

Returns all classes known to this index that are present in given package. Classes present in subpackages of given package are not returned. Classes present in the unnamed package may be looked up using null as the package name. If this index does not contain any class in given package, returns an empty collection.

In the default Index implementation, this information is not stored in the index initially. Instead, an index of classes by package name is constructed on demand (on the first invocation of this method).

Parameters
packageName:DotName

package name in the common, dot-separated form (e.g. com.example.foobar); null means the unnamed package

Returns:Collection<ClassInfo>

immutable collection of classes present in given package, never null

Annotations
@Override
getKnownClassesback to summary
public Collection<ClassInfo> getKnownClasses()

Implements org.jboss.jandex.IndexView.getKnownClasses.

Doc from org.jboss.jandex.IndexView.getKnownClasses.

Gets all known classes by this index (those which were scanned).

Returns:Collection<ClassInfo>

a collection of known classes

Annotations
@Override
getKnownDirectImplementorsback to summary
public List<ClassInfo> getKnownDirectImplementors(DotName className)

Implements org.jboss.jandex.IndexView.getKnownDirectImplementors.

Doc from org.jboss.jandex.IndexView.getKnownDirectImplementors.

Gets all known direct implementors of the specified interface. A known direct implementor is one which was found during the scanning process; however, this is often not the complete universe of implementors, since typically indexes are constructed per jar. It is expected that several indexes will need to be searched when analyzing a jar that is a part of a complex multi-module/classloader environment (like an EE application server).

The list of implementors also includes direct subinterfaces. This is inconsistent with getAllKnownImplementors(DotName), which doesn't return subinterfaces.

Note that this will only pick up classes that directly implement given interface. It will not pick up classes implementing subinterfaces.

Parameters
className:DotName

the super class of the desired subclasses

Returns:List<ClassInfo>

a non-null list of all known subclasses of className

Annotations
@Override
getKnownDirectSubclassesback to summary
public List<ClassInfo> getKnownDirectSubclasses(DotName className)

Implements org.jboss.jandex.IndexView.getKnownDirectSubclasses.

Doc from org.jboss.jandex.IndexView.getKnownDirectSubclasses.

Gets all known direct subclasses of the specified class. A known direct subclass is one which was found during the scanning process; however, this is often not the complete universe of subclasses, since typically indexes are constructed per jar. It is expected that several indexes will need to be searched when analyzing a jar that is a part of a complex multi-module/classloader environment (like an EE application server).

Note that this will only pick up direct subclasses of the class. It will not pick up subclasses of subclasses.

Parameters
className:DotName

the super class of the desired subclasses

Returns:List<ClassInfo>

a non-null list of all known subclasses of className

Annotations
@Override
getKnownDirectSubinterfacesback to summary
public List<ClassInfo> getKnownDirectSubinterfaces(DotName interfaceName)

Implements org.jboss.jandex.IndexView.getKnownDirectSubinterfaces.

Doc from org.jboss.jandex.IndexView.getKnownDirectSubinterfaces.

Gets all known direct subinterfaces of the specified interface. A known direct subinterface is one which was found during the scanning process; however, this is often not the complete universe of subinterfaces, since typically indexes are constructed per jar. It is expected that several indexes will need to be searched when analyzing a jar that is a part of a complex multi-module/classloader environment (like an EE application server).

Note that this will only pick up direct subinterfaces of the interface. It will not pick up subinterfaces of subinterfaces.

Parameters
interfaceName:DotName

the super interface of the desired subinterfaces

Returns:List<ClassInfo>

a non-null list of all known subinterfaces of interfaceName

Annotations
@Override
getKnownImplementorsback to summary
private void getKnownImplementors(DotName name, Set<ClassInfo> allKnown, Set<DotName> subInterfacesToProcess, Set<DotName> processedClasses)
getKnownModulesback to summary
public Collection<ModuleInfo> getKnownModules()

Implements org.jboss.jandex.IndexView.getKnownModules.

Doc from org.jboss.jandex.IndexView.getKnownModules.

Gets all known modules by this index (those which were scanned).

Returns:Collection<ModuleInfo>

a collection of known modules

Annotations
@Override
getKnownUsersback to summary
public List<ClassInfo> getKnownUsers(DotName className)

Implements org.jboss.jandex.IndexView.getKnownUsers.

Doc from org.jboss.jandex.IndexView.getKnownUsers.

Obtains a list of classes that use the specified class. In other words, a list of classes that include a reference to the specified class in their constant pool.

Parameters
className:DotName

the name of the class to look for

Returns:List<ClassInfo>

a non-null list of classes that use the specified class

Annotations
@Override
getModuleByNameback to summary
public ModuleInfo getModuleByName(DotName moduleName)

Implements org.jboss.jandex.IndexView.getModuleByName.

Doc from org.jboss.jandex.IndexView.getModuleByName.

Gets the module that was scanned during the indexing phase.

Parameters
moduleName:DotName

the name of the module

Returns:ModuleInfo

information about the module or null if it is not known

Annotations
@Override
getRepeatableAnnotationsback to summary
private Collection<AnnotationInstance> getRepeatableAnnotations(DotName annotationName, DotName containingAnnotationName)
getSubpackagesback to summary
public Set<DotName> getSubpackages(DotName packageName)

Implements org.jboss.jandex.IndexView.getSubpackages.

Doc from org.jboss.jandex.IndexView.getSubpackages.

Returns a set of packages known to this index that are direct subpackages of given package. Indirect subpackages of given package (subpackages of subpackages) are not returned. If this index does not contain any class in a direct or indirect subpackage of given package, returns an empty collection.

Given that the unnamed package may not contain subpackages, passing null as the package name is permitted, but always results in an empty set.

In the default Index implementation, this information is not stored in the index initially. Instead, an index of packages is constructed on demand (on the first invocation of this method).

Parameters
packageName:DotName

package name in the common, dot-separated form (e.g. com.example.foobar); null means the unnamed package

Returns:Set<DotName>

immutable set of subpackages of given package, never null

Annotations
@Override
ofback to summary
public static Index of(Iterable<Class<?>> classes) throws IOException

Constructs an Index of the passed classes.

Parameters
classes:Iterable<Class<?>>

Classes to index

Returns:Index

the index

ofback to summary
public static Index of(Class<?>... classes) throws IOException

Constructs an Index of the passed classes.

Parameters
classes:Class<?>[]

Classes to index

Returns:Index

the index

ofback to summary
public static Index of(File... files) throws IOException

Constructs an Index of the passed files and directories. Files may be class files or JAR files. Directories are scanned for class files, but not recursively.

Parameters
files:File[]

class files, JAR files or directories containing class files to index

Returns:Index

the index

Exceptions
IllegalArgumentException:
if any passed File is null or not a class file, JAR file or directory
printAnnotationsback to summary
public void printAnnotations()

Print all annotations known by this index to stdout.

printSubclassesback to summary
public void printSubclasses()

Print all classes that have known subclasses, and all their subclasses

singleClassback to summary
public static ClassInfo singleClass(Class<?> clazz) throws IOException

Creates a temporary Indexer, indexes given clazz, and returns the corresponding ClassInfo.

Parameters
clazz:Class<?>

the class to index, must not be null

Returns:ClassInfo

the corresponding ClassInfo

singleClassback to summary
public static ClassInfo singleClass(byte[] classData) throws IOException

Creates a temporary Indexer, indexes given classData, and returns the corresponding ClassInfo.

Parameters
classData:byte[]

the class bytecode to index, must not be null

Returns:ClassInfo

the corresponding ClassInfo

singleClassback to summary
public static ClassInfo singleClass(InputStream classData) throws IOException

Creates a temporary Indexer, indexes given classData, and returns the corresponding ClassInfo. Closing the input stream is the caller's responsibility.

Parameters
classData:InputStream

the class bytecode to index, must not be null

Returns:ClassInfo

the corresponding ClassInfo