Class JavaAnnotationsMojoDescriptorExtractor
- java.lang.Object
-
- org.codehaus.plexus.logging.AbstractLogEnabled
-
- org.apache.maven.tools.plugin.extractor.annotations.JavaAnnotationsMojoDescriptorExtractor
-
- All Implemented Interfaces:
MojoDescriptorExtractor
,org.codehaus.plexus.logging.LogEnabled
@Named("java-annotations") @Singleton public class JavaAnnotationsMojoDescriptorExtractor extends org.codehaus.plexus.logging.AbstractLogEnabled implements MojoDescriptorExtractor
JavaMojoDescriptorExtractor, 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
-
-
Constructor Summary
Constructors Constructor Description JavaAnnotationsMojoDescriptorExtractor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,com.thoughtworks.qdox.model.JavaClass>
discoverClasses(com.thoughtworks.qdox.JavaProjectBuilder builder)
List<org.apache.maven.plugin.descriptor.MojoDescriptor>
execute(PluginToolsRequest request)
Execute the mojo extraction.protected void
extendJavaProjectBuilderWithSourcesJar(com.thoughtworks.qdox.JavaProjectBuilder builder, org.apache.maven.artifact.Artifact artifact, PluginToolsRequest request, String classifier)
protected MojoAnnotatedClass
findClassWithExecuteAnnotationInParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses)
protected List<ComponentAnnotationContent>
getComponentParent(MojoAnnotatedClass mojoAnnotatedClass, List<ComponentAnnotationContent> componentAnnotationContents, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses)
protected Map<String,ComponentAnnotationContent>
getComponentsParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses)
protected org.apache.maven.project.MavenProject
getFromProjectReferences(org.apache.maven.artifact.Artifact artifact, org.apache.maven.project.MavenProject project)
GroupKey
getGroupKey()
Returns theGroupKey
of extractor, asMojoScanner
will execute them grouped, and ordered within groups.String
getName()
Returns the "name" (id) of the extractor.protected List<ParameterAnnotationContent>
getParametersParent(MojoAnnotatedClass mojoAnnotatedClass, List<ParameterAnnotationContent> parameterAnnotationContents, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses)
protected Map<String,ParameterAnnotationContent>
getParametersParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses)
boolean
isDeprecated()
Returnstrue
if extractor is deprecated.protected void
populateDataFromJavadoc(com.thoughtworks.qdox.JavaProjectBuilder javaProjectBuilder, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses, Map<String,com.thoughtworks.qdox.model.JavaClass> javaClassesMap, JavadocLinkGenerator linkGenerator)
from sources scan to get @since and @deprecated and description of classes and fields.-
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor
getRequiredJavaVersion
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JavaAnnotationsMojoDescriptorExtractor
public JavaAnnotationsMojoDescriptorExtractor()
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:MojoDescriptorExtractor
Returns the "name" (id) of the extractor.- Specified by:
getName
in interfaceMojoDescriptorExtractor
-
isDeprecated
public boolean isDeprecated()
Description copied from interface:MojoDescriptorExtractor
Returnstrue
if extractor is deprecated.- Specified by:
isDeprecated
in interfaceMojoDescriptorExtractor
-
getGroupKey
public GroupKey getGroupKey()
Description copied from interface:MojoDescriptorExtractor
Returns theGroupKey
of extractor, asMojoScanner
will execute them grouped, and ordered within groups. Must never returnnull
.- Specified by:
getGroupKey
in interfaceMojoDescriptorExtractor
-
execute
public List<org.apache.maven.plugin.descriptor.MojoDescriptor> execute(PluginToolsRequest request) throws ExtractionException, org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
Description copied from interface:MojoDescriptorExtractor
Execute the mojo extraction.- Specified by:
execute
in interfaceMojoDescriptorExtractor
- Parameters:
request
- ThePluginToolsRequest
containing information for the extraction process.- Returns:
- a list of mojo descriptors. These may return HTML values for some fields.
- Throws:
ExtractionException
- if anyorg.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
- if any
-
populateDataFromJavadoc
protected void populateDataFromJavadoc(com.thoughtworks.qdox.JavaProjectBuilder javaProjectBuilder, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses, Map<String,com.thoughtworks.qdox.model.JavaClass> javaClassesMap, JavadocLinkGenerator linkGenerator)
from sources scan to get @since and @deprecated and description of classes and fields.
-
discoverClasses
protected Map<String,com.thoughtworks.qdox.model.JavaClass> discoverClasses(com.thoughtworks.qdox.JavaProjectBuilder builder)
-
extendJavaProjectBuilderWithSourcesJar
protected void extendJavaProjectBuilderWithSourcesJar(com.thoughtworks.qdox.JavaProjectBuilder builder, org.apache.maven.artifact.Artifact artifact, PluginToolsRequest request, String classifier) throws ExtractionException
- Throws:
ExtractionException
-
findClassWithExecuteAnnotationInParentHierarchy
protected MojoAnnotatedClass findClassWithExecuteAnnotationInParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses)
-
getParametersParentHierarchy
protected Map<String,ParameterAnnotationContent> getParametersParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses)
-
getParametersParent
protected List<ParameterAnnotationContent> getParametersParent(MojoAnnotatedClass mojoAnnotatedClass, List<ParameterAnnotationContent> parameterAnnotationContents, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses)
-
getComponentsParentHierarchy
protected Map<String,ComponentAnnotationContent> getComponentsParentHierarchy(MojoAnnotatedClass mojoAnnotatedClass, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses)
-
getComponentParent
protected List<ComponentAnnotationContent> getComponentParent(MojoAnnotatedClass mojoAnnotatedClass, List<ComponentAnnotationContent> componentAnnotationContents, Map<String,MojoAnnotatedClass> mojoAnnotatedClasses)
-
getFromProjectReferences
protected org.apache.maven.project.MavenProject getFromProjectReferences(org.apache.maven.artifact.Artifact artifact, org.apache.maven.project.MavenProject project)
-
-