org.nakedobjects.metamodel.facets.object.callbacks
Class LoadingCallbackFacetViaMethod

java.lang.Object
  extended by org.nakedobjects.metamodel.facets.FacetAbstract
      extended by org.nakedobjects.metamodel.facets.object.callbacks.CallbackFacetAbstract
          extended by org.nakedobjects.metamodel.facets.object.callbacks.LoadingCallbackFacetAbstract
              extended by org.nakedobjects.metamodel.facets.object.callbacks.LoadingCallbackFacetViaMethod
All Implemented Interfaces:
Facet, CallbackFacet, LoadingCallbackFacet, ImperativeFacet, ImperativeFacetMulti

public class LoadingCallbackFacetViaMethod
extends LoadingCallbackFacetAbstract
implements ImperativeFacet


Field Summary
 
Fields inherited from interface org.nakedobjects.metamodel.java5.ImperativeFacet
FILTER
 
Constructor Summary
LoadingCallbackFacetViaMethod(java.lang.reflect.Method method, FacetHolder holder)
           
 
Method Summary
 void addMethod(java.lang.reflect.Method method)
          Associate an additional method, to be returned from ImperativeFacet.getMethods().
 java.util.List<java.lang.reflect.Method> getMethods()
          The Methods invoked by this Facet.
 boolean impliesObjectChanged()
          Whether invoking this method requires an DomainObjectContainer.objectChanged(Object) to occur afterwards.
 boolean impliesResolve()
          Whether invoking this requires a DomainObjectContainer.resolve(Object) to occur first.
 void invoke(NakedObject adapter)
           
protected  java.lang.String toStringValues()
           
 
Methods inherited from class org.nakedobjects.metamodel.facets.object.callbacks.LoadingCallbackFacetAbstract
type
 
Methods inherited from class org.nakedobjects.metamodel.facets.FacetAbstract
alwaysReplace, facetType, getFacetHolder, getIdentified, getUnderlyingFacet, isDerived, isNoop, setFacetHolder, setUnderlyingFacet, toString, unwrapObject, unwrapString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.metamodel.facets.Facet
alwaysReplace, facetType, getFacetHolder, getUnderlyingFacet, isDerived, isNoop, setFacetHolder, setUnderlyingFacet
 

Constructor Detail

LoadingCallbackFacetViaMethod

public LoadingCallbackFacetViaMethod(java.lang.reflect.Method method,
                                     FacetHolder holder)
Method Detail

addMethod

public void addMethod(java.lang.reflect.Method method)
Description copied from interface: ImperativeFacetMulti
Associate an additional method, to be returned from ImperativeFacet.getMethods().

Specified by:
addMethod in interface ImperativeFacetMulti

getMethods

public java.util.List<java.lang.reflect.Method> getMethods()
Description copied from interface: ImperativeFacet
The Methods invoked by this Facet.

In the vast majority of cases there is only a single Method (eg wrapping a property's getter). However, some Facets, such as those for callbacks, could map to multiple Methods. Implementations that will return multiple Methods should implement the ImperativeFacetMulti sub-interface that provides the ability to add Methods as part of the interface API. For example:

 if (someFacet instanceof ImperativeFacetMulti) {
     ImperativeFacetMulti ifm = (ImperativeFacetMulti)someFacet;
     ifm.addMethod(...);
 }
 

Specified by:
getMethods in interface ImperativeFacet

impliesResolve

public boolean impliesResolve()
Description copied from interface: ImperativeFacet
Whether invoking this requires a DomainObjectContainer.resolve(Object) to occur first.

Specified by:
impliesResolve in interface ImperativeFacet

impliesObjectChanged

public boolean impliesObjectChanged()
Description copied from interface: ImperativeFacet
Whether invoking this method requires an DomainObjectContainer.objectChanged(Object) to occur afterwards.

Specified by:
impliesObjectChanged in interface ImperativeFacet
Returns:

invoke

public void invoke(NakedObject adapter)
Specified by:
invoke in interface CallbackFacet
Specified by:
invoke in class CallbackFacetAbstract

toStringValues

protected java.lang.String toStringValues()
Overrides:
toStringValues in class FacetAbstract


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.