Class JavaAnnotationsMojoDescriptorExtractor
- java.lang.Object
-
- org.apache.maven.tools.plugin.extractor.annotations.JavaAnnotationsMojoDescriptorExtractor
-
- All Implemented Interfaces:
org.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor
@Named("java-annotations") @Singleton public class JavaAnnotationsMojoDescriptorExtractor extends java.lang.Object implements org.apache.maven.tools.plugin.extractor.MojoDescriptorExtractorJavaMojoDescriptorExtractor, a MojoDescriptor extractor to read descriptors from java classes with annotations. Notice that source files are also parsed to get description, since and deprecation information.- Since:
- 3.0
- Author:
- Olivier Lamy
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAME
-
Constructor Summary
Constructors Constructor Description JavaAnnotationsMojoDescriptorExtractor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,com.github.javaparser.ast.body.TypeDeclaration<?>>discoverClasses(JavaSourceModel sourceModel)java.util.List<org.apache.maven.plugin.descriptor.MojoDescriptor>execute(org.apache.maven.tools.plugin.PluginToolsRequest request)protected voidextendJavaSourceModelWithSourcesJar(JavaSourceModel sourceModel, org.apache.maven.artifact.Artifact artifact, org.apache.maven.tools.plugin.PluginToolsRequest request, java.lang.String classifier)protected MojoAnnotatedClassfindClassWithExecuteAnnotationInParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)protected java.util.List<AfterAnnotationContent>getAfterAnnotationsFromHierarchy(MojoAnnotatedClass mojoAnnotatedClass, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)Collects all@Afterannotations from the class hierarchy, starting from the most-derived class.protected java.util.List<ComponentAnnotationContent>getComponentParent(MojoAnnotatedClass mojoAnnotatedClass, java.util.List<ComponentAnnotationContent> componentAnnotationContents, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)protected java.util.Map<java.lang.String,ComponentAnnotationContent>getComponentsParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)protected org.apache.maven.project.MavenProjectgetFromProjectReferences(org.apache.maven.artifact.Artifact artifact, org.apache.maven.project.MavenProject project)org.apache.maven.tools.plugin.extractor.GroupKeygetGroupKey()java.lang.StringgetName()protected java.util.List<ParameterAnnotationContent>getParametersParent(MojoAnnotatedClass mojoAnnotatedClass, java.util.List<ParameterAnnotationContent> parameterAnnotationContents, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)protected java.util.Map<java.lang.String,ParameterAnnotationContent>getParametersParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)booleanisDeprecated()protected voidpopulateDataFromJavadoc(JavaSourceModel sourceModel, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses, java.util.Map<java.lang.String,com.github.javaparser.ast.body.TypeDeclaration<?>> javaClassesMap, org.apache.maven.tools.plugin.javadoc.JavadocLinkGenerator linkGenerator)from sources scan to get @since and @deprecated and description of classes and fields.
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceorg.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor
-
isDeprecated
public boolean isDeprecated()
- Specified by:
isDeprecatedin interfaceorg.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor
-
getGroupKey
public org.apache.maven.tools.plugin.extractor.GroupKey getGroupKey()
- Specified by:
getGroupKeyin interfaceorg.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor
-
execute
public java.util.List<org.apache.maven.plugin.descriptor.MojoDescriptor> execute(org.apache.maven.tools.plugin.PluginToolsRequest request) throws org.apache.maven.tools.plugin.extractor.ExtractionException, org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException- Specified by:
executein interfaceorg.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor- Throws:
org.apache.maven.tools.plugin.extractor.ExtractionExceptionorg.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
-
populateDataFromJavadoc
protected void populateDataFromJavadoc(JavaSourceModel sourceModel, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses, java.util.Map<java.lang.String,com.github.javaparser.ast.body.TypeDeclaration<?>> javaClassesMap, org.apache.maven.tools.plugin.javadoc.JavadocLinkGenerator linkGenerator)
from sources scan to get @since and @deprecated and description of classes and fields.
-
discoverClasses
protected java.util.Map<java.lang.String,com.github.javaparser.ast.body.TypeDeclaration<?>> discoverClasses(JavaSourceModel sourceModel)
-
extendJavaSourceModelWithSourcesJar
protected void extendJavaSourceModelWithSourcesJar(JavaSourceModel sourceModel, org.apache.maven.artifact.Artifact artifact, org.apache.maven.tools.plugin.PluginToolsRequest request, java.lang.String classifier) throws org.apache.maven.tools.plugin.extractor.ExtractionException, java.io.IOException
- Throws:
org.apache.maven.tools.plugin.extractor.ExtractionExceptionjava.io.IOException
-
findClassWithExecuteAnnotationInParentHierarchy
protected MojoAnnotatedClass findClassWithExecuteAnnotationInParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)
-
getAfterAnnotationsFromHierarchy
protected java.util.List<AfterAnnotationContent> getAfterAnnotationsFromHierarchy(MojoAnnotatedClass mojoAnnotatedClass, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)
Collects all@Afterannotations from the class hierarchy, starting from the most-derived class. Unlike@Execute,@Afteris repeatable, so multiple entries may exist on a single class and across the hierarchy.
-
getParametersParentHierarchy
protected java.util.Map<java.lang.String,ParameterAnnotationContent> getParametersParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)
-
getParametersParent
protected java.util.List<ParameterAnnotationContent> getParametersParent(MojoAnnotatedClass mojoAnnotatedClass, java.util.List<ParameterAnnotationContent> parameterAnnotationContents, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)
-
getComponentsParentHierarchy
protected java.util.Map<java.lang.String,ComponentAnnotationContent> getComponentsParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)
-
getComponentParent
protected java.util.List<ComponentAnnotationContent> getComponentParent(MojoAnnotatedClass mojoAnnotatedClass, java.util.List<ComponentAnnotationContent> componentAnnotationContents, java.util.Map<java.lang.String,MojoAnnotatedClass> mojoAnnotatedClasses)
-
getFromProjectReferences
protected org.apache.maven.project.MavenProject getFromProjectReferences(org.apache.maven.artifact.Artifact artifact, org.apache.maven.project.MavenProject project)
-
-