Class DefaultModelValueHandler

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ExpressionResolverFactory getExpressionResolverFactory()  
      java.lang.Object getValue​(java.lang.Object model, java.lang.String key)
      Retrieves the value from the model using the given expression.
      java.lang.Object getValue​(java.lang.Object model, java.lang.String key, boolean useSessionLanguageForLocalized)
      Retrieves the value from the model using the given expression.
      protected java.lang.Object getValueFromResolver​(java.lang.Object model, java.lang.String key, java.util.Map<java.lang.String,​java.lang.Object> variables)  
      <T> java.lang.Class<T> getValueType​(java.lang.Object model, java.lang.String key)
      Retrieves the type of the value of the model using the given expression.
      void setExpressionResolverFactory​(ExpressionResolverFactory expressionResolverFactory)  
      void setValue​(java.lang.Object model, java.lang.String key, java.lang.Object value)
      Stores the given value to the model using the given expression.
      protected void setValueThroughResolver​(java.lang.Object model, java.lang.String key, java.lang.Object value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultModelValueHandler

        public DefaultModelValueHandler()
    • Method Detail

      • setValue

        public final void setValue​(java.lang.Object model,
                                   java.lang.String key,
                                   java.lang.Object value)
        Description copied from interface: ModelValueHandler
        Stores the given value to the model using the given expression. You can use expressions like 'product.media.code' to navigate through data structures. See implementations for detail. It also notifies the widget about the change. This is used to keep cockpit NG components like editors and actions uptodate.
        Specified by:
        setValue in interface ModelValueHandler
        Parameters:
        model - the object to apply the expression on
        key - the expression, can be like 'product.media.code'
        value - the value to store
      • setValueThroughResolver

        protected void setValueThroughResolver​(java.lang.Object model,
                                               java.lang.String key,
                                               java.lang.Object value)
      • getValue

        public java.lang.Object getValue​(java.lang.Object model,
                                         java.lang.String key)
        Description copied from interface: ModelValueHandler
        Retrieves the value from the model using the given expression. You can use expressions like 'product.media.code' to navigate through data structures. See implementations for detail.
        Specified by:
        getValue in interface ModelValueHandler
        Parameters:
        model - the object to apply the expression on
        key - the expression, can be like 'product.media.code'
        Returns:
        the value of evaluation ef the given expression
      • getValue

        public java.lang.Object getValue​(java.lang.Object model,
                                         java.lang.String key,
                                         boolean useSessionLanguageForLocalized)
        Description copied from interface: ModelValueHandler
        Retrieves the value from the model using the given expression. You can use expressions like 'product.media.code' to navigate through data structures. See implementations for detail.
        Specified by:
        getValue in interface ModelValueHandler
        Parameters:
        model - the object to apply the expression on
        key - the expression, can be like 'product.media.code'
        useSessionLanguageForLocalized - if true the value for the session language will be returned instead of all values for all available locales
        Returns:
        the value of evaluation ef the given expression
      • getValueFromResolver

        protected java.lang.Object getValueFromResolver​(java.lang.Object model,
                                                        java.lang.String key,
                                                        java.util.Map<java.lang.String,​java.lang.Object> variables)
      • getValueType

        public <T> java.lang.Class<T> getValueType​(java.lang.Object model,
                                                   java.lang.String key)
        Description copied from interface: ModelValueHandler
        Retrieves the type of the value of the model using the given expression.
        Specified by:
        getValueType in interface ModelValueHandler
        Parameters:
        model - the object to apply the expression on
        key - the expression, can be like 'product.media.code'
        Returns:
        the type of the value
      • setExpressionResolverFactory

        public void setExpressionResolverFactory​(ExpressionResolverFactory expressionResolverFactory)