Class DefaultMojoAnnotationsScanner
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.apache.maven.tools.plugin.extractor.annotations.scanner.DefaultMojoAnnotationsScanner
- All Implemented Interfaces:
MojoAnnotationsScanner
,org.codehaus.plexus.logging.LogEnabled
@Named
@Singleton
public class DefaultMojoAnnotationsScanner
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements MojoAnnotationsScanner
Mojo scanner with java annotations.
- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
private static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
private org.codehaus.plexus.util.reflection.Reflector
private static final Pattern
Fields inherited from interface org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotationsScanner
CLASS_LEVEL_ANNOTATIONS, FIELD_LEVEL_ANNOTATIONS, METHOD_LEVEL_ANNOTATIONS, ROLE, V4_API_ANNOTATIONS_PACKAGE, V4_API_PLUGIN_PACKAGE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
analyzeClassStream
(Map<String, MojoAnnotatedClass> mojoAnnotatedClasses, InputStream is, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo, String source, String file) protected void
analyzeVisitors
(MojoClassVisitor mojoClassVisitor) protected void
populateAnnotationContent
(Object content, MojoAnnotationVisitor mojoAnnotationVisitor) protected void
scan
(Map<String, MojoAnnotatedClass> mojoAnnotatedClasses, File source, List<String> includePatterns, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo) scan
(MojoAnnotationsScannerRequest request) Scan classes for mojo annotations.protected Map
<String, MojoAnnotatedClass> scanArchive
(File archiveFile, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo) protected Map
<String, MojoAnnotatedClass> scanDirectory
(File classDirectory, List<String> includePatterns, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo) Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
MVN4_API
- See Also:
-
MOJO_V4
- See Also:
-
EXECUTE_V4
- See Also:
-
PARAMETER_V4
- See Also:
-
COMPONENT_V4
- See Also:
-
MOJO_V3
-
EXECUTE_V3
-
PARAMETER_V3
-
COMPONENT_V3
-
SCANNABLE_CLASS
-
EMPTY
- See Also:
-
reflector
private org.codehaus.plexus.util.reflection.Reflector reflector
-
-
Constructor Details
-
DefaultMojoAnnotationsScanner
public DefaultMojoAnnotationsScanner()
-
-
Method Details
-
scan
public Map<String,MojoAnnotatedClass> scan(MojoAnnotationsScannerRequest request) throws ExtractionException Description copied from interface:MojoAnnotationsScanner
Scan classes for mojo annotations.- Specified by:
scan
in interfaceMojoAnnotationsScanner
- Parameters:
request
-- Returns:
- map of mojo-annotated classes keyed by full class name
- Throws:
ExtractionException
-
scan
protected void scan(Map<String, MojoAnnotatedClass> mojoAnnotatedClasses, File source, List<String> includePatterns, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo) throws IOException, ExtractionException- Throws:
IOException
ExtractionException
-
scanArchive
protected Map<String,MojoAnnotatedClass> scanArchive(File archiveFile, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo) throws IOException, ExtractionException - Parameters:
archiveFile
-artifact
-excludeMojo
- for dependencies, we exclude Mojo annotations found- Returns:
- annotated classes found
- Throws:
IOException
ExtractionException
-
scanDirectory
protected Map<String,MojoAnnotatedClass> scanDirectory(File classDirectory, List<String> includePatterns, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo) throws IOException, ExtractionException - Parameters:
classDirectory
-includePatterns
-artifact
-excludeMojo
- for dependencies, we exclude Mojo annotations found- Returns:
- annotated classes found
- Throws:
IOException
ExtractionException
-
analyzeClassStream
private void analyzeClassStream(Map<String, MojoAnnotatedClass> mojoAnnotatedClasses, InputStream is, org.apache.maven.artifact.Artifact artifact, boolean excludeMojo, String source, String file) throws IOException, ExtractionException- Throws:
IOException
ExtractionException
-
populateAnnotationContent
protected void populateAnnotationContent(Object content, MojoAnnotationVisitor mojoAnnotationVisitor) throws org.codehaus.plexus.util.reflection.ReflectorException - Throws:
org.codehaus.plexus.util.reflection.ReflectorException
-
analyzeVisitors
- Throws:
ExtractionException
-