com.iternum.swlink
Interface Link

All Superinterfaces:
EndpointObserver
All Known Subinterfaces:
TwowayLink
All Known Implementing Classes:
DefaultLink, DefaultTwowayLink

public interface Link
extends EndpointObserver

A generic link interface. A link supports the following relations.

Author:
Karl F. Banke

Method Summary
 void close()
          Unlink the from its source and its target link.
 Action getAction()
           
 java.lang.Object getSource()
           
 java.lang.Object getTarget()
          The target of the link.
 boolean isActivateOnSetSource()
           
 void setAction(Action pAction)
           
 void setActivateOnSetSource(boolean pIsActivate)
           
 void setActivator(Activator pActivator)
          Sets the Activator for this link.
 void setSource(java.lang.Object pSource)
          Sets and registers the source of this link.
 void setSource(java.lang.Object pSource, java.lang.String pPath)
          Sets the source path of the link.
 void setTarget(java.lang.Object pTarget)
          Sets and registers the target of this link.
 void setTarget(java.lang.Object pTarget, java.lang.String pPath)
          Sets the target path of the link.
 
Methods inherited from interface com.iternum.swlink.EndpointObserver
sourceChanged, targetChanged
 

Method Detail

setActivator

public void setActivator(Activator pActivator)
Sets the Activator for this link. Any Activator still connected with the link is closed.

Parameters:
pActivator - - The activator to set.

isActivateOnSetSource

public boolean isActivateOnSetSource()
Returns:
true if the link activates if the source is set

setActivateOnSetSource

public void setActivateOnSetSource(boolean pIsActivate)
Parameters:
pIsActivate - - true to let the link activate if the source is set

close

public void close()
Unlink the from its source and its target link.


getTarget

public java.lang.Object getTarget()
The target of the link.

Returns:
The target of this link

getSource

public java.lang.Object getSource()
Returns:
The source of the link

setSource

public void setSource(java.lang.Object pSource)
Sets and registers the source of this link. If the passed argument is of Type EndpointProxy the link add itself as an Observer with the EndpointProxy and uses the object wrapped in the proxy as the actual target

Parameters:
pSource - The source of the link or an EndpointProxy

setTarget

public void setTarget(java.lang.Object pTarget)
Sets and registers the target of this link. If the passed argument is of Type EndpointProxy the link add itself as an Observer with the EndpointProxy and uses the object wrapped in the proxy as the actual target

Parameters:
pTarget - The target of the link or an EndpointProxy

setSource

public void setSource(java.lang.Object pSource,
                      java.lang.String pPath)
Sets the source path of the link. The actual source object is resolved using nested propery of the source path. In case the source is an EndpointProxy, the source path applies to the wrapped object

Parameters:
pSource - The source of the link or an EndpointProxy
pPath - The property path relative to pSource

setTarget

public void setTarget(java.lang.Object pTarget,
                      java.lang.String pPath)
Sets the target path of the link. The target object is resolved using the target path. In case the target object is an EndpointProxy, the target path applies to the wrapped object

Parameters:
pTarget - The target of the link or an EndpointProxy
pPath - The property path relative to pTarget

setAction

public void setAction(Action pAction)
Parameters:
pAction - The action the link should use when the link is activated

getAction

public Action getAction()
Returns:
The Action of this link