net.sf.beanform.binding
Class DualBinding

java.lang.Object
  extended by net.sf.beanform.binding.DualBinding
All Implemented Interfaces:
org.apache.hivemind.Locatable, IBinding

public class DualBinding
extends Object
implements IBinding

A special binding type that allows us to simulate adding and removing bindings to components. This binding behaves like a custom binding unless there is no custom binding, in which case it behaves like the standard (default) binding for a given binding name.

Author:
Daniel Gredler

Constructor Summary
DualBinding(IBinding custom, IBinding standard)
           
 
Method Summary
static void addCustomBindings(IComponent component, Map<String,IBinding> bindings, boolean clearFirst)
          Adds temporary custom bindings to a component by overriding the existing bindings with DualBinding instances whose behavior can later be reverted.
 String getDescription()
           
 org.apache.hivemind.Location getLocation()
           
 Object getObject()
           
 Object getObject(Class type)
           
 boolean isInvariant()
           
static void removeCustomBindings(IComponent component)
          Reverts the behavior of the specified component's temporarily customized bindings to whatever it was prior to customization.
 void setCustom(IBinding custom)
           
 void setObject(Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DualBinding

public DualBinding(IBinding custom,
                   IBinding standard)
Method Detail

setCustom

public void setCustom(IBinding custom)

getObject

public Object getObject()
Specified by:
getObject in interface IBinding

getObject

public Object getObject(Class type)
Specified by:
getObject in interface IBinding

isInvariant

public boolean isInvariant()
Specified by:
isInvariant in interface IBinding

setObject

public void setObject(Object value)
Specified by:
setObject in interface IBinding

getDescription

public String getDescription()
Specified by:
getDescription in interface IBinding

getLocation

public org.apache.hivemind.Location getLocation()
Specified by:
getLocation in interface org.apache.hivemind.Locatable

addCustomBindings

public static void addCustomBindings(IComponent component,
                                     Map<String,IBinding> bindings,
                                     boolean clearFirst)
Adds temporary custom bindings to a component by overriding the existing bindings with DualBinding instances whose behavior can later be reverted.


removeCustomBindings

public static void removeCustomBindings(IComponent component)
Reverts the behavior of the specified component's temporarily customized bindings to whatever it was prior to customization.



Copyright © 2006 Daniel Gredler. All Rights Reserved.