public interface ClassLibraryBuilder
extends java.io.Serializable
SortedClassLibraryBuilder
bundles all classloaders, all sourcefolders and all sources.
The OrderedClassLibraryBuilder
on the other hand keeps track of the order in which sourcetypes are added.Modifier and Type | Method and Description |
---|---|
JavaSource |
addSource(java.io.File file) |
JavaSource |
addSource(java.io.InputStream stream) |
JavaSource |
addSource(java.io.Reader reader)
Add the source content of the reader to the ClassLibrary and return the generated JavaSource
|
JavaSource |
addSource(java.net.URL url) |
JavaModule |
addSourceFolder(java.io.File sourceFolder) |
ClassLibraryBuilder |
appendClassLoader(java.lang.ClassLoader classLoader)
Append a classloader and return itself
|
ClassLibraryBuilder |
appendDefaultClassLoaders()
Add the defaultClassLoaders and return itse
|
ClassLibraryBuilder |
appendSource(java.io.File file) |
ClassLibraryBuilder |
appendSource(java.io.InputStream stream) |
ClassLibraryBuilder |
appendSource(java.io.Reader reader) |
ClassLibraryBuilder |
appendSource(java.net.URL url) |
ClassLibraryBuilder |
appendSourceFolder(java.io.File sourceFolder) |
ClassLibrary |
getClassLibrary()
Get the library based on the strategy of the implementation
|
ClassLibraryBuilder |
setDebugLexer(boolean debugLexer)
Set to
true to enable debug logging for the lexer |
ClassLibraryBuilder |
setDebugParser(boolean debugParser)
Set to
true to enable debug logging for the parser |
ClassLibraryBuilder |
setEncoding(java.lang.String encoding) |
ClassLibraryBuilder |
setErrorHander(ErrorHandler errorHandler)
Can handle ParseExceptions instead of crashing.
|
ClassLibraryBuilder |
setModelBuilderFactory(ModelBuilderFactory factory)
Define the
ModelBuilderFactory which the parsers should use to construct the JavaModel Objects |
ClassLibraryBuilder |
setModelWriterFactory(ModelWriterFactory factory)
Define the
ModelWriterFactory which is used by the classes when calling for the codeBlock. |
ClassLibraryBuilder appendClassLoader(java.lang.ClassLoader classLoader)
classLoader
- the classloader to addClassLibraryBuilder appendDefaultClassLoaders()
ClassLibraryBuilder appendSourceFolder(java.io.File sourceFolder)
sourceFolder
- the source folderClassLibraryBuilder appendSource(java.io.InputStream stream) throws java.io.IOException
stream
- the Java source as streamjava.io.IOException
- if an IOException is thrown, e.g. unsupported encodingClassLibraryBuilder appendSource(java.io.Reader reader)
reader
- the Java source as readerClassLibraryBuilder appendSource(java.net.URL url) throws java.io.IOException
url
- the Java source as URLjava.io.IOException
- if an IOException occursClassLibraryBuilder appendSource(java.io.File file) throws java.io.IOException
file
- the Java source as filejava.io.IOException
- if an IOException occursJavaSource addSource(java.io.InputStream stream) throws java.io.IOException
stream
- the Java source as streamjava.io.IOException
- if an IOException is thrown, e.g. unsupported encodingJavaSource addSource(java.io.Reader reader)
reader
- the Java source as readerJavaSource addSource(java.net.URL url) throws java.io.IOException
url
- the Java source as URLjava.io.IOException
- if an IOException occursJavaSource addSource(java.io.File file) throws java.io.IOException
file
- the Java source as filejava.io.IOException
- if an IOException occursClassLibraryBuilder setDebugLexer(boolean debugLexer)
true
to enable debug logging for the lexerdebugLexer
- the debug logging flagClassLibraryBuilder setDebugParser(boolean debugParser)
true
to enable debug logging for the parserdebugParser
- the debug logging flagClassLibraryBuilder setEncoding(java.lang.String encoding)
encoding
- set the encodingClassLibraryBuilder setModelBuilderFactory(ModelBuilderFactory factory)
ModelBuilderFactory
which the parsers should use to construct the JavaModel Objectsfactory
- the modelBuilderFactoryClassLibraryBuilder setModelWriterFactory(ModelWriterFactory factory)
ModelWriterFactory
which is used by the classes when calling for the codeBlock.factory
- the modelWriterFactoryClassLibrary getClassLibrary()
ClassLibraryBuilder setErrorHander(ErrorHandler errorHandler)
errorHandler
- the errorHandlerJavaModule addSourceFolder(java.io.File sourceFolder)
sourceFolder
- the sourcefoldernull