Package sc.bind

Class SelectorBinding

  • All Implemented Interfaces:
    IBinding, IListener

    public class SelectorBinding
    extends DestinationListener
    This is a lot like the VariableBinding but works without an initial source object. Instead, the first binding expression is used to produce the source. This means that the first expression can only be an independent binding, i.e. not a property mapping but a VariableBinding, MethodBinding etc.
    • Constructor Detail

      • SelectorBinding

        public SelectorBinding​(java.lang.Object[] boundProperties)
        Use this form for chaining together this binding with another binding
      • SelectorBinding

        public SelectorBinding​(java.lang.Object dstObject,
                               java.lang.Object dstProperty,
                               java.lang.Object[] boundProperties,
                               BindingDirection bindingDirection,
                               int flags,
                               BindOptions opts)
        Use this form for a top level binding
    • Method Detail

      • setBindingParent

        public void setBindingParent​(IBinding parent,
                                     BindingDirection dir)
        Called by the parent when this is a hierarchical binding - i.e. one expression in another
      • initializeBinding

        public java.lang.Object initializeBinding()
        Called to initialize and retrieve the value of a top-level binding
      • initBinding

        protected void initBinding()
      • getBoundValue

        protected java.lang.Object getBoundValue​(boolean pendingChild)
      • removeListener

        public void removeListener()
      • valueRequested

        public void valueRequested​(java.lang.Object obj,
                                   IBeanMapper prop)
      • getReads

        public ISet<java.lang.Object> getReads()
      • getWrites

        public ISet<java.lang.Object> getWrites()
      • invalidateBinding

        public void invalidateBinding​(java.lang.Object obj,
                                      boolean sendEvent,
                                      int event,
                                      boolean includeParams)
      • applyBinding

        public boolean applyBinding​(java.lang.Object obj,
                                    java.lang.Object value,
                                    IBinding src,
                                    boolean refresh,
                                    boolean pendingChild)
        One of our downstream values changed. We need to figure out which one it was. If the value changed, we need to re-evaluate all subsequent binding expressions after the one that changed.
      • applyReverseBinding

        public void applyReverseBinding​(java.lang.Object obj,
                                        java.lang.Object value,
                                        java.lang.Object src)
      • getPropertyValue

        public java.lang.Object getPropertyValue​(java.lang.Object obj,
                                                 boolean getField,
                                                 boolean pendingChild)
        Description copied from interface: IBinding
        Retrieves the current value of the binding given the current object. Use getField = true to force use of the field, rather than the getX method if one exists. Use pendingChild = true for a special case where we are getting the property value of a binding that is part of a reverse binding but where the cached value is up-to-update because we are updating a child remote property.
      • addBindingListener

        public void addBindingListener​(java.lang.Object eventObject,
                                       IListener listener,
                                       int event)
      • removeBindingListener

        public void removeBindingListener​(java.lang.Object eventObject,
                                          IListener listener,
                                          int event)
      • isConstant

        public boolean isConstant()
      • toString

        public java.lang.String toString​(java.lang.String operation,
                                         boolean displayValue)
        toString in class DestinationListener
      • getBoundProperty

        protected java.lang.Object getBoundProperty​(java.lang.Object bindingParent,
                                                    int i)
      • activate

        public void activate​(boolean state,
                             java.lang.Object obj,
                             boolean chained)
        Description copied from interface: IBinding
        Called to deactive/re-activate a child binding for a condition or ternary expression
        Specified by:
        activate in interface IBinding
        activate in class AbstractListener
      • isReversible

        public boolean isReversible()