public class SisuIndex extends Object implements SpaceVisitor, ClassVisitor
The index consists of qualified class names listed in META-INF/sisu/javax.inject.Named
.
NON_INSTANTIABLE
Modifier and Type | Method and Description |
---|---|
protected void |
addClassToIndex(Object anno,
Object clazz)
Adds a new annotated class entry to the index.
|
void |
enterClass(int modifiers,
String name,
String _extends,
String[] _implements)
Enters the class definition.
|
void |
enterSpace(ClassSpace _space)
Enters the class space.
|
protected void |
flushIndex()
Writes the current index as a series of tables.
|
protected Reader |
getReader(String path)
Creates a new reader for the given input path.
|
protected Writer |
getWriter(String path)
Creates a new writer for the given output path.
|
void |
index(ClassSpace _space) |
protected void |
info(String message)
Reports an informational message.
|
void |
leaveClass()
Leaves the class definition.
|
void |
leaveSpace()
Leaves the class space.
|
static void |
main(String[] args) |
AnnotationVisitor |
visitAnnotation(String desc)
Visits an annotation declared on the class.
|
ClassVisitor |
visitClass(URL url)
Visits a class resource in the class space.
|
protected void |
warn(String message)
Reports a warning message.
|
public SisuIndex(File targetDirectory)
public static void main(String[] args)
public final void index(ClassSpace _space)
public final void enterSpace(ClassSpace _space)
SpaceVisitor
enterSpace
in interface SpaceVisitor
_space
- The class spacepublic final ClassVisitor visitClass(URL url)
SpaceVisitor
visitClass
in interface SpaceVisitor
url
- The class resource URLnull
if it is not interested in visiting the classpublic final void enterClass(int modifiers, String name, String _extends, String[] _implements)
ClassVisitor
enterClass
in interface ClassVisitor
modifiers
- The access modifiersname
- The internal name, such as "javax/inject/Provider"_extends
- Extends this superclass_implements
- Implements these interfacespublic final AnnotationVisitor visitAnnotation(String desc)
ClassVisitor
visitAnnotation
in interface ClassVisitor
desc
- The JVM descriptor for the annotation class, such as "Ljavax/inject/Qualifier;"null
if it is not interested in visiting the annotationSpaceScanner.jvmDescriptor(Class)
public final void leaveClass()
ClassVisitor
leaveClass
in interface ClassVisitor
public final void leaveSpace()
SpaceVisitor
leaveSpace
in interface SpaceVisitor
protected void info(String message)
message
- The messageprotected void warn(String message)
message
- The messageprotected Reader getReader(String path) throws IOException
path
- The input pathIOException
protected Writer getWriter(String path) throws IOException
path
- The output pathIOException
protected final void addClassToIndex(Object anno, Object clazz)
anno
- The annotation nameclazz
- The class nameprotected final void flushIndex()
Copyright © 2019. All rights reserved.