Package sc.bind

Class ConstantBinding

  • All Implemented Interfaces:

    public class ConstantBinding
    extends java.lang.Object
    implements IBinding
    • Constructor Detail

      • ConstantBinding

        public ConstantBinding​(java.lang.Object val)
    • Method Detail

      • getPropertyValue

        public java.lang.Object getPropertyValue​(java.lang.Object parent,
                                                 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.
        Specified by:
        getPropertyValue in interface IBinding
      • addBindingListener

        public void addBindingListener​(java.lang.Object eventObject,
                                       IListener listener,
                                       int event)
        Specified by:
        addBindingListener in interface IBinding
      • invalidateBinding

        public void invalidateBinding​(java.lang.Object object,
                                      boolean sendEvent,
                                      int event,
                                      boolean includeParams)
        Specified by:
        invalidateBinding in interface IBinding
      • applyBinding

        public boolean applyBinding​(java.lang.Object obj,
                                    java.lang.Object value,
                                    IBinding src,
                                    boolean refresh,
                                    boolean pendingChild)
        Specified by:
        applyBinding in interface IBinding
      • applyReverseBinding

        public void applyReverseBinding​(java.lang.Object obj,
                                        java.lang.Object value,
                                        java.lang.Object src)
        This might happen if you have: foo =: (x ? null : null) - i.e. it implies evaluating the constant as an expression when the reverse event fires
        Specified by:
        applyReverseBinding in interface IBinding
      • isConstant

        public boolean isConstant()
        Specified by:
        isConstant in interface IBinding
      • parentBindingChanged

        public void parentBindingChanged()
        Description copied from interface: IBinding
        Called from the VariableBinding when the parent's value has changed. E.g. for "a.b", b.parentBindingChanged() is called when we detect changes on 'a'.
        Specified by:
        parentBindingChanged in interface IBinding
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • performCast

        public java.lang.Object performCast​(java.lang.Object val)
        Specified by:
        performCast in interface IBinding
      • 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
      • getConstantValue

        public java.lang.Object getConstantValue()