public class EntityFunctionResolver
extends java.lang.Object
Entity types. It can be given a number of
EntityMethodFunction that can be used to process Methods from an Entity
type and then map them to an EntityMethod. Once all methods are resolved a
EntityFunction can be obtained for the original Entity type (so an
InvocationHandler can use the mapped methods). resolveType(Class)) are cached so they do not have to be resolved again (unless
unresolveType(Class) or unresolveAllTypes() are called). | Constructor and Description |
|---|
EntityFunctionResolver()
Creates a new type resolver (no method functions).
|
EntityFunctionResolver(java.util.Set<EntityMethodFunction> methodFunctions)
Creates a new type resolver with the supplied method functions.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addMethodFunction(EntityMethodFunction methodFunction)
Adds a method function.
|
void |
addMethodFunctions(java.util.Set<? extends EntityMethodFunction> methodFunctions)
Adds a number of method functions.
|
java.util.Set<java.lang.Class<? extends Entity>> |
getResolvedTypes()
Gets all of the resolved
Entity types. |
void |
removeAllMethodFunctions()
Removes all method functions.
|
boolean |
removeMethodResolver(EntityMethodFunction methodFunction)
Removes a method function.
|
void |
removeMethodResolvers(java.util.Set<? extends EntityMethodFunction> methodFunctions)
Removes a number of method functions.
|
EntityFunction |
resolveType(java.lang.Class<? extends Entity> type)
Resolves an
Entity type to a new resolved EntityFunction. |
void |
unresolveAllTypes()
Uncaches all resolved types.
|
boolean |
unresolveType(java.lang.Class<? extends Entity> type)
Uncaches a resolved type.
|
public EntityFunctionResolver()
public EntityFunctionResolver(java.util.Set<EntityMethodFunction> methodFunctions)
methodFunctions - Method functions to add.public boolean addMethodFunction(EntityMethodFunction methodFunction)
methodFunction - Function to add.public void addMethodFunctions(java.util.Set<? extends EntityMethodFunction> methodFunctions)
methodFunctions - Functions to add.public java.util.Set<java.lang.Class<? extends Entity>> getResolvedTypes()
Entity types.public void removeAllMethodFunctions()
public boolean removeMethodResolver(EntityMethodFunction methodFunction)
methodFunction - function to remove.public void removeMethodResolvers(java.util.Set<? extends EntityMethodFunction> methodFunctions)
methodFunctions - Functions to remove.public EntityFunction resolveType(java.lang.Class<? extends Entity> type)
Entity type to a new resolved EntityFunction.type - Type to resolve.public void unresolveAllTypes()
public boolean unresolveType(java.lang.Class<? extends Entity> type)
type - Type to uncache.