K - Type of the keys contained by the MethodMapDomainV - Type of the keys contained by all contained methodmapspublic class MethodMapDomain<K,V> extends java.util.HashMap<K,AbstractMethodMap<V>>
AbstractMethodMap.
The purpose of this class is to abstract away the process of invoking underlying instances of
AutoInstantiatingMethodMap and other
AbstractMethodMap implementations via a common interface.| Constructor and Description |
|---|
MethodMapDomain() |
| Modifier and Type | Method and Description |
|---|---|
AbstractMethodMap<V> |
getMethodMap(K domain)
Retrieves the methodmap mapped to the provided domain.
|
java.lang.Object |
invoke(K domain,
V key,
ArgsFactory argsFactory)
Convenience method for calling
invoke(Object, Object, null, null, ArgsFactory) |
java.lang.Object |
invoke(K domain,
V key,
java.lang.Class<?>[] constructorParameterTypes,
java.lang.Object[] constructorArgs,
ArgsFactory argsFactory)
Retrieves the methodmap mapped to the provided domain and calls
invoke with
the given argsfactory. |
java.lang.Object |
invoke(K domain,
V key,
java.lang.Class<?>[] constructorParameterTypes,
java.lang.Object[] constructorArgs,
java.lang.Object... args)
Retrieves the methodmap mapped to the provided domain and calls
invoke with
the given arguments. |
java.lang.Object |
invoke(K domain,
V key,
java.lang.Object... args)
Convenience method for calling
invoke(Object, Object, null, null, Object...) |
java.lang.Object |
invoke(java.lang.Object... args)
Treats the first argument as the domain, the second argument as the key, and the remaining
arguments as the methodhandle arguments and calls
invoke(Object, Object, Object...). |
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuespublic AbstractMethodMap<V> getMethodMap(K domain) throws UnmappedDomainException
domain - the domain to which the desired methodmap is mappedUnmappedDomainException - If there is no methodmap mapped to the provided domain.public java.lang.Object invoke(K domain, V key, java.lang.Class<?>[] constructorParameterTypes, java.lang.Object[] constructorArgs, java.lang.Object... args) throws UnmappedDomainException, java.lang.NoSuchMethodException, java.lang.SecurityException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException, UnmappedKeyException, InvocationException
invoke with
the given arguments. If the methodmap is an instance of
AutoInstantiatingMethodMap then
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)
is invoked with key, constructorParameterTypes, constructorArgs,
and args.
Otherwise
AbstractMethodMap.invoke(Object, Object...)
is invoked with key and args.
domain - the domain to which the desired methodmap is mappedkey - the key to which the desired methodhandleinfo is mappedconstructorParameterTypes - the parameter types of the desired constructor to use if the
methodmap is an instance of
AutoInstantiatingMethodMapconstructorArgs - the arguments to be passed to the desired constructor if
the methodmap is an instance of
AutoInstantiatingMethodMapargs - the arguments to be passed to the methodhandleUnmappedDomainException - If there is no methodmap mapped to the provided domain.java.lang.NoSuchMethodException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.SecurityException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.InstantiationException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.IllegalAccessException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.IllegalArgumentException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.reflect.InvocationTargetException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)UnmappedKeyException - If there is no methodhandleinfo associated with the provided key.InvocationException - If methodhandle invocation fails.public java.lang.Object invoke(K domain, V key, java.lang.Class<?>[] constructorParameterTypes, java.lang.Object[] constructorArgs, ArgsFactory argsFactory) throws UnmappedDomainException, java.lang.NoSuchMethodException, java.lang.SecurityException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException, ArgsProductionException, UnmappedKeyException, InvocationException
invoke with
the given argsfactory. If the methodmap is an instance of
AutoInstantiatingMethodMap then
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)
is invoked with key, constructorParameterTypes, constructorArgs,
and argsFactory.
Otherwise
AbstractMethodMap.invoke(Object, ArgsFactory)
is invoked with key and argsFactory.
domain - the domain to which the desired methodmap is mappedkey - the key to which the desired methodhandleinfo is mappedconstructorParameterTypes - the parameter types of the desired constructor to use if
the methodmap is an instance of
AutoInstantiatingMethodMapconstructorArgs - the arguments to be passed to the desired constructor if
the methodmap is an instance of
AutoInstantiatingMethodMapargsFactory - Produces the arguments that are passed to the
methodhandle.UnmappedDomainException - If there is no methodmap mapped to the provided domain.java.lang.NoSuchMethodException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)java.lang.SecurityException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)java.lang.InstantiationException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)java.lang.IllegalAccessException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)java.lang.IllegalArgumentException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)java.lang.reflect.InvocationTargetException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)ArgsProductionException - If the argsfactory fails to produce arguments.UnmappedKeyException - If there is no methodhandleinfo associated with the
provided key.InvocationException - If methodhandle invocation fails.public java.lang.Object invoke(K domain, V key, java.lang.Object... args) throws java.lang.NoSuchMethodException, java.lang.SecurityException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException, UnmappedDomainException, UnmappedKeyException, InvocationException
invoke(Object, Object, null, null, Object...)domain - the domain to which the desired methodmap is mappedkey - the key to which the desired methodhandleinfo is mappedargs - the arguments to be passed to the methodhandlejava.lang.NoSuchMethodException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.SecurityException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.InstantiationException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.IllegalAccessException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.IllegalArgumentException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.reflect.InvocationTargetException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)UnmappedDomainException - If there is no methodmap mapped to the provided domain.UnmappedKeyException - If there is no methodhandleinfo associated with the
provided key.InvocationException - If methodhandle invocation fails.public java.lang.Object invoke(K domain, V key, ArgsFactory argsFactory) throws java.lang.NoSuchMethodException, java.lang.SecurityException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException, UnmappedDomainException, ArgsProductionException, UnmappedKeyException, InvocationException
invoke(Object, Object, null, null, ArgsFactory)domain - the domain to which the desired methodmap is mappedkey - the key to which the desired methodhandleinfo is mappedargsFactory - Produces the arguments that are passed to the methodhandle.java.lang.NoSuchMethodException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)java.lang.SecurityException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)java.lang.InstantiationException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)java.lang.IllegalAccessException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)java.lang.IllegalArgumentException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)java.lang.reflect.InvocationTargetException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], ArgsFactory)UnmappedDomainException - If there is no methodmap mapped to the provided domain.ArgsProductionException - If the argsfactory fails to produce arguments.UnmappedKeyException - If there is no methodhandleinfo associated with the provided key.InvocationException - If methodhandle invocation fails.public java.lang.Object invoke(java.lang.Object... args)
throws java.lang.NoSuchMethodException,
java.lang.SecurityException,
java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.IllegalArgumentException,
java.lang.reflect.InvocationTargetException,
UnmappedDomainException,
UnmappedKeyException,
InvocationException
invoke(Object, Object, Object...).args - the arguments to be passed to the methodhandlejava.lang.NoSuchMethodException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.SecurityException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.InstantiationException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.IllegalAccessException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.IllegalArgumentException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)java.lang.reflect.InvocationTargetException - See the documentation for
AutoInstantiatingMethodMap.invoke(Object, Class[], Object[], Object...)UnmappedDomainException - If there is no methodmap mapped to the provided domain.UnmappedKeyException - If there is no methodhandleinfo associated with the provided key.InvocationException - If methodhandle invocation fails.