Package io.determann.shadow.impl
Class ShadowApiImpl
java.lang.Object
io.determann.shadow.impl.ShadowApiImpl
- All Implemented Interfaces:
ApiHolder,DeclaredHolder,ShadowApi
-
Constructor Summary
ConstructorsConstructorDescriptionShadowApiImpl(ProcessingEnvironment processingEnv, RoundEnvironment roundEnv, int processingRound) -
Method Summary
Modifier and TypeMethodDescriptionstatic DeclaredConvince method that performs erasure on all declared types that support itgetAnnotatedWith(Annotation annotation) Looks up annotated elements in currently compiled code.getAnnotatedWith(String qualifiedAnnotation) Looks up annotated elements in currently compiled code.getApi()getDeclared(String qualifiedName) java.util.function.BiConsumer<ShadowApi,DiagnosticContext> getModuleOrThrow(String name) getPackage(Module module, String qualifiedPackageName) getPackage(String qualifiedModuleName, String qualifiedPackageName) getPackageOrThrow(Module module, String qualifiedPackageName) getPackageOrThrow(String qualifiedModuleName, String qualifiedPackageName) getPackages(String qualifiedName) a package is unique per module.intstarts at 0booleanFirst round of annotation processingbooleanLast round of annotation processingvoidvoidlogErrorAt(ElementBacked<?> elementBacked, String msg) voidvoidlogInfoAt(ElementBacked<?> elementBacked, String msg) voidlogWarning(String msg) voidlogWarningAt(ElementBacked<?> elementBacked, String msg) voidonNameRendered(java.util.function.Consumer<NameRenderedEvent> onNameRendered) readResource(StandardLocation location, String moduleAndPkg, String relativPath) voidall render methods produce qualified names except for the content ofjava.lang.voidall render methods produce qualified names default isShadowApi.renderNamesWithoutNeedingImports()voidall render methods produce simple names.voidsetDiagnosticHandler(java.util.function.BiConsumer<ShadowApi, DiagnosticContext> diagnosticHandler) Executed at the end of each round.voidsetExceptionHandler(java.util.function.BiConsumer<ShadowApi, Throwable> exceptionHandler) Consumer to handle exceptions that occur in this annotation processor.voidsetSystemErrorHandler(java.util.function.BiConsumer<ShadowApi, String> systemErrorHandler) SomeTooldon't supportSystem.err.voidsetSystemOutHandler(java.util.function.BiConsumer<ShadowApi, String> systemOutHandler) SomeTooldon't supportSystem.out.update(ProcessingEnvironment processingEnv, RoundEnvironment roundEnv, int processingRound) voidwriteClassFile(String qualifiedName, String content) the created file will be registered for the next annotation processor round. writes .class filesvoidwriteResource(StandardLocation location, String moduleAndPkg, String relativPath, String content) the created file will NOT be registered for the next annotation processor round. writes anythingvoidwriteSourceFile(String qualifiedName, String content) the created file will be registered for the next annotation processor round. writes .java filesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.determann.shadow.api.DeclaredHolder
getAnnotation, getAnnotationOrThrow, getAnnotations, getClass, getClasses, getClassOrThrow, getDeclaredOrThrow, getEnum, getEnumOrThrow, getEnums, getInterface, getInterfaceOrThrow, getInterfaces, getRecord, getRecordOrThrow, getRecords
-
Constructor Details
-
ShadowApiImpl
public ShadowApiImpl(ProcessingEnvironment processingEnv, RoundEnvironment roundEnv, int processingRound)
-
-
Method Details
-
update
public ShadowApi update(ProcessingEnvironment processingEnv, RoundEnvironment roundEnv, int processingRound) -
getJdkApiContext
- Specified by:
getJdkApiContextin interfaceShadowApi
-
getAnnotatedWith
Description copied from interface:ShadowApiLooks up annotated elements in currently compiled code.
Annotation processing happens in rounds. If a processor generates sources the next round will contain only these.- Specified by:
getAnnotatedWithin interfaceShadowApi- See Also:
-
getAnnotatedWith
Description copied from interface:ShadowApiLooks up annotated elements in currently compiled code.
Annotation processing happens in rounds. If a processor generates sources the next round will contain only these.- Specified by:
getAnnotatedWithin interfaceShadowApi- See Also:
-
getModules
- Specified by:
getModulesin interfaceShadowApi
-
getModule
-
getModuleOrThrow
- Specified by:
getModuleOrThrowin interfaceShadowApi
-
getPackages
Description copied from interface:ShadowApia package is unique per module. With multiple modules there can be multiple packages with the same name- Specified by:
getPackagesin interfaceShadowApi
-
getPackages
- Specified by:
getPackagesin interfaceShadowApi
-
getPackage
- Specified by:
getPackagein interfaceShadowApi
-
getPackageOrThrow
- Specified by:
getPackageOrThrowin interfaceShadowApi
-
getPackage
- Specified by:
getPackagein interfaceShadowApi
-
getPackageOrThrow
- Specified by:
getPackageOrThrowin interfaceShadowApi
-
getDeclared
- Specified by:
getDeclaredin interfaceDeclaredHolder
-
getDeclared
- Specified by:
getDeclaredin interfaceDeclaredHolder
-
getShadowFactory
- Specified by:
getShadowFactoryin interfaceShadowApi
-
getConstants
- Specified by:
getConstantsin interfaceShadowApi
-
logError
-
logInfo
-
logWarning
- Specified by:
logWarningin interfaceShadowApi
-
logErrorAt
- Specified by:
logErrorAtin interfaceShadowApi
-
logInfoAt
-
logWarningAt
- Specified by:
logWarningAtin interfaceShadowApi
-
writeSourceFile
Description copied from interface:ShadowApithe created file will be registered for the next annotation processor round. writes .java files- Specified by:
writeSourceFilein interfaceShadowApi
-
writeClassFile
Description copied from interface:ShadowApithe created file will be registered for the next annotation processor round. writes .class files- Specified by:
writeClassFilein interfaceShadowApi
-
writeResource
public void writeResource(StandardLocation location, String moduleAndPkg, String relativPath, String content) Description copied from interface:ShadowApithe created file will NOT be registered for the next annotation processor round. writes anything- Specified by:
writeResourcein interfaceShadowApi
-
readResource
public FileObject readResource(StandardLocation location, String moduleAndPkg, String relativPath) throws IOException - Specified by:
readResourcein interfaceShadowApi- Throws:
IOException
-
isProcessingOver
public boolean isProcessingOver()Description copied from interface:ShadowApiLast round of annotation processing- Specified by:
isProcessingOverin interfaceShadowApi
-
isFirstRound
public boolean isFirstRound()Description copied from interface:ShadowApiFirst round of annotation processing- Specified by:
isFirstRoundin interfaceShadowApi
-
getProcessingRound
public int getProcessingRound()Description copied from interface:ShadowApistarts at 0- Specified by:
getProcessingRoundin interfaceShadowApi
-
erasure
Description copied from interface:ShadowApiConvince method that performs erasure on all declared types that support it -
setExceptionHandler
public void setExceptionHandler(java.util.function.BiConsumer<ShadowApi, Throwable> exceptionHandler) Description copied from interface:ShadowApiConsumer to handle exceptions that occur in this annotation processor. If you want the compilation to stop because of it just throw any expedition.- Specified by:
setExceptionHandlerin interfaceShadowApi
-
getExceptionHandler
- Specified by:
getExceptionHandlerin interfaceShadowApi- See Also:
-
setDiagnosticHandler
public void setDiagnosticHandler(java.util.function.BiConsumer<ShadowApi, DiagnosticContext> diagnosticHandler) Description copied from interface:ShadowApiExecuted at the end of each round. When the processing is over each Processor gets called one more time withShadowApi.isProcessingOver()= true.- Specified by:
setDiagnosticHandlerin interfaceShadowApi
-
getDiagnosticHandler
- Specified by:
getDiagnosticHandlerin interfaceShadowApi- See Also:
-
setSystemOutHandler
Description copied from interface:ShadowApiSomeTooldon't supportSystem.out. By default, it is proxied and redirected to the logger as warning- Specified by:
setSystemOutHandlerin interfaceShadowApi
-
getSystemOutHandler
- Specified by:
getSystemOutHandlerin interfaceShadowApi- See Also:
-
setSystemErrorHandler
public void setSystemErrorHandler(java.util.function.BiConsumer<ShadowApi, String> systemErrorHandler) Description copied from interface:ShadowApiSomeTooldon't supportSystem.err. By default, it is proxied and redirected to the logger as error during- Specified by:
setSystemErrorHandlerin interfaceShadowApi
-
getSystemErrorHandler
- Specified by:
getSystemErrorHandlerin interfaceShadowApi- See Also:
-
getApi
-
renderQualifiedNames
public void renderQualifiedNames()Description copied from interface:ShadowApiall render methods produce qualified names default isShadowApi.renderNamesWithoutNeedingImports()- Specified by:
renderQualifiedNamesin interfaceShadowApi- See Also:
-
renderSimpleNames
public void renderSimpleNames()Description copied from interface:ShadowApiall render methods produce simple names. default isShadowApi.renderNamesWithoutNeedingImports()- Specified by:
renderSimpleNamesin interfaceShadowApi- See Also:
-
renderNamesWithoutNeedingImports
public void renderNamesWithoutNeedingImports()Description copied from interface:ShadowApiall render methods produce qualified names except for the content ofjava.lang. this is the default- Specified by:
renderNamesWithoutNeedingImportsin interfaceShadowApi- See Also:
-
onNameRendered
- Specified by:
onNameRenderedin interfaceShadowApi- See Also:
-
getRenderingContext
-