|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opt4j.core.config.ModuleAutoFinder
public class ModuleAutoFinder
The ModuleAutoFinder searches the classpath for all
PropertyModules that are not annotated with Ignore.
| Field Summary | |
|---|---|
protected Transformer<java.lang.Class<? extends com.google.inject.Module>,java.lang.Boolean> |
accept
|
protected java.lang.ClassLoader |
classLoader
|
protected Transformer<java.lang.Class<? extends com.google.inject.Module>,java.lang.Boolean> |
ignore
|
protected java.util.Set<ModuleAutoFinderListener> |
listeners
|
| Constructor Summary | |
|---|---|
ModuleAutoFinder()
Constructs a ModuleAutoFinder. |
|
ModuleAutoFinder(Transformer<java.lang.Class<? extends com.google.inject.Module>,java.lang.Boolean> accept,
Transformer<java.lang.Class<? extends com.google.inject.Module>,java.lang.Boolean> ignore)
Constructs a ModuleAutoFinder. |
|
| Method Summary | |
|---|---|
void |
addListener(ModuleAutoFinderListener listener)
Add a ModuleAutoFinderListener. |
protected java.util.Collection<java.lang.Class<? extends com.google.inject.Module>> |
getAll()
Returns all not abstract classes that implement PropertyModule. |
protected java.util.List<java.lang.Class<?>> |
getAllClasses(java.io.File directory)
Retrieves all Classes from one directory. |
protected java.util.List<java.lang.Class<?>> |
getAllClasses(java.io.File root,
java.io.File file)
Recursive methods searching for classes in a root directory. |
protected java.util.List<java.lang.Class<?>> |
getAllClasses(java.util.zip.ZipFile zipFile)
Retrieves all Classes from a ZipFile (Jar archive). |
java.util.Collection<java.lang.Class<? extends com.google.inject.Module>> |
getModules()
Returns the classes of all modules. |
protected void |
invokeErr(java.lang.String message)
Invoke an err message for the ModuleAutoFinderListener. |
protected void |
invokeOut(java.lang.String message)
Invoke an out message for the ModuleAutoFinderListener. |
protected boolean |
isJar(java.io.File file)
Returns true if the file is a Jar archive. |
void |
removeListener(ModuleAutoFinderListener listener)
Remove a ModuleAutoFinderListener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Transformer<java.lang.Class<? extends com.google.inject.Module>,java.lang.Boolean> accept
protected final Transformer<java.lang.Class<? extends com.google.inject.Module>,java.lang.Boolean> ignore
protected final java.util.Set<ModuleAutoFinderListener> listeners
protected java.lang.ClassLoader classLoader
| Constructor Detail |
|---|
@Inject public ModuleAutoFinder()
ModuleAutoFinder.
public ModuleAutoFinder(Transformer<java.lang.Class<? extends com.google.inject.Module>,java.lang.Boolean> accept,
Transformer<java.lang.Class<? extends com.google.inject.Module>,java.lang.Boolean> ignore)
ModuleAutoFinder.
accept - the accept transformerignore - the ignore transformer| Method Detail |
|---|
public java.util.Collection<java.lang.Class<? extends com.google.inject.Module>> getModules()
ModuleList
getModules in interface ModuleListprotected java.util.Collection<java.lang.Class<? extends com.google.inject.Module>> getAll()
PropertyModule.
protected boolean isJar(java.io.File file)
true if the file is a Jar archive.
file - the tested file
true if the file is a Jar archiveprotected java.util.List<java.lang.Class<?>> getAllClasses(java.io.File directory)
directory.
directory - the directory
protected java.util.List<java.lang.Class<?>> getAllClasses(java.io.File root,
java.io.File file)
root - the root directoryfile - the current file
protected java.util.List<java.lang.Class<?>> getAllClasses(java.util.zip.ZipFile zipFile)
ZipFile (Jar archive).
zipFile - the Jar archive
protected void invokeOut(java.lang.String message)
ModuleAutoFinderListener.
message - the messageprotected void invokeErr(java.lang.String message)
ModuleAutoFinderListener.
message - the messagepublic void addListener(ModuleAutoFinderListener listener)
ModuleAutoFinderListener.
listener - the listener to be addedpublic void removeListener(ModuleAutoFinderListener listener)
ModuleAutoFinderListener.
listener - the listener to be removedaddListener(org.opt4j.core.config.ModuleAutoFinderListener)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||