Class AbstractFullBinding

java.lang.Object
org.apache.groovy.swing.binding.AbstractFullBinding
All Implemented Interfaces:
BindingUpdatable, FullBinding
Direct Known Subclasses:
AbstractSyntheticBinding, PropertyPathFullBinding

public abstract class AbstractFullBinding extends Object implements FullBinding
Base implementation for FullBinding that handles validation and value conversion.
Since:
Groovy 1.1
  • Field Details

    • sourceBinding

      protected SourceBinding sourceBinding
      The source side of the binding.
    • targetBinding

      protected TargetBinding targetBinding
      The target side of the binding.
    • validator

      protected Closure validator
      Optional validator invoked before forward propagation.
    • converter

      protected Closure converter
      Optional converter applied before writing to the target.
    • reverseConverter

      protected Closure reverseConverter
      Optional converter applied before writing back to the source.
  • Constructor Details

    • AbstractFullBinding

      public AbstractFullBinding()
  • Method Details

    • update

      public void update()
      Propagates the current source value to the target.
      Specified by:
      update in interface BindingUpdatable
    • reverseUpdate

      public void reverseUpdate()
      Propagates the current target value back to the source.
      Specified by:
      reverseUpdate in interface BindingUpdatable
    • getSourceBinding

      public SourceBinding getSourceBinding()
      Returns the current source binding.
      Specified by:
      getSourceBinding in interface FullBinding
      Returns:
      the source binding
    • setSourceBinding

      public void setSourceBinding(SourceBinding sourceBinding)
      Replaces the current source binding.
      Specified by:
      setSourceBinding in interface FullBinding
      Parameters:
      sourceBinding - the new source binding
    • getTargetBinding

      public TargetBinding getTargetBinding()
      Returns the current target binding.
      Specified by:
      getTargetBinding in interface FullBinding
      Returns:
      the target binding
    • setTargetBinding

      public void setTargetBinding(TargetBinding targetBinding)
      Replaces the current target binding.
      Specified by:
      setTargetBinding in interface FullBinding
      Parameters:
      targetBinding - the new target binding
    • getValidator

      public Closure getValidator()
      Returns the validator invoked before forward propagation.
      Specified by:
      getValidator in interface FullBinding
      Returns:
      the validator closure, or null
    • setValidator

      public void setValidator(Closure validator)
      Sets the validator invoked before forward propagation.
      Specified by:
      setValidator in interface FullBinding
      Parameters:
      validator - the validator closure, or null
    • getConverter

      public Closure getConverter()
      Returns the forward converter.
      Specified by:
      getConverter in interface FullBinding
      Returns:
      the converter closure, or null
    • setConverter

      public void setConverter(Closure converter)
      Sets the forward converter.
      Specified by:
      setConverter in interface FullBinding
      Parameters:
      converter - the converter closure, or null
    • getReverseConverter

      public Closure getReverseConverter()
      Returns the reverse converter.
      Specified by:
      getReverseConverter in interface FullBinding
      Returns:
      the reverse converter, or null
    • setReverseConverter

      public void setReverseConverter(Closure reverseConverter)
      Sets the reverse converter.
      Specified by:
      setReverseConverter in interface FullBinding
      Parameters:
      reverseConverter - the reverse converter, or null