| Modifier and Type | Class and Description |
|---|---|
static class |
ApiMethodHelper.MatchType |
| Constructor and Description |
|---|
ApiMethodHelper(Class<T> apiMethodEnum,
Map<String,String> aliases,
List<String> nullableArguments)
Create a helper to work with a
ApiMethod, using optional method aliases. |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Class<?>> |
allArguments()
Returns argument types and names used by all methods.
|
List<ApiMethod> |
filterMethods(List<? extends ApiMethod> methods,
ApiMethodHelper.MatchType matchType)
Filters a list of methods to those that take the given set of arguments.
|
List<ApiMethod> |
filterMethods(List<? extends ApiMethod> methods,
ApiMethodHelper.MatchType matchType,
Collection<String> argNames)
Filters a list of methods to those that take the given set of arguments.
|
Map<String,Set<String>> |
getAliases()
Returns alias map.
|
List<Object> |
getArguments(String name)
Gets argument types and names for all overloaded methods and aliases with the given name.
|
List<ApiMethod> |
getCandidateMethods(String name)
Gets methods that match the given name and arguments.
|
List<ApiMethod> |
getCandidateMethods(String name,
Collection<String> argNames)
Gets methods that match the given name and arguments.
|
static ApiMethod |
getHighestPriorityMethod(List<? extends ApiMethod> filteredMethods) |
Set<String> |
getMissingProperties(String methodName,
Set<String> argNames)
Get missing properties.
|
List<String> |
getNullableArguments()
Returns argument names that can be set to null if not specified.
|
Class<?> |
getType(String argName)
Get the type for the given argument name.
|
static Object |
invokeMethod(Object proxy,
ApiMethod method,
Map<String,Object> properties)
Invokes given method with argument values from given properties.
|
public ApiMethodHelper(Class<T> apiMethodEnum, Map<String,String> aliases, List<String> nullableArguments)
ApiMethod, using optional method aliases.apiMethodEnum - ApiMethod enumeration classaliases - Aliases mapped to actual method namesnullableArguments - names of arguments that default to null valuepublic List<ApiMethod> getCandidateMethods(String name)
name - case sensitive method name or alias to lookuppublic List<ApiMethod> getCandidateMethods(String name, Collection<String> argNames)
name - case sensitive method name or alias to lookupargNames - unordered required argument namespublic List<ApiMethod> filterMethods(List<? extends ApiMethod> methods, ApiMethodHelper.MatchType matchType)
methods - list of methods to filtermatchType - whether the arguments are an exact match, a subset or a super set of method argspublic List<ApiMethod> filterMethods(List<? extends ApiMethod> methods, ApiMethodHelper.MatchType matchType, Collection<String> argNames)
methods - list of methods to filtermatchType - whether the arguments are an exact match, a subset or a super set of method argsargNames - argument names to filter the listpublic List<Object> getArguments(String name) throws IllegalArgumentException
name - method name, either an exact name or an alias, exact matches are checked firstIllegalArgumentExceptionpublic Set<String> getMissingProperties(String methodName, Set<String> argNames)
methodName - method nameargNames - available argumentspublic Map<String,Set<String>> getAliases()
public Map<String,Class<?>> allArguments()
public List<String> getNullableArguments()
public Class<?> getType(String argName) throws IllegalArgumentException
argName - argument nameIllegalArgumentExceptionpublic static ApiMethod getHighestPriorityMethod(List<? extends ApiMethod> filteredMethods)
public static Object invokeMethod(Object proxy, ApiMethod method, Map<String,Object> properties) throws org.apache.camel.RuntimeCamelException
proxy - Proxy object for invokemethod - method to invokeproperties - Map of argumentsorg.apache.camel.RuntimeCamelException - on errorsApache Camel