Class GraalVmProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.apache.logging.log4j.core.config.plugins.processor.GraalVmProcessor
- All Implemented Interfaces:
Processor
@SupportedAnnotationTypes({"org.apache.logging.log4j.core.config.plugins.validation.Constraint","org.apache.logging.log4j.core.config.plugins.Plugin","org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute","org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory","org.apache.logging.log4j.core.config.plugins.PluginConfiguration","org.apache.logging.log4j.core.config.plugins.PluginElement","org.apache.logging.log4j.core.config.plugins.PluginFactory","org.apache.logging.log4j.core.config.plugins.PluginLoggerContext","org.apache.logging.log4j.core.config.plugins.PluginNode","org.apache.logging.log4j.core.config.plugins.PluginValue","org.apache.logging.log4j.core.config.plugins.PluginVisitorStrategy"})
@SupportedOptions({"log4j.graalvm.groupId","log4j.graalvm.artifactId"})
public class GraalVmProcessor
extends AbstractProcessor
Java annotation processor that generates GraalVM metadata.
Note: The annotations listed here must also be classified by the Annotations helper.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Annotations(package private) static final String(package private) static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate final Map<String, ReachabilityMetadata.Type> Fields inherited from class AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddField(TypeElement parent, VariableElement element) private voidaddMethod(TypeElement parent, ExecutableElement element) (package private) StringgetReachabilityMetadataPath(@Nullable String groupId, @Nullable String artifactId, String fallbackFolderName) Returns the path to the reachability metadata file.voidinit(ProcessingEnvironment processingEnv) booleanprocess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) private voidprocessConstraintOrVisitor(Element element, TypeElement annotation) private voidprocessFactory(Element element) private voidprocessParameter(Element element) private voidprocessPlugin(Element element) private <T extends Element>
Tprivate StringtoString(TypeElement element) Returns the fully qualified name of the element corresponding to aDeclaredType.private StringtoString(TypeMirror type) Returns the fully qualified name of a type.private voidMethods inherited from class AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, isInitialized
-
Field Details
-
GROUP_ID
- See Also:
-
ARTIFACT_ID
- See Also:
-
LOCATION_PREFIX
- See Also:
-
LOCATION_SUFFIX
- See Also:
-
PROCESSOR_NAME
-
reachableTypes
-
processedElements
-
annotationUtil
-
-
Constructor Details
-
GraalVmProcessor
public GraalVmProcessor()
-
-
Method Details
-
init
- Specified by:
initin interfaceProcessor- Overrides:
initin classAbstractProcessor
-
getSupportedSourceVersion
- Specified by:
getSupportedSourceVersionin interfaceProcessor- Overrides:
getSupportedSourceVersionin classAbstractProcessor
-
process
- Specified by:
processin interfaceProcessor- Specified by:
processin classAbstractProcessor
-
processPlugin
-
processConstraintOrVisitor
-
processParameter
-
processFactory
-
writeReachabilityMetadata
private void writeReachabilityMetadata() -
getReachabilityMetadataPath
String getReachabilityMetadataPath(@Nullable String groupId, @Nullable String artifactId, String fallbackFolderName) Returns the path to the reachability metadata file.If the groupId or artifactId is not specified, a warning is printed and a fallback folder name is used. The fallback folder name should be reproducible, but unique enough to avoid conflicts.
- Parameters:
groupId- The group ID of the plugin.artifactId- The artifact ID of the plugin.fallbackFolderName- The fallback folder name to use if groupId or artifactId is not specified.
-
addField
-
addMethod
-
safeCast
-
toString
Returns the fully qualified name of a type.- Parameters:
type- A Java type.
-
toString
Returns the fully qualified name of the element corresponding to aDeclaredType.- Parameters:
element- A Java language element.
-