Class Path<T>

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected T data
      Local variable keeping the data reference
      protected static boolean DEBUG 
    • Constructor Summary

      Constructors 
      Constructor and Description
      Path() 
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      void addObserver(java.util.Observer o) 
      void broadcast()
      Will notify all observers that all data has changed on this data path.
      protected void broadcast(T data)
      Will notify all observers with the data passed as parameter.
      void deleteObserver(java.util.Observer o) 
      void deleteObservers() 
      protected void finalize() 
      abstract T getData()
      Gets the path data in it's current state
      protected boolean isClearRequired(java.lang.String json)
      Convenience method for interpreting json message update to the data path.
      void notifyObservers(java.lang.Object object)
      Deprecated. 
      void trigger()
      Triggers an update from an observable
      • Methods inherited from class java.util.Observable

        clearChanged, countObservers, hasChanged, notifyObservers, setChanged
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • data

        protected T data
        Local variable keeping the data reference
    • Constructor Detail

      • Path

        public Path()
    • Method Detail

      • getData

        public abstract T getData()
        Gets the path data in it's current state
        Returns:
        path data pojo object
      • isClearRequired

        protected boolean isClearRequired(java.lang.String json)
        Convenience method for interpreting json message update to the data path.

        It's per protocol definition that data gets cleared if json update arrives as null or string literal 'null'

        Parameters:
        json - that gets interpreted
        Returns:
        true if data should be cleared, false otherwise
        See Also:
        WebWidgetListener.msg(String), com.zopim.android.sdk.data.WebWidgetListener#shouldOverrideUrlLoading(android.webkit.WebView, String)
      • notifyObservers

        @Deprecated
        public final void notifyObservers(java.lang.Object object)
        Deprecated. 
        This method is discouraged, use broadcast(T data) to notify your observers.

        Parametrized object must be of specified generic type T, or broadcast will be aborted.

        Overrides:
        notifyObservers in class java.util.Observable
        Parameters:
        object - update
      • broadcast

        protected void broadcast(T data)
        Will notify all observers with the data passed as parameter. If nobody is listening there will be no broadcast.

        It will also mark this observable as changed so that Observer receives the update.

        Parameters:
        data - to broadcast
      • broadcast

        public void broadcast()
        Will notify all observers that all data has changed on this data path.
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • addObserver

        public void addObserver(java.util.Observer o)
        Overrides:
        addObserver in class java.util.Observable
      • deleteObserver

        public void deleteObserver(java.util.Observer o)
        Overrides:
        deleteObserver in class java.util.Observable
      • deleteObservers

        public void deleteObservers()
        Overrides:
        deleteObservers in class java.util.Observable