org.escot
Interface EscotReferenced

All Known Implementing Classes:
PropertyAdapter

public interface EscotReferenced

Objects implementing this interface have a reference to a property which may be replaced. EscotReferenced can be used when a component wants to refer to a model instead of maintaining its own copy. This is useful when the model is large, like a TableModel, or when the model is of unknown size and complexity, for example when wrapping a JavaBean property of unknown type. Known Implementors: Property Adapter


Method Summary
 void cancelReference(Object obj)
          Reverts the reference to the original reference by calling the setter.
 boolean canReplaceReferenceWith(Object obj)
          Returns whether the reference can be replaced by the specified object.
 Object getReference()
          Returns the reference.
 boolean isReplaceable()
          Returns whether the reference can be replaced.
 void replaceReferenceWith(Object obj)
          Replaces the existing reference with the specified object.
 

Method Detail

isReplaceable

public boolean isReplaceable()
Returns whether the reference can be replaced.

canReplaceReferenceWith

public boolean canReplaceReferenceWith(Object obj)
Returns whether the reference can be replaced by the specified object.
Parameters:
obj - the object that will replace the existing reference.

replaceReferenceWith

public void replaceReferenceWith(Object obj)
Replaces the existing reference with the specified object.
Parameters:
obj - the object that will replace the existing reference.

cancelReference

public void cancelReference(Object obj)
Reverts the reference to the original reference by calling the setter. Does nothing if reference wasn't replaced, or if the reference provided is not the current one.
Parameters:
obj - the object to be cancelled

getReference

public Object getReference()
Returns the reference.