public class SortedClassLibraryBuilder extends Object implements ClassLibraryBuilder
Constructor and Description |
---|
SortedClassLibraryBuilder() |
Modifier and Type | Method and Description |
---|---|
JavaSource |
addSource(File file) |
JavaSource |
addSource(InputStream stream) |
JavaSource |
addSource(Reader reader)
Add the source content of the reader to the ClassLibrary and return the generated JavaSource
|
JavaSource |
addSource(URL url) |
JavaModule |
addSourceFolder(File sourceFolder) |
ClassLibraryBuilder |
appendClassLoader(ClassLoader classLoader)
Append a classloader and return itself
|
ClassLibraryBuilder |
appendDefaultClassLoaders()
Add the defaultClassLoaders and return itse
|
ClassLibraryBuilder |
appendSource(File file) |
ClassLibraryBuilder |
appendSource(InputStream stream) |
ClassLibraryBuilder |
appendSource(Reader reader) |
ClassLibraryBuilder |
appendSource(URL url) |
ClassLibraryBuilder |
appendSourceFolder(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(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 modelWriterFactory)
Define the
ModelWriterFactory which is used by the classes when calling for the codeBlock. |
public ClassLibraryBuilder appendClassLoader(ClassLoader classLoader)
ClassLibraryBuilder
appendClassLoader
in interface ClassLibraryBuilder
classLoader
- the classloader to addpublic ClassLibraryBuilder appendDefaultClassLoaders()
ClassLibraryBuilder
appendDefaultClassLoaders
in interface ClassLibraryBuilder
public ClassLibraryBuilder appendSourceFolder(File sourceFolder)
appendSourceFolder
in interface ClassLibraryBuilder
sourceFolder
- the source folderpublic ClassLibraryBuilder appendSource(InputStream stream) throws IOException
appendSource
in interface ClassLibraryBuilder
stream
- the Java source as streamIOException
- if an IOException is thrown, e.g. unsupported encodingpublic ClassLibraryBuilder appendSource(Reader reader)
appendSource
in interface ClassLibraryBuilder
reader
- the Java source as readerpublic ClassLibraryBuilder appendSource(URL url) throws IOException
appendSource
in interface ClassLibraryBuilder
url
- the Java source as URLIOException
- if an IOException occurspublic ClassLibraryBuilder appendSource(File file) throws IOException
appendSource
in interface ClassLibraryBuilder
file
- the Java source as fileIOException
- if an IOException occurspublic ClassLibraryBuilder setDebugLexer(boolean debugLexer)
ClassLibraryBuilder
true
to enable debug logging for the lexersetDebugLexer
in interface ClassLibraryBuilder
debugLexer
- the debug logging flagpublic ClassLibraryBuilder setDebugParser(boolean debugParser)
ClassLibraryBuilder
true
to enable debug logging for the parsersetDebugParser
in interface ClassLibraryBuilder
debugParser
- the debug logging flagpublic ClassLibraryBuilder setEncoding(String encoding)
setEncoding
in interface ClassLibraryBuilder
encoding
- set the encodingpublic ClassLibraryBuilder setErrorHander(ErrorHandler errorHandler)
ClassLibraryBuilder
setErrorHander
in interface ClassLibraryBuilder
errorHandler
- the errorHandlerpublic ClassLibraryBuilder setModelBuilderFactory(ModelBuilderFactory factory)
ClassLibraryBuilder
ModelBuilderFactory
which the parsers should use to construct the JavaModel ObjectssetModelBuilderFactory
in interface ClassLibraryBuilder
factory
- the modelBuilderFactorypublic ClassLibraryBuilder setModelWriterFactory(ModelWriterFactory modelWriterFactory)
ClassLibraryBuilder
ModelWriterFactory
which is used by the classes when calling for the codeBlock.setModelWriterFactory
in interface ClassLibraryBuilder
modelWriterFactory
- the modelWriterFactorypublic ClassLibrary getClassLibrary()
ClassLibraryBuilder
getClassLibrary
in interface ClassLibraryBuilder
public JavaSource addSource(InputStream stream) throws IOException
addSource
in interface ClassLibraryBuilder
stream
- the Java source as streamIOException
- if an IOException is thrown, e.g. unsupported encodingpublic JavaSource addSource(Reader reader)
ClassLibraryBuilder
addSource
in interface ClassLibraryBuilder
reader
- the Java source as readerpublic JavaSource addSource(URL url) throws IOException
addSource
in interface ClassLibraryBuilder
url
- the Java source as URLIOException
- if an IOException occurspublic JavaSource addSource(File file) throws IOException
addSource
in interface ClassLibraryBuilder
file
- the Java source as fileIOException
- if an IOException occurspublic JavaModule addSourceFolder(File sourceFolder)
addSourceFolder
in interface ClassLibraryBuilder
sourceFolder
- the sourcefoldernull
Copyright © 2002–2024. All rights reserved.