|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.util.component.ApiMethodHelper<T>
public final class ApiMethodHelper<T extends Enum<T> & ApiMethod>
Helper class for working with ApiMethod.
| Nested Class Summary | |
|---|---|
static class |
ApiMethodHelper.MatchType
|
| Constructor Summary | |
|---|---|
ApiMethodHelper(Class<T> apiMethodEnum,
Map<String,String> aliases,
List<String> nullableArguments)
Create a helper to work with a ApiMethod, using optional method aliases. |
|
| Method Summary | |
|---|---|
Map<String,Class<?>> |
allArguments()
Returns argument types and names used by all methods. |
List<ApiMethod> |
filterMethods(List<? extends ApiMethod> methods,
ApiMethodHelper.MatchType matchType,
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,
String... argNames)
Gets methods that match the given name and arguments. Note that the args list is a required subset of arguments for returned methods. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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 value| Method Detail |
|---|
public List<ApiMethod> getCandidateMethods(String name,
String... argNames)
name - case sensitive method name or alias to lookupargNames - unordered required argument names
public List<ApiMethod> filterMethods(List<? extends ApiMethod> methods,
ApiMethodHelper.MatchType matchType,
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 list
public List<Object> getArguments(String name)
throws IllegalArgumentException
name - method name, either an exact name or an alias, exact matches are checked first
IllegalArgumentException
public Set<String> getMissingProperties(String methodName,
Set<String> argNames)
methodName - method nameargNames - available arguments
public Map<String,Set<String>> getAliases()
public Map<String,Class<?>> allArguments()
public List<String> getNullableArguments()
public Class<?> getType(String argName)
throws IllegalArgumentException
argName - argument name
IllegalArgumentExceptionpublic static ApiMethod getHighestPriorityMethod(List<? extends ApiMethod> filteredMethods)
public static Object invokeMethod(Object proxy,
ApiMethod method,
Map<String,Object> properties)
throws RuntimeCamelException
proxy - Proxy object for invokemethod - method to invokeproperties - Map of arguments
RuntimeCamelException - on errors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||