|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.android_scripting.rpc.MethodDescriptor
public final class MethodDescriptor
An adapter that wraps Method.
| Constructor Summary | |
|---|---|
MethodDescriptor(java.lang.Class<? extends RpcReceiver> clazz,
java.lang.reflect.Method method)
|
|
| Method Summary | |
|---|---|
static java.lang.Object |
buildIntent(JSONObject jsonObject)
|
static java.util.Collection<MethodDescriptor> |
collectFrom(java.lang.Class<? extends RpcReceiver> clazz)
Collects all methods with RPC annotation from given class. |
java.lang.Class<? extends RpcReceiver> |
getDeclaringClass()
|
static java.lang.Object |
getDefaultValue(java.lang.reflect.Type parameterType,
java.lang.annotation.Annotation[] annotations)
Returns the default value for a specific parameter. |
java.lang.reflect.Type[] |
getGenericParameterTypes()
|
java.lang.String |
getHelp()
Returns a human-readable help text for this RPC, based on annotations in the source code. |
java.lang.reflect.Method |
getMethod()
|
java.lang.String |
getName()
|
java.lang.annotation.Annotation[][] |
getParameterAnnotations()
|
java.lang.String[] |
getParameterHints()
Returns parameter hints. |
ParameterDescriptor[] |
getParameterValues(java.lang.String[] values)
Returns parameter descriptors suitable for the RPC call text representation. |
static boolean |
hasDefaultValue(java.lang.annotation.Annotation[] annotations)
Determines whether or not this parameter has default value. |
java.lang.Object |
invoke(RpcReceiverManager manager,
JSONArray parameters)
Invokes the call that belongs to this object with the given parameters. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MethodDescriptor(java.lang.Class<? extends RpcReceiver> clazz,
java.lang.reflect.Method method)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic static java.util.Collection<MethodDescriptor> collectFrom(java.lang.Class<? extends RpcReceiver> clazz)
RPC annotation from given class.
public java.lang.Object invoke(RpcReceiverManager manager,
JSONArray parameters)
throws java.lang.Throwable
parameters - JSONArray containing the parameters
java.lang.Throwable
public static java.lang.Object buildIntent(JSONObject jsonObject)
throws JSONException
JSONExceptionpublic java.lang.reflect.Method getMethod()
public java.lang.Class<? extends RpcReceiver> getDeclaringClass()
public java.lang.String getName()
public java.lang.reflect.Type[] getGenericParameterTypes()
public java.lang.annotation.Annotation[][] getParameterAnnotations()
public java.lang.String getHelp()
public ParameterDescriptor[] getParameterValues(java.lang.String[] values)
Uses parameter value, default value or name, whatever is available first.
public java.lang.String[] getParameterHints()
public static java.lang.Object getDefaultValue(java.lang.reflect.Type parameterType,
java.lang.annotation.Annotation[] annotations)
parameterType - parameterTypeannotations - annotations of the parameterpublic static boolean hasDefaultValue(java.lang.annotation.Annotation[] annotations)
annotations - annotations of the parameter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||