Class Method
A Method encapsulates the reflective information about a single RPC method.
Method parameters and return values are declared with type
strings. A type string denotes the concatenation of type
identifiers where a string is used to represent a sequence of
types. For example 'ii' is the type string for two 32-bit integers,
while 'iss' is the type string for a single 32-bit integer followed
by two strings. The complete list of type identifiers can be found
in the Value
class.
The type strings associated with actual method parameters and
return values may only contain valid type identifiers. However,
when you specify the parameters accepted by- or returned from a RPC
method via the Method constructor, '*' may be used as the last
character in the type string. Ending a type string specification
with '*' means that additional values are optional and may have any
type. This feature can also be used with the Request.checkReturnTypes
method when
verifying return types.
-
Constructor Summary
ConstructorDescriptionMethod
(String name, String paramTypes, String returnTypes, MethodHandler handler) Create a new Method. -
Method Summary
-
Constructor Details
-
Method
Create a new Method. The parameters define the name of the method, the parameter types, the return value types and also the handler for the method. Please refer to theMethod
class description for an explanation of type strings.- Parameters:
name
- method nameparamTypes
- a type string defining the parameter typesreturnTypes
- a type string defining the return value typeshandler
- the handler for this RPC method- Throws:
MethodCreateException
- if the handler is null.
-
-
Method Details
-
methodDesc
Describe this method. This adds documentation that can be obtained through remote reflection.- Returns:
- this Method, to allow chaining
-
paramDesc
Describe a parameter of this method. This adds documentation that can be obtained through remote reflection.- Parameters:
index
- the parameter indexname
- the parameter namedesc
- the parameter description- Returns:
- this Method, to allow chaining
-
returnDesc
Describe a return value of this method. This adds documentation that can be obtained through remote reflection.- Parameters:
index
- the return value indexname
- the return value namedesc
- the return value description- Returns:
- this Method, to allow chaining
-
toString
-