public interface CallProtocol
BaseMetaobjectProtocol
extends
this interface.Modifier and Type | Method and Description |
---|---|
java.lang.Object |
call(java.lang.Object callable,
CallProtocol callProtocol,
java.util.Map args)
Calls a callable object with named arguments.
|
java.lang.Object |
call(java.lang.Object callable,
CallProtocol callProtocol,
java.lang.Object... args)
Calls a callable object with positional arguments.
|
java.lang.Object |
get(java.lang.Object target,
java.lang.Object propertyId)
Retrieves the property value from the target object.
|
java.lang.Object |
representAs(java.lang.Object object,
java.lang.Class targetClass)
Returns a representation of the specified target object as an object of
the specified target class.
|
java.lang.Object representAs(java.lang.Object object, java.lang.Class targetClass)
object
- the object to representtargetClass
- the target class for representation.BaseMetaobjectProtocol.Result.noAuthority
is returned if the
marshaller can not authoritatively decide on a representation;
BaseMetaobjectProtocol.Result.noRepresentation
is returned if
the marshaller can authoritatively decide that the requested
representation is not possible. representation of null should be null,
except when the target class is a primitive type in which case
BaseMetaobjectProtocol.Result.noRepresentation
should be
returned.java.lang.Object get(java.lang.Object target, java.lang.Object propertyId)
target
- the target objectpropertyId
- the ID of the property. Usually a String or an
Integer, but other property ID types can also be supported.BaseMetaobjectProtocol.Result.doesNotExist
. If the protocol decides that
the property exists, but is not readable, it will return
BaseMetaobjectProtocol.Result.notReadable
. If the protocol can not make
an authoritative decision, it will return BaseMetaobjectProtocol.Result.noAuthority
.java.lang.Object call(java.lang.Object callable, CallProtocol callProtocol, java.util.Map args)
callProtocol
- a marshaller that should be used by this
metaobject protocol to convert the arguments to conform to expected
argument types for the call.args
- the named arguments for the callable object. null must
be treated as empty map. Usually, the map keys are strings, but it is
possible that some protocols support non-string keys.callable
- the callable objectBaseMetaobjectProtocol.Result.notCallable
is returned if the protocol can
authoritatively decide that the target is not a callable, or is not
callable with named arguments. BaseMetaobjectProtocol.Result.doesNotExist
is returned
if the callable does not exist at all. BaseMetaobjectProtocol.Result.noAuthority
is
returned if the protocol can not authoritatively decide whether the
target is callable.java.lang.Object call(java.lang.Object callable, CallProtocol callProtocol, java.lang.Object... args)
callable
- the callable objectcallProtocol
- a marshaller that should be used by this
metaobject protocol to convert the arguments to conform to expected
argument types for the call.args
- the positional arguments for the callable object. null must
be treated as empty array.BaseMetaobjectProtocol.Result.notCallable
is returned if the protocol can
authoritatively decide that the target is not a callable, or is not
callable with positional arguments. BaseMetaobjectProtocol.Result.doesNotExist
is
returned if the callable does not exist at all.
BaseMetaobjectProtocol.Result.noAuthority
is returned if the protocol can not
authoritatively decide whether the target is callable.