Class JavaJavadocMojoDescriptorExtractor
- java.lang.Object
-
- org.codehaus.plexus.logging.AbstractLogEnabled
-
- org.apache.maven.tools.plugin.extractor.javadoc.JavaJavadocMojoDescriptorExtractor
-
- All Implemented Interfaces:
JavadocMojoAnnotation
,MojoDescriptorExtractor
,org.codehaus.plexus.logging.LogEnabled
@Named("java-javadoc") @Singleton public class JavaJavadocMojoDescriptorExtractor extends org.codehaus.plexus.logging.AbstractLogEnabled implements MojoDescriptorExtractor, JavadocMojoAnnotation
Extracts Mojo descriptors from Java source javadoc comments only. New mojos should rather rely on annotations and comments which are evaluated by extractor named
For more information about the usage tag, have a look to: https://maven.apache.org/developers/mojo-api-specification.htmljava
.- See Also:
MojoDescriptor
-
-
Field Summary
Fields Modifier and Type Field Description private static GroupKey
GROUP_KEY
static java.lang.String
NAME
-
Fields inherited from interface org.apache.maven.tools.plugin.extractor.javadoc.JavadocMojoAnnotation
AGGREGATOR, COMPONENT, COMPONENT_ROLE, COMPONENT_ROLEHINT, CONFIGURATOR, DEPRECATED, DESCRIPTION, EXECUTE, EXECUTE_GOAL, EXECUTE_LIFECYCLE, EXECUTE_PHASE, EXECUTION_STATEGY, GOAL, IMPLEMENTATION, INHERIT_BY_DEFAULT, INSTANTIATION_STRATEGY, LANGUAGE, MULTI_EXECUTION_STRATEGY, PARAMETER, PARAMETER_ALIAS, PARAMETER_DEFAULT_VALUE, PARAMETER_EXPRESSION, PARAMETER_IMPLEMENTATION, PARAMETER_NAME, PARAMETER_PROPERTY, PHASE, READONLY, REQUIRED, REQUIRES_DEPENDENCY_COLLECTION, REQUIRES_DEPENDENCY_RESOLUTION, REQUIRES_DIRECT_INVOCATION, REQUIRES_ONLINE, REQUIRES_PROJECT, REQUIRES_REPORTS, SINCE, THREAD_SAFE
-
-
Constructor Summary
Constructors Constructor Description JavaJavadocMojoDescriptorExtractor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.maven.plugin.descriptor.MojoDescriptor
createMojoDescriptor(com.thoughtworks.qdox.model.JavaClass javaClass)
protected java.util.Collection<com.thoughtworks.qdox.model.JavaClass>
discoverClasses(PluginToolsRequest request)
java.util.List<org.apache.maven.plugin.descriptor.MojoDescriptor>
execute(PluginToolsRequest request)
Execute the mojo extraction.private java.util.Map<java.lang.String,com.thoughtworks.qdox.model.JavaField>
extractFieldParameterTags(com.thoughtworks.qdox.model.JavaClass javaClass)
extract fields that are either parameters or components.private void
extractParameters(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, com.thoughtworks.qdox.model.JavaClass javaClass)
private static com.thoughtworks.qdox.model.DocletTag
findInClassHierarchy(com.thoughtworks.qdox.model.JavaClass javaClass, java.lang.String tagName)
private static boolean
getBooleanTagValue(com.thoughtworks.qdox.model.JavaClass javaClass, java.lang.String tagName, boolean defaultValue)
private static boolean
getBooleanTagValue(com.thoughtworks.qdox.model.JavaClass javaClass, java.lang.String tagName, boolean defaultForTag, boolean defaultValue)
GroupKey
getGroupKey()
Returns theGroupKey
of extractor, asMojoScanner
will execute them grouped, and ordered within groups.java.lang.String
getName()
Returns the "name" (id) of the extractor.boolean
isDeprecated()
Returnstrue
if extractor is deprecated.protected void
validate(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor)
protected void
validateParameter(org.apache.maven.plugin.descriptor.Parameter parameter, int i)
-
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 java.lang.String NAME
- See Also:
- Constant Field Values
-
GROUP_KEY
private static final GroupKey GROUP_KEY
-
-
Method Detail
-
getName
public java.lang.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
-
validateParameter
protected void validateParameter(org.apache.maven.plugin.descriptor.Parameter parameter, int i) throws org.apache.maven.plugin.descriptor.InvalidParameterException
- Parameters:
parameter
- not nulli
- positive number- Throws:
org.apache.maven.plugin.descriptor.InvalidParameterException
- if any
-
createMojoDescriptor
protected org.apache.maven.plugin.descriptor.MojoDescriptor createMojoDescriptor(com.thoughtworks.qdox.model.JavaClass javaClass) throws org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
- Parameters:
javaClass
- not null- Returns:
- a mojo descriptor
- Throws:
org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
- if any
-
getBooleanTagValue
private static boolean getBooleanTagValue(com.thoughtworks.qdox.model.JavaClass javaClass, java.lang.String tagName, boolean defaultValue)
- Parameters:
javaClass
- not nulltagName
- not nulldefaultValue
- the wanted default value- Returns:
- the boolean value of the given tagName
- See Also:
findInClassHierarchy(JavaClass, String)
-
getBooleanTagValue
private static boolean getBooleanTagValue(com.thoughtworks.qdox.model.JavaClass javaClass, java.lang.String tagName, boolean defaultForTag, boolean defaultValue)
- Parameters:
javaClass
- not nulltagName
- not nulldefaultForTag
- The wanted default value when only the tagname is presentdefaultValue
- the wanted default value when the tag is not specified- Returns:
- the boolean value of the given tagName
- See Also:
findInClassHierarchy(JavaClass, String)
-
findInClassHierarchy
private static com.thoughtworks.qdox.model.DocletTag findInClassHierarchy(com.thoughtworks.qdox.model.JavaClass javaClass, java.lang.String tagName)
- Parameters:
javaClass
- not nulltagName
- not null- Returns:
- docletTag instance
-
extractParameters
private void extractParameters(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, com.thoughtworks.qdox.model.JavaClass javaClass) throws org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
- Parameters:
mojoDescriptor
- not nulljavaClass
- not null- Throws:
org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
- if any
-
extractFieldParameterTags
private java.util.Map<java.lang.String,com.thoughtworks.qdox.model.JavaField> extractFieldParameterTags(com.thoughtworks.qdox.model.JavaClass javaClass)
extract fields that are either parameters or components.- Parameters:
javaClass
- not null- Returns:
- map with Mojo parameters names as keys
-
execute
public java.util.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
-
discoverClasses
protected java.util.Collection<com.thoughtworks.qdox.model.JavaClass> discoverClasses(PluginToolsRequest request)
- Parameters:
request
- The plugin request.- Returns:
- an array of java class
-
validate
protected void validate(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor) throws org.apache.maven.plugin.descriptor.InvalidParameterException
- Parameters:
mojoDescriptor
- not null- Throws:
org.apache.maven.plugin.descriptor.InvalidParameterException
- if any
-
-