|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
com.edugility.jpa.maven.plugin.AbstractJPAMojo
public abstract class AbstractJPAMojo
An AbstractMojo that provides support for scanning a set of
URLs and reporting back on the annotated classnames found
there.
| Field Summary | |
|---|---|
private AnnotationDB |
db
The AnnotationDB that will be cloned for use by this AbstractJPAMojo. |
private org.apache.maven.project.MavenProject |
project
The MavenProject usually injected by the Maven runtime. |
private URLFilter |
urlFilter
A URLFilter that will be used to construct the Set of URLs that will be scanned by this AbstractJPAMojo. |
| Fields inherited from interface org.apache.maven.plugin.Mojo |
|---|
ROLE |
| Constructor Summary | |
|---|---|
protected |
AbstractJPAMojo()
Constructs a new AbstractJPAMojo. |
| Method Summary | |
|---|---|
AnnotationDB |
cloneAnnotationDB()
Returns a clone of this AbstractJPAMojo's associated AnnotationDB. |
protected AnnotationDB |
createAnnotationDB()
Creates a new AnnotationDB in the (common) case where a
user has not supplied this AbstractJPAMojo with a
pre-configured AnnotationDB. |
org.apache.maven.project.MavenProject |
getProject()
Returns the MavenProject that Maven customarily injects
into this mojo, or null if no such MavenProject
has been set. |
URLFilter |
getURLFilter()
Returns this AbstractJPAMojo's associated URLFilter, or null if no such URLFilter exists. |
private AnnotationDB |
scan(AnnotationDB db,
Set<URL> urls)
Scans the supplied Set of URLs and as a
convenience returns the supplied AnnotationDB that
contains the scanned annotation information. |
protected AnnotationDB |
scan(Set<URL> urls)
Scans the supplied Set of URLs and returns the
AnnotationDB that contains the scanned annotation
information. |
void |
setAnnotationDB(AnnotationDB db)
Sets the AnnotationDB that will be used by this AbstractJPAMojo's cloneAnnotationDB() method. |
void |
setProject(org.apache.maven.project.MavenProject project)
Installs the MavenProject for use by this mojo during its
run. |
void |
setURLFilter(URLFilter filter)
Sets this AbstractJPAMojo's associated URLFilter. |
| Methods inherited from class org.apache.maven.plugin.AbstractMojo |
|---|
getLog, getPluginContext, setLog, setPluginContext |
| 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.plugin.Mojo |
|---|
execute |
| Field Detail |
|---|
private org.apache.maven.project.MavenProject project
MavenProject usually injected by the Maven runtime.
Used for the return value of its getTestClasspathElements() method and its associated Build's getTestOutputDirectory() method. This field may be null
when this AbstractJPAMojo is not configured
by Maven.
private AnnotationDB db
AnnotationDB that will be cloned for use by this AbstractJPAMojo. This field may be null at any point,
and may be populated by either Maven,
the setAnnotationDB(AnnotationDB) method or the createAnnotationDB() method.
cloneAnnotationDB(),
createAnnotationDB(),
setAnnotationDB(AnnotationDB),
Guide
to Configuring Plug-insprivate URLFilter urlFilter
URLFilter that will be used to construct the Set of URLs that will be scanned by this AbstractJPAMojo. This field may be null at any point
and may be populated by either Maven
or the setURLFilter(URLFilter) method.
getURLFilter(),
setURLFilter(URLFilter),
Guide
to Configuring Plug-ins| Constructor Detail |
|---|
protected AbstractJPAMojo()
AbstractJPAMojo. No configuration
automatic or otherwise will have taken place as a result of
calling this constructor.
| Method Detail |
|---|
protected AnnotationDB createAnnotationDB()
AnnotationDB in the (common) case where a
user has not supplied this AbstractJPAMojo with a
pre-configured AnnotationDB.
This method never returns null. Subclasses overriding
this method must ensure that their overridden implementation
never returns null.
AnnotationDB; never nullAnnotationDB,
AnnotationDBpublic URLFilter getURLFilter()
AbstractJPAMojo's associated URLFilter, or null if no such URLFilter exists.
This method may return null.
URLFilter used by this AbstractJPAMojo, or nullsetURLFilter(URLFilter),
URLFilterpublic void setURLFilter(URLFilter filter)
AbstractJPAMojo's associated URLFilter.
null is permitted as a parameter value.
filter - the URLFilter to set; may be nullgetURLFilter(),
URLFilterpublic org.apache.maven.project.MavenProject getProject()
MavenProject that Maven customarily injects
into this mojo, or null if no such MavenProject
has been set.
This method may return null.
MavenProject associated with this mojo, or
nullpublic void setProject(org.apache.maven.project.MavenProject project)
MavenProject for use by this mojo during its
run.
project - the MavenProject to use; may be nullpublic final AnnotationDB cloneAnnotationDB()
AbstractJPAMojo's associated AnnotationDB.
A clone is returned because AnnotationDB retains state after scanning, and
Maven plugins have no contractually defined lifecycle semantics.
Consequently it is unknown how long-lived this AbstractJPAMojo's db reference might be.
This method may return null.
AbstractJPAMojo's associated AnnotationDB, or null if no such
AnnotationDB could be clonedsetAnnotationDB(AnnotationDB),
AnnotationDB,
AnnotationDB.clone(),
AnnotationDB,
AnnotationDB.annotationIndex,
AnnotationDB.classIndexpublic void setAnnotationDB(AnnotationDB db)
AnnotationDB that will be used by this AbstractJPAMojo's cloneAnnotationDB() method. null is permitted as a parameter value.
db - the AnnotationDB to set; may be nullcloneAnnotationDB(),
AnnotationDB
protected final AnnotationDB scan(Set<URL> urls)
throws IOException
Set of URLs and returns the
AnnotationDB that contains the scanned annotation
information.
This method may return null in exceptional
circumstances.
urls - the Set of URLs to scan; if null, then no scanning operation will take place
AnnotationDB that was used to perform the
scan, or null if no AnnotationDB could be
found
IOException - if an error occurs during scanningcloneAnnotationDB(),
AnnotationDB.scanArchives(URL[])
private final AnnotationDB scan(AnnotationDB db,
Set<URL> urls)
throws IOException
Set of URLs and as a
convenience returns the supplied AnnotationDB that
contains the scanned annotation information.
This method may return null if the supplied db
is null.
db - the AnnotationDB used to perform the
scan; if null then no scanning operation will take placeurls - the Set of URLs to scan; if null, then no scanning operation will take place
db parameter
IOException - if an error occurs during scanningAnnotationDB.scanArchives(URL[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||