Interface ClassLibraryBuilder

    • Method Detail

      • appendClassLoader

        ClassLibraryBuilder appendClassLoader​(ClassLoader classLoader)
        Append a classloader and return itself
        Parameters:
        classLoader - the classloader to add
        Returns:
        this ClassLibraryBuilder instance
      • appendDefaultClassLoaders

        ClassLibraryBuilder appendDefaultClassLoaders()
        Add the defaultClassLoaders and return itse
        Returns:
        this ClassLibraryBuilder instance
      • appendSourceFolder

        ClassLibraryBuilder appendSourceFolder​(File sourceFolder)
        Parameters:
        sourceFolder - the source folder
        Returns:
        this ClassLibraryBuilder instance
      • appendSource

        ClassLibraryBuilder appendSource​(Reader reader)
        Parameters:
        reader - the Java source as reader
        Returns:
        this ClassLibraryBuilder instance
      • addSource

        JavaSource addSource​(InputStream stream)
                      throws IOException
        Parameters:
        stream - the Java source as stream
        Returns:
        the created JavaSource
        Throws:
        IOException - if an IOException is thrown, e.g. unsupported encoding
      • addSource

        JavaSource addSource​(Reader reader)
        Add the source content of the reader to the ClassLibrary and return the generated JavaSource
        Parameters:
        reader - the Java source as reader
        Returns:
        the created JavaSource
      • addSource

        JavaSource addSource​(URL url)
                      throws IOException
        Parameters:
        url - the Java source as URL
        Returns:
        the created JavaSource
        Throws:
        IOException - if an IOException occurs
      • addSource

        JavaSource addSource​(File file)
                      throws IOException
        Parameters:
        file - the Java source as file
        Returns:
        the created JavaSource
        Throws:
        IOException - if an IOException occurs
      • setDebugLexer

        ClassLibraryBuilder setDebugLexer​(boolean debugLexer)
        Set to true to enable debug logging for the lexer
        Parameters:
        debugLexer - the debug logging flag
        Returns:
        this ClassLibraryBuilder instance
      • setDebugParser

        ClassLibraryBuilder setDebugParser​(boolean debugParser)
        Set to true to enable debug logging for the parser
        Parameters:
        debugParser - the debug logging flag
        Returns:
        this ClassLibraryBuilder instance
      • setEncoding

        ClassLibraryBuilder setEncoding​(String encoding)
        Parameters:
        encoding - set the encoding
        Returns:
        this ClassLibraryBuilder instance
      • setModelBuilderFactory

        ClassLibraryBuilder setModelBuilderFactory​(ModelBuilderFactory factory)
        Define the ModelBuilderFactory which the parsers should use to construct the JavaModel Objects
        Parameters:
        factory - the modelBuilderFactory
        Returns:
        this ClassLibraryBuilder instance
      • setModelWriterFactory

        ClassLibraryBuilder setModelWriterFactory​(ModelWriterFactory factory)
        Define the ModelWriterFactory which is used by the classes when calling for the codeBlock.
        Parameters:
        factory - the modelWriterFactory
        Returns:
        this ClassLibraryBuilder instance
      • getClassLibrary

        ClassLibrary getClassLibrary()
        Get the library based on the strategy of the implementation
        Returns:
        the constructed ClassLibrary
      • setErrorHander

        ClassLibraryBuilder setErrorHander​(ErrorHandler errorHandler)
        Can handle ParseExceptions instead of crashing. Has only effect on the appendSource() methods
        Parameters:
        errorHandler - the errorHandler
        Returns:
        this ClassLibraryBuilder instance
      • addSourceFolder

        JavaModule addSourceFolder​(File sourceFolder)
        Parameters:
        sourceFolder - the sourcefolder
        Returns:
        the module info if the sourcefolder has a module-info.java, otherwise null
        Since:
        2.0