Class FilerProcessor
- java.lang.Object
-
- io.microsphere.annotation.processor.FilerProcessor
-
public class FilerProcessor extends java.lang.ObjectA processor class that provides safe and exception-handled operations for interacting with theFilerin an annotation processing environment. This class wraps calls to the underlyingFilerinstance obtained from the providedProcessingEnvironment, ensuring robust resource handling and simplifying error management through functional interfaces.It supports executing operations on the
Filerusing 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.JavaFileManagergetJavaFileManager()Get theJavaFileManager<T> TprocessInFiler(ThrowableFunction<javax.annotation.processing.Filer,T> filerCallback)<T> TprocessInFiler(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
-
-