org.apache.camel.util.component
Class ApiMethodImpl

java.lang.Object
  extended by org.apache.camel.util.component.ApiMethodImpl
All Implemented Interfaces:
ApiMethod

public final class ApiMethodImpl
extends Object
implements ApiMethod

Delegate class for ApiMethod. This class is instantiated by Enumerations for Api Proxy types.

For example:

 public enum HelloWorldMethod implements ApiMethod {
         SAYHI(String.class, "sayHi", "name", String.class);

         private ApiMethodImpl apiMethod;

         private HelloWorldMethods(Class<?> resultType, String name, Object... args) throws IllegalArgumentException {
             this.apiMethod = new ApiMethod(HelloWorld.class, resultType, name, args);
         }

         // implement ApiMethod interface
         String getName() { return apiMethod.getName(); }
         Class<?> getResultType() {return apiMethod.getResultType(); }
         List<String> getArgNames() { return apiMethod.getArgNames(); }
         List<Class<?>> getArgTypes() {return apiMethod.getArgTypes(); }
         Method getMethod() { return apiMethod.getMethod(); }
     }
 
 


Constructor Summary
ApiMethodImpl(Class<?> proxyType, Class<?> resultType, String name, Object... args)
           
 
Method Summary
 List<String> getArgNames()
          Returns method argument names.
 List<Class<?>> getArgTypes()
          Return method argument types.
 Method getMethod()
          Returns Method in proxy type.
 String getName()
          Returns method name.
 Class<?> getResultType()
          Returns method result type.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApiMethodImpl

public ApiMethodImpl(Class<?> proxyType,
                     Class<?> resultType,
                     String name,
                     Object... args)
              throws IllegalArgumentException
Throws:
IllegalArgumentException
Method Detail

getName

public String getName()
Description copied from interface: ApiMethod
Returns method name.

Specified by:
getName in interface ApiMethod
Returns:
name

getResultType

public Class<?> getResultType()
Description copied from interface: ApiMethod
Returns method result type.

Specified by:
getResultType in interface ApiMethod
Returns:
result type

getArgNames

public List<String> getArgNames()
Description copied from interface: ApiMethod
Returns method argument names.

Specified by:
getArgNames in interface ApiMethod
Returns:
argument names

getArgTypes

public List<Class<?>> getArgTypes()
Description copied from interface: ApiMethod
Return method argument types.

Specified by:
getArgTypes in interface ApiMethod
Returns:
argument types

getMethod

public Method getMethod()
Description copied from interface: ApiMethod
Returns Method in proxy type.

Specified by:
getMethod in interface ApiMethod
Returns:
method

toString

public String toString()
Overrides:
toString in class Object


Apache Camel