Class FilerProcessor
- java.lang.Object
-
- io.microsphere.annotation.processor.FilerProcessor
-
public class FilerProcessor extends java.lang.Object
A processor class that provides safe and exception-handled operations for interacting with theFiler
in an annotation processing environment. This class wraps calls to the underlyingFiler
instance obtained from the providedProcessingEnvironment
, ensuring robust resource handling and simplifying error management through functional interfaces.It supports executing operations on the
Filer
using a callback model, allowing custom logic to be applied while handling exceptions gracefully using provided handlers.- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
processInFiler(ThrowableFunction)
,processInFiler(ThrowableFunction, BiFunction)
-
-
Constructor Summary
Constructors Constructor Description FilerProcessor(javax.annotation.processing.ProcessingEnvironment processingEnv)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.tools.JavaFileManager
getJavaFileManager()
Get theJavaFileManager
<T> T
processInFiler(ThrowableFunction<javax.annotation.processing.Filer,T> filerCallback)
<T> T
processInFiler(ThrowableFunction<javax.annotation.processing.Filer,T> filerCallback, java.util.function.BiFunction<javax.annotation.processing.Filer,java.lang.Throwable,T> exceptionHandler)
-
-
-
Method Detail
-
processInFiler
public <T> T processInFiler(ThrowableFunction<javax.annotation.processing.Filer,T> filerCallback)
-
processInFiler
public <T> T processInFiler(ThrowableFunction<javax.annotation.processing.Filer,T> filerCallback, java.util.function.BiFunction<javax.annotation.processing.Filer,java.lang.Throwable,T> exceptionHandler)
-
getJavaFileManager
public javax.tools.JavaFileManager getJavaFileManager()
Get theJavaFileManager
- Returns:
- the
JavaFileManager
-
-