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
@Component(role=MojoDescriptorExtractor.class,
hint="java-javadoc")
public class JavaJavadocMojoDescriptorExtractor
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements MojoDescriptorExtractor, JavadocMojoAnnotation
Extracts Mojo descriptors from Java sources.
For more information about the usage tag, have a look to: http://maven.apache.org/developers/mojo-api-specification.html- See Also:
-
MojoDescriptor
-
Field Summary
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
Fields inherited from interface org.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor
ROLE
-
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) 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
-
Constructor Details
-
JavaJavadocMojoDescriptorExtractor
public JavaJavadocMojoDescriptorExtractor()
-
-
Method Details
-
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.
- 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
-