Class SourceCodeProviderProxy
java.lang.Object
io.github.mmm.code.base.loader.SourceCodeProviderProxy
- All Implemented Interfaces:
SourceCodeProvider, AutoCloseable
Implementation of
SourceCodeProvider for lazy instantiation.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Constructor Summary
ConstructorsConstructorDescriptionSourceCodeProviderProxy(Supplier<SourceCodeProvider> supplier) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()openPackage(String qualifiedName) scanPackage(String qualifiedName)
-
Constructor Details
-
SourceCodeProviderProxy
The constructor.- Parameters:
supplier- theSupplierfor the actualSourceCodeProvider.
-
-
Method Details
-
getDelegate
- Returns:
- the delegate
-
openType
- Specified by:
openTypein interfaceSourceCodeProvider- Parameters:
qualifiedName- the qualified name of theCodeTypeto open.- Returns:
- a new
Readerto read the source-code from ornullif the requested type was not found. - Throws:
IOException- on I/O error.- See Also:
-
openPackage
- Specified by:
openPackagein interfaceSourceCodeProvider- Parameters:
qualifiedName- the qualified name of theCodePackageto open.- Returns:
- a new
Readerto read the source-code from ornullif the requested package was not found. - Throws:
IOException- on I/O error.
-
scanPackage
- Specified by:
scanPackagein interfaceSourceCodeProvider- Parameters:
qualifiedName- the qualified name of theCodePackageto scan.- Returns:
- a
Listwith thesimple namesof theCodeTypes in the specified package ornullif scan is not supported. - Throws:
IOException- on I/O error.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSourceCodeProvider
-