Package io.jmix.ui.widget.client
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 ClassesModifier and TypeClassDescriptionstatic classAn exception thrown by the get methods when the key is found but the value has an unexpected type. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Propertiescreate()Create an empty Properties object.final BooleangetBoolean(String key) Get a Boolean value mapped to the specified key.final DateGet a Date object mapped to the specified key.final DoubleGet a Double value mapped to the specified key.final com.google.gwt.core.client.JavaScriptObjectGet a JavaScriptObject mapped to the specified key.final StringGet a String mapped to the specified key.final voidRemove the property at the specified key.final voidSet a property.final voidSet a property.final voidSet a property.final voidSet a property.final voidSet a property.final StringtypeofValue(String key) 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
-
Constructor Details
-
Properties
protected Properties()
-
-
Method Details
-
create
Create an empty Properties object.- Returns:
- An empty Properties object.
-
getBoolean
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
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
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
Remove the property at the specified key.- Parameters:
key- The name of the property to remove.
-
set
Set a property.- Parameters:
key- The name of the property.value- The value of the property.
-
set
Set a property.- Parameters:
key- The name of the property.value- The value of the property.
-
set
Set a property.- Parameters:
key- The name of the property.value- The value of the property.
-
set
Set a property.- Parameters:
key- The name of the property.value- The value of the property.
-
set
Set a property.- Parameters:
key- The name of the property.value- The value of the property.
-
typeofValue
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.
-