Class CmsJSONMap

java.lang.Object
com.google.gwt.core.client.JavaScriptObject
org.opencms.gwt.client.util.CmsJSONMap

public final class CmsJSONMap extends com.google.gwt.core.client.JavaScriptObject
Class to create native JSON maps.

Since:
8.0.0
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Not directly instantiable.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns if the given key is present in the map.
    static CmsJSONMap
    Creates a native javascript object to be used as a JSON map.
    boolean
    Returns the value to the given key.
    boolean[]
    Returns the value to the given key.
    double
    Returns the value to the given key.
    double[]
    Returns the value to the given key.
    int
    Returns the value to the given key.
    int[]
    Returns the value to the given key.
    com.google.gwt.core.client.JavaScriptObject
    Returns the value to the given key.
    com.google.gwt.core.client.JavaScriptObject[]
    Returns the value to the given key.
    Returns the value to the given key.
    Returns the value to the given key.
    void
    put(String key, boolean value)
    Puts the value into the map.
    void
    put(String key, boolean[] value)
    Puts the value into the map.
    void
    put(String key, double value)
    Puts the value into the map.
    void
    put(String key, double[] value)
    Puts the value into the map.
    void
    put(String key, int value)
    Puts the value into the map.
    void
    put(String key, int[] value)
    Puts the value into the map.
    void
    put(String key, com.google.gwt.core.client.JavaScriptObject value)
    Puts the value into the map.
    void
    put(String key, com.google.gwt.core.client.JavaScriptObject[] value)
    Puts the value into the map.
    void
    put(String key, String value)
    Puts the value into the map.
    void
    put(String key, String[] value)
    Puts the value into the map.

    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

    • CmsJSONMap

      protected CmsJSONMap()
      Not directly instantiable. All subclasses must also define a protected, empty, no-arg constructor.

  • Method Details

    • createJSONMap

      public static CmsJSONMap createJSONMap()
      Creates a native javascript object to be used as a JSON map.

      Returns:
      the JSON map
    • containsKey

      public boolean containsKey(String key)
      Returns if the given key is present in the map.

      Parameters:
      key - the key
      Returns:
      true if the map contains the key
    • getBoolean

      public boolean getBoolean(String key)
      Returns the value to the given key.

      Parameters:
      key - the key
      Returns:
      the value
    • getBooleanArray

      public boolean[] getBooleanArray(String key)
      Returns the value to the given key.

      Parameters:
      key - the key
      Returns:
      the value
    • getDouble

      public double getDouble(String key)
      Returns the value to the given key.

      Parameters:
      key - the key
      Returns:
      the value
    • getDoubleArray

      public double[] getDoubleArray(String key)
      Returns the value to the given key.

      Parameters:
      key - the key
      Returns:
      the value
    • getInt

      public int getInt(String key)
      Returns the value to the given key.

      Parameters:
      key - the key
      Returns:
      the value
    • getIntArray

      public int[] getIntArray(String key)
      Returns the value to the given key.

      Parameters:
      key - the key
      Returns:
      the value
    • getJavaScriptObject

      public com.google.gwt.core.client.JavaScriptObject getJavaScriptObject(String key)
      Returns the value to the given key.

      Parameters:
      key - the key
      Returns:
      the value
    • getJavaScriptObjectArray

      public com.google.gwt.core.client.JavaScriptObject[] getJavaScriptObjectArray(String key)
      Returns the value to the given key.

      Parameters:
      key - the key
      Returns:
      the value
    • getString

      public String getString(String key)
      Returns the value to the given key.

      Parameters:
      key - the key
      Returns:
      the value
    • getStringArray

      public String[] getStringArray(String key)
      Returns the value to the given key.

      Parameters:
      key - the key
      Returns:
      the value
    • put

      public void put(String key, boolean value)
      Puts the value into the map.

      Parameters:
      key - the key
      value - the value
    • put

      public void put(String key, boolean[] value)
      Puts the value into the map.

      Parameters:
      key - the key
      value - the value
    • put

      public void put(String key, double value)
      Puts the value into the map.

      Parameters:
      key - the key
      value - the value
    • put

      public void put(String key, double[] value)
      Puts the value into the map.

      Parameters:
      key - the key
      value - the value
    • put

      public void put(String key, int value)
      Puts the value into the map.

      Parameters:
      key - the key
      value - the value
    • put

      public void put(String key, int[] value)
      Puts the value into the map.

      Parameters:
      key - the key
      value - the value
    • put

      public void put(String key, com.google.gwt.core.client.JavaScriptObject value)
      Puts the value into the map.

      Parameters:
      key - the key
      value - the value
    • put

      public void put(String key, com.google.gwt.core.client.JavaScriptObject[] value)
      Puts the value into the map.

      Parameters:
      key - the key
      value - the value
    • put

      public void put(String key, String value)
      Puts the value into the map.

      Parameters:
      key - the key
      value - the value
    • put

      public void put(String key, String[] value)
      Puts the value into the map.

      Parameters:
      key - the key
      value - the value