Class SisuIndex

  • All Implemented Interfaces:
    ClassVisitor, SpaceVisitor

    public class SisuIndex
    extends java.lang.Object
    implements SpaceVisitor, ClassVisitor
    Command-line utility that generates a qualified class index for a space-separated list of JARs.

    The index consists of qualified class names listed in META-INF/sisu/javax.inject.Named.

    See Also:
    sisu-maven-plugin
    • Constructor Summary

      Constructors 
      Constructor Description
      SisuIndex​(java.io.File targetDirectory)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addClassToIndex​(java.lang.Object anno, java.lang.Object clazz)
      Adds a new annotated class entry to the index.
      void enterClass​(int modifiers, java.lang.String name, java.lang.String _extends, java.lang.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 java.io.Reader getReader​(java.lang.String path)
      Creates a new reader for the given input path.
      protected java.io.Writer getWriter​(java.lang.String path)
      Creates a new writer for the given output path.
      void index​(ClassSpace _space)  
      protected void info​(java.lang.String message)
      Reports an informational message.
      void leaveClass()
      Leaves the class definition.
      void leaveSpace()
      Leaves the class space.
      static void main​(java.lang.String[] args)  
      AnnotationVisitor visitAnnotation​(java.lang.String desc)
      Visits an annotation declared on the class.
      ClassVisitor visitClass​(java.net.URL url)
      Visits a class resource in the class space.
      protected void warn​(java.lang.String message)
      Reports a warning message.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SisuIndex

        public SisuIndex​(java.io.File targetDirectory)
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
      • index

        public final void index​(ClassSpace _space)
      • enterSpace

        public final void enterSpace​(ClassSpace _space)
        Description copied from interface: SpaceVisitor
        Enters the class space.
        Specified by:
        enterSpace in interface SpaceVisitor
        Parameters:
        _space - The class space
      • visitClass

        public final ClassVisitor visitClass​(java.net.URL url)
        Description copied from interface: SpaceVisitor
        Visits a class resource in the class space.
        Specified by:
        visitClass in interface SpaceVisitor
        Parameters:
        url - The class resource URL
        Returns:
        Class visitor; null if it is not interested in visiting the class
      • enterClass

        public final void enterClass​(int modifiers,
                                     java.lang.String name,
                                     java.lang.String _extends,
                                     java.lang.String[] _implements)
        Description copied from interface: ClassVisitor
        Enters the class definition.
        Specified by:
        enterClass in interface ClassVisitor
        Parameters:
        modifiers - The access modifiers
        name - The internal name, such as "javax/inject/Provider"
        _extends - Extends this superclass
        _implements - Implements these interfaces
      • visitAnnotation

        public final AnnotationVisitor visitAnnotation​(java.lang.String desc)
        Description copied from interface: ClassVisitor
        Visits an annotation declared on the class.
        Specified by:
        visitAnnotation in interface ClassVisitor
        Parameters:
        desc - The JVM descriptor for the annotation class, such as "Ljavax/inject/Qualifier;"
        Returns:
        Annotation visitor; null if it is not interested in visiting the annotation
        See Also:
        SpaceScanner.jvmDescriptor(Class)
      • leaveClass

        public final void leaveClass()
        Description copied from interface: ClassVisitor
        Leaves the class definition.
        Specified by:
        leaveClass in interface ClassVisitor
      • leaveSpace

        public final void leaveSpace()
        Description copied from interface: SpaceVisitor
        Leaves the class space.
        Specified by:
        leaveSpace in interface SpaceVisitor
      • info

        protected void info​(java.lang.String message)
        Reports an informational message.
        Parameters:
        message - The message
      • warn

        protected void warn​(java.lang.String message)
        Reports a warning message.
        Parameters:
        message - The message
      • getReader

        protected java.io.Reader getReader​(java.lang.String path)
                                    throws java.io.IOException
        Creates a new reader for the given input path.
        Parameters:
        path - The input path
        Returns:
        The relevant reader
        Throws:
        java.io.IOException
      • getWriter

        protected java.io.Writer getWriter​(java.lang.String path)
                                    throws java.io.IOException
        Creates a new writer for the given output path.
        Parameters:
        path - The output path
        Returns:
        The relevant writer
        Throws:
        java.io.IOException
      • addClassToIndex

        protected final void addClassToIndex​(java.lang.Object anno,
                                             java.lang.Object clazz)
        Adds a new annotated class entry to the index.
        Parameters:
        anno - The annotation name
        clazz - The class name
      • flushIndex

        protected final void flushIndex()
        Writes the current index as a series of tables.