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 java
.
- See Also:
-
MojoDescriptor
-
Field Summary
FieldsFields 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.maven.plugin.descriptor.MojoDescriptor
createMojoDescriptor
(com.thoughtworks.qdox.model.JavaClass javaClass) protected Collection<com.thoughtworks.qdox.model.JavaClass>
discoverClasses
(PluginToolsRequest request) List<org.apache.maven.plugin.descriptor.MojoDescriptor>
execute
(PluginToolsRequest request) Execute the mojo extraction.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, String tagName) private static boolean
getBooleanTagValue
(com.thoughtworks.qdox.model.JavaClass javaClass, String tagName, boolean defaultValue) private static boolean
getBooleanTagValue
(com.thoughtworks.qdox.model.JavaClass javaClass, String tagName, boolean defaultForTag, boolean defaultValue) Returns theGroupKey
of extractor, asMojoScanner
will execute them grouped, and ordered within groups.getName()
Returns the "name" (id) of the extractor.boolean
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 Details
-
NAME
- See Also:
-
GROUP_KEY
-
-
Constructor Details
-
JavaJavadocMojoDescriptorExtractor
public JavaJavadocMojoDescriptorExtractor()
-
-
Method Details
-
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
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, String tagName, boolean defaultValue) - Parameters:
javaClass
- not nulltagName
- not nulldefaultValue
- the wanted default value- Returns:
- the boolean value of the given tagName
- See Also:
-
getBooleanTagValue
private static boolean getBooleanTagValue(com.thoughtworks.qdox.model.JavaClass javaClass, 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
private static com.thoughtworks.qdox.model.DocletTag findInClassHierarchy(com.thoughtworks.qdox.model.JavaClass javaClass, 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 Map<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 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 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
-