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 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)
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) 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 method uses the
Reflections library
for finding the entity classes.packageName - The packages in which the entities are found.entityClasses - A set in which the entity classes are stored.org.apache.maven.plugin.MojoFailureException - if something goes wrong in the method.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 © 2014–2016 Jens Pelzetter. All rights reserved.