org.dynalang.mop
Interface ClassBasedMetaobjectProtocol

All Superinterfaces:
BaseMetaobjectProtocol, CallProtocol, MetaobjectProtocol
All Known Implementing Classes:
CompositeClassBasedMetaobjectProtocol, ListMetaobjectProtocol, MapMetaobjectProtocol

public interface ClassBasedMetaobjectProtocol
extends MetaobjectProtocol

An interface that can be optionally implemented by any MOP if it is strictly class-based (that is, the class of an object solely determines whether it has authority over it or not).

Version:
$Id: $
Author:
Attila Szegedi

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.dynalang.mop.BaseMetaobjectProtocol
BaseMetaobjectProtocol.Results
 
Method Summary
 boolean isAuthoritativeForClass(java.lang.Class clazz)
          Returns whether this metaobject protocol has authority over objects of the specified class.
 
Methods inherited from interface org.dynalang.mop.MetaobjectProtocol
call, call, delete, get, has, propertyIds, put
 
Methods inherited from interface org.dynalang.mop.BaseMetaobjectProtocol
delete, has, properties, put
 
Methods inherited from interface org.dynalang.mop.CallProtocol
call, call, get, representAs
 

Method Detail

isAuthoritativeForClass

boolean isAuthoritativeForClass(java.lang.Class clazz)
Returns whether this metaobject protocol has authority over objects of the specified class. Note that if a MOP claims that it has authority over objects of a certain class, it can still return BaseMetaobjectProtocol.Results.noAuthority for certain objects. In that case - when used in CompositeClassBasedMetaobjectProtocol - the other participating MOPs will also be given the chance to handle the object after this MOP was given the chance first.

Parameters:
clazz - the class of the handled object
Returns:
true if this metaobject protocol has authority over objects of the specified class, false otherwise.