Package com.thoughtworks.qdox.library
Class SortedClassLibraryBuilder
java.lang.Object
com.thoughtworks.qdox.library.SortedClassLibraryBuilder
- All Implemented Interfaces:
ClassLibraryBuilder
,Serializable
- Since:
- 2.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassLoaderLibrary
private final ClassNameLibrary
private final SourceFolderLibrary
private final SourceLibrary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddSource
(InputStream stream) Add the source content of the reader to the ClassLibrary and return the generated JavaSourceaddSourceFolder
(File sourceFolder) appendClassLoader
(ClassLoader classLoader) Append a classloader and return itselfAdd the defaultClassLoaders and return itseappendSource
(File file) appendSource
(InputStream stream) appendSource
(Reader reader) appendSource
(URL url) appendSourceFolder
(File sourceFolder) Get the library based on the strategy of the implementationsetDebugLexer
(boolean debugLexer) Set totrue
to enable debug logging for the lexersetDebugParser
(boolean debugParser) Set totrue
to enable debug logging for the parsersetEncoding
(String encoding) setErrorHander
(ErrorHandler errorHandler) Can handle ParseExceptions instead of crashing.Define theModelBuilderFactory
which the parsers should use to construct the JavaModel ObjectssetModelWriterFactory
(ModelWriterFactory modelWriterFactory) Define theModelWriterFactory
which is used by the classes when calling for the codeBlock.
-
Field Details
-
classNameLibrary
-
classLoaderLibrary
-
sourceFolderLibrary
-
sourceLibrary
-
-
Constructor Details
-
SortedClassLibraryBuilder
public SortedClassLibraryBuilder()
-
-
Method Details
-
appendClassLoader
Description copied from interface:ClassLibraryBuilder
Append a classloader and return itself- Specified by:
appendClassLoader
in interfaceClassLibraryBuilder
- Parameters:
classLoader
- the classloader to add- Returns:
- this ClassLibraryBuilder instance
-
appendDefaultClassLoaders
Description copied from interface:ClassLibraryBuilder
Add the defaultClassLoaders and return itse- Specified by:
appendDefaultClassLoaders
in interfaceClassLibraryBuilder
- Returns:
- this ClassLibraryBuilder instance
-
appendSourceFolder
- Specified by:
appendSourceFolder
in interfaceClassLibraryBuilder
- Parameters:
sourceFolder
- the source folder- Returns:
- this ClassLibraryBuilder instance
-
appendSource
- Specified by:
appendSource
in interfaceClassLibraryBuilder
- Parameters:
stream
- the Java source as stream- Returns:
- this ClassLibraryBuilder instance
- Throws:
IOException
- if an IOException is thrown, e.g. unsupported encoding
-
appendSource
- Specified by:
appendSource
in interfaceClassLibraryBuilder
- Parameters:
reader
- the Java source as reader- Returns:
- this ClassLibraryBuilder instance
-
appendSource
- Specified by:
appendSource
in interfaceClassLibraryBuilder
- Parameters:
url
- the Java source as URL- Returns:
- this ClassLibraryBuilder instance
- Throws:
IOException
- if an IOException occurs
-
appendSource
- Specified by:
appendSource
in interfaceClassLibraryBuilder
- Parameters:
file
- the Java source as file- Returns:
- this ClassLibraryBuilder instance
- Throws:
IOException
- if an IOException occurs
-
setDebugLexer
Description copied from interface:ClassLibraryBuilder
Set totrue
to enable debug logging for the lexer- Specified by:
setDebugLexer
in interfaceClassLibraryBuilder
- Parameters:
debugLexer
- the debug logging flag- Returns:
- this ClassLibraryBuilder instance
-
setDebugParser
Description copied from interface:ClassLibraryBuilder
Set totrue
to enable debug logging for the parser- Specified by:
setDebugParser
in interfaceClassLibraryBuilder
- Parameters:
debugParser
- the debug logging flag- Returns:
- this ClassLibraryBuilder instance
-
setEncoding
- Specified by:
setEncoding
in interfaceClassLibraryBuilder
- Parameters:
encoding
- set the encoding- Returns:
- this ClassLibraryBuilder instance
-
setErrorHander
Description copied from interface:ClassLibraryBuilder
Can handle ParseExceptions instead of crashing. Has only effect on the appendSource() methods- Specified by:
setErrorHander
in interfaceClassLibraryBuilder
- Parameters:
errorHandler
- the errorHandler- Returns:
- this ClassLibraryBuilder instance
-
setModelBuilderFactory
Description copied from interface:ClassLibraryBuilder
Define theModelBuilderFactory
which the parsers should use to construct the JavaModel Objects- Specified by:
setModelBuilderFactory
in interfaceClassLibraryBuilder
- Parameters:
factory
- the modelBuilderFactory- Returns:
- this ClassLibraryBuilder instance
-
setModelWriterFactory
Description copied from interface:ClassLibraryBuilder
Define theModelWriterFactory
which is used by the classes when calling for the codeBlock.- Specified by:
setModelWriterFactory
in interfaceClassLibraryBuilder
- Parameters:
modelWriterFactory
- the modelWriterFactory- Returns:
- this ClassLibraryBuilder instance
-
getClassLibrary
Description copied from interface:ClassLibraryBuilder
Get the library based on the strategy of the implementation- Specified by:
getClassLibrary
in interfaceClassLibraryBuilder
- Returns:
- the constructed ClassLibrary
-
addSource
- Specified by:
addSource
in interfaceClassLibraryBuilder
- Parameters:
stream
- the Java source as stream- Returns:
- the created JavaSource
- Throws:
IOException
- if an IOException is thrown, e.g. unsupported encoding
-
addSource
Description copied from interface:ClassLibraryBuilder
Add the source content of the reader to the ClassLibrary and return the generated JavaSource- Specified by:
addSource
in interfaceClassLibraryBuilder
- Parameters:
reader
- the Java source as reader- Returns:
- the created JavaSource
-
addSource
- Specified by:
addSource
in interfaceClassLibraryBuilder
- Parameters:
url
- the Java source as URL- Returns:
- the created JavaSource
- Throws:
IOException
- if an IOException occurs
-
addSource
- Specified by:
addSource
in interfaceClassLibraryBuilder
- Parameters:
file
- the Java source as file- Returns:
- the created JavaSource
- Throws:
IOException
- if an IOException occurs
-
addSourceFolder
- Specified by:
addSourceFolder
in interfaceClassLibraryBuilder
- Parameters:
sourceFolder
- the sourcefolder- Returns:
- the module info if the sourcefolder has a module-info.java, otherwise
null
-