ftl.test.$$ComponentTestFixerTemplateftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rxmicro-annotation-processor Show documentation
Show all versions of rxmicro-annotation-processor Show documentation
The RxMicro Annotation Processor main module that contains the annotation processor classes.
<#include "../common-lib.javaftl">
<#-- -------------------------------------------------------------------------------------------------------- -->
public final class ${JAVA_CLASS_NAME} {
static {
final Module currentModule = ${JAVA_CLASS_NAME}.class.getModule();
currentModule.addExports("${PACKAGE_NAME}", getRuntimeModule());
}
public ${JAVA_CLASS_NAME}() {
final Module currentModule = getClass().getModule();
if (currentModule.isNamed()) {
Stream.concat(
Stream.of(
getClass().getClassLoader().getUnnamedModule()
),
Stream.of(
getRuntimeModule(),
getToolCommonModule()
).filter(m -> m.isNamed())
).forEach(moduleName -> currentModule.getPackages().forEach(packageName -> {
currentModule.addOpens(packageName, moduleName);
System.out.println(format(
"opens ?/? to ?",
currentModule.getName(),
packageName,
moduleName.isNamed() ? moduleName.getName() : "ALL-UNNAMED")
);
}));
}
}
}