javax.beans.binding
Class Binding.BindingController

java.lang.Object
  extended by javax.beans.binding.Binding.BindingController
Enclosing class:
Binding

public final class Binding.BindingController
extends java.lang.Object

BindingController is used by BindingTargets to control the binding.

See Also:
BindingTarget

Method Summary
 void bind(Binding binding, java.lang.Object source, java.lang.Object target, java.lang.String targetPath, boolean keepUncommited)
          Binds the specified child binding.
 ELPropertyResolver createResolver()
          Creates and returns an ELPropertyResolver.
 Binding getBinding()
          Returns the Binding.
 java.lang.Object getValueForTarget(Binding binding, ELPropertyResolver resolver, java.lang.Class<?> targetType)
          Returns the value from the specified resolver.
 void unbindOnCommit(Binding binding)
          Schedules a Binding to unbind when the Binding is committed.
 void valueEdited()
          Invoke to signal the target value has been edited.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createResolver

public ELPropertyResolver createResolver()
Creates and returns an ELPropertyResolver.

Returns:
a new ELPropertyResolver

getValueForTarget

public java.lang.Object getValueForTarget(Binding binding,
                                          ELPropertyResolver resolver,
                                          java.lang.Class<?> targetType)
Returns the value from the specified resolver.

Parameters:
binding - the Binding the resolver was created for
resolver - the resolver to use for getting the value
targetType - the expected type of the value
Throws:
java.lang.IllegalArgumentException - if any of the arguments are null

valueEdited

public void valueEdited()
Invoke to signal the target value has been edited. This changes the target value state to UNCOMMITTED and notifies the BindingContext.


getBinding

public Binding getBinding()
Returns the Binding.

Returns:
the Binding

unbindOnCommit

public void unbindOnCommit(Binding binding)
Schedules a Binding to unbind when the Binding is committed.

Parameters:
binding - the Binding to remove
Throws:
java.lang.NullPointerException - if binding is null
java.lang.IllegalArgumentException - if binding is not a child of the Binding returned by getBinding()

bind

public void bind(Binding binding,
                 java.lang.Object source,
                 java.lang.Object target,
                 java.lang.String targetPath,
                 boolean keepUncommited)
Binds the specified child binding. The specified binding is bound to the parameters, not those specified by the binding. In addition this does not change the source, target or target path of the binding in anyway, only what the binding is bound to.

Parameters:
binding - the Binding to bind
source - the source for the binding
target - the target for the binding
targetPath - path for the target
keepUncommited - if true the binding remains uncommited even after the value is set on the source from the target
Throws:
java.lang.IllegalArgumentException - if the specified Binding is not a child of the Binding returned by getBinding()
java.lang.IllegalStateException - if already bound, or the source or target is null
PropertyResolverException - if PropertyResolver throws an exception; refer to PropertyResolver for the conditions under which an exception is thrown