final class EntityFinder extends Object
#forPackage(MavenProject, Log, String)
method.Modifier and Type | Class and Description |
---|---|
private static class |
EntityFinder.ClassLoaderCreator |
Modifier and Type | Field and Description |
---|---|
private org.reflections.Reflections |
reflections |
Modifier | Constructor and Description |
---|---|
private |
EntityFinder(org.reflections.Reflections reflections) |
Modifier and Type | Method and Description |
---|---|
private static URL |
classPathElemToUrl(String classPathElem)
Helper method for converting a fully qualified package name from the
string representation to a a URL.
|
Set<Class<?>> |
findEntities()
Finds all entity classes and all converter classes
in the package for which the instance of this
class was created.
|
static EntityFinder |
forPackage(org.apache.maven.project.MavenProject project,
org.apache.maven.plugin.logging.Log log,
String packageName,
boolean includeTestClasses)
Creates an
EntityFinder for the provided package. |
public static EntityFinder forPackage(org.apache.maven.project.MavenProject project, org.apache.maven.plugin.logging.Log log, String packageName, boolean includeTestClasses) throws org.apache.maven.plugin.MojoFailureException
EntityFinder
for the provided package.project
- The Maven project in which the calling Mojo is
executed. Can be null
.log
- An Maven log object for creating output.packageName
- The name of the package in the class should look for
entities.EntityFinder
instance.org.apache.maven.plugin.MojoFailureException
- If the Reflections
instance needed
by the EntityFinder
can't be
created.public Set<Class<?>> findEntities()
Entity
annotation, the converter classes must be annotated with
the Converter
annotation. The method uses the
Reflections library
for finding the entity classes.Set
with all entity classes.private static URL classPathElemToUrl(String classPathElem) throws org.apache.maven.plugin.MojoFailureException
classPathElem
- The class path to convert.org.apache.maven.plugin.MojoFailureException
- If something goes wrong.Copyright © 2016–2019 Jens Pelzetter. All rights reserved.