Class Properties

java.lang.Object
com.google.gwt.core.client.JavaScriptObject
io.jmix.ui.widget.client.Properties

public abstract class Properties extends com.google.gwt.core.client.JavaScriptObject
A collection of properties of arbitrary type, for interoperability with non-GWT JavaScript libraries.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An exception thrown by the get methods when the key is found but the value has an unexpected type.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Properties
    Create an empty Properties object.
    final Boolean
    Get a Boolean value mapped to the specified key.
    final Date
    Get a Date object mapped to the specified key.
    final Double
    Get a Double value mapped to the specified key.
    final com.google.gwt.core.client.JavaScriptObject
    Get a JavaScriptObject mapped to the specified key.
    final String
    Get a String mapped to the specified key.
    final void
    Remove the property at the specified key.
    final void
    set(String key, com.google.gwt.core.client.JavaScriptObject value)
    Set a property.
    final void
    set(String key, Boolean value)
    Set a property.
    final void
    set(String key, Double value)
    Set a property.
    final void
    set(String key, String value)
    Set a property.
    final void
    set(String key, Date value)
    Set a property.
    final String
    Executes the JavaScript typeof operator against the property with the given key.

    Methods inherited from class com.google.gwt.core.client.JavaScriptObject

    cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Properties

      protected Properties()
  • Method Details

    • create

      public static Properties create()
      Create an empty Properties object.
      Returns:
      An empty Properties object.
    • getBoolean

      public final Boolean getBoolean(String key) throws Properties.TypeException
      Get a Boolean value mapped to the specified key.
      Parameters:
      key - The name of the Boolean property.
      Returns:
      A Boolean value, or null if the key is not found.
      Throws:
      Properties.TypeException - if the key is found but the object returned is not a Boolean.
    • getDate

      public final Date getDate(String key) throws com.google.gwt.core.client.JavaScriptException, Properties.TypeException
      Get a Date object mapped to the specified key.
      Parameters:
      key - The name of the Date property.
      Returns:
      A Date object, or null if the key is not found.
      Throws:
      com.google.gwt.core.client.JavaScriptException - if the key is found but the object returned is not a Date.
      Properties.TypeException - If the key is found but the value is not an object.
    • getNumber

      public final Double getNumber(String key) throws Properties.TypeException
      Get a Double value mapped to the specified key.
      Parameters:
      key - The name of the Double property.
      Returns:
      A Double value, or null if the key is not found.
      Throws:
      Properties.TypeException - If the key is found but the value is not a number (integers are fine).
    • getObject

      public final com.google.gwt.core.client.JavaScriptObject getObject(String key) throws Properties.TypeException
      Get a JavaScriptObject mapped to the specified key.
      Parameters:
      key - The name of the JavaScriptObject property.
      Returns:
      A JavaScriptObject, or null if the key is not found.
      Throws:
      Properties.TypeException - If the key is found but the value is not a JavaScriptObject.
    • getString

      public final String getString(String key) throws Properties.TypeException
      Get a String mapped to the specified key.
      Parameters:
      key - The name of the String property.
      Returns:
      A String, or null if the key is not found.
      Throws:
      Properties.TypeException - If the key is found but the value is not a String.
    • remove

      public final void remove(String key)
      Remove the property at the specified key.
      Parameters:
      key - The name of the property to remove.
    • set

      public final void set(String key, Boolean value)
      Set a property.
      Parameters:
      key - The name of the property.
      value - The value of the property.
    • set

      public final void set(String key, Date value)
      Set a property.
      Parameters:
      key - The name of the property.
      value - The value of the property.
    • set

      public final void set(String key, Double value)
      Set a property.
      Parameters:
      key - The name of the property.
      value - The value of the property.
    • set

      public final void set(String key, com.google.gwt.core.client.JavaScriptObject value)
      Set a property.
      Parameters:
      key - The name of the property.
      value - The value of the property.
    • set

      public final void set(String key, String value)
      Set a property.
      Parameters:
      key - The name of the property.
      value - The value of the property.
    • typeofValue

      public final String typeofValue(String key)
      Executes the JavaScript typeof operator against the property with the given key. Note that the typeof undefined is "undefined" and the typeof null is "object".
      Parameters:
      key - The name of the property to type check.
      Returns:
      The JavaScript type of the property, as defined by the JavaScript typeof operator.