public final class JsHelper extends Object
| Modifier and Type | Method and Description | 
|---|---|
<T> T | 
cast(Object object)
Performs unchecked cast to a type. 
Using this method can have an incorrect type of the object to the rest of the system which will result in hard to debug problems.  | 
MutationObserverInit | 
createMutationObserverInit()
Creates new instance of observer initialization options. 
 | 
static JsHelper | 
get()
Singleton object to get the helper instance 
 | 
boolean | 
has(Object object,
   String key)
Returns a boolean indicating whether the object has the specified property as its own property. 
 | 
boolean | 
isCanvas(NativeObjectContainer object,
        Key key)
Returns  
true if the object is a Canvas. | 
boolean | 
isCanvasGradient(Object object)
Returns  
true if the object is a CanvasGradientItem. | 
boolean | 
isCanvasPattern(Object object)
Returns  
true if the object is a CanvasPatternItem. | 
boolean | 
isImage(NativeObjectContainer object,
       Key key)
Returns  
true if the object is a Img. | 
<T> CallbackProxy<T> | 
newCallbackProxy()
Creates new proxy for callback which will pass  
this environment of java script as first argument of callback method. | 
int | 
propertyAsInt(NativeObject object,
             String key)
Returns a property of java script object as integer. 
 | 
ObjectType | 
typeOf(Object object)
Returns the java script object type of object. 
 | 
ObjectType | 
typeOf(Object object,
      String key)
Returns the java script object type of a property. 
 | 
public static JsHelper get()
public <T> T cast(Object object)
T - type of the resultobject - object which must be castpublic MutationObserverInit createMutationObserverInit()
public boolean has(Object object, String key)
object - the object on which to search the property.key - the string name of the property to test.public ObjectType typeOf(Object object)
object - the object to get type.public ObjectType typeOf(Object object, String key)
object - the object on which to search the property.key - the string name of the property to test.public <T> CallbackProxy<T> newCallbackProxy()
this environment of java script as first argument of callback method.T - type of callback wrapped by proxypublic boolean isCanvasPattern(Object object)
true if the object is a CanvasPatternItem.object - the object instance on which to checktrue if the object is a CanvasPatternItempublic boolean isCanvasGradient(Object object)
true if the object is a CanvasGradientItem.object - the object instance on which to checktrue if the object is a CanvasGradientItempublic boolean isCanvas(NativeObjectContainer object, Key key)
true if the object is a Canvas.object - the object instance on which to checkkey - the string name of the property to test.true if the object is a Canvaspublic boolean isImage(NativeObjectContainer object, Key key)
true if the object is a Img.object - the object instance on which to checkkey - the string name of the property to test.true if the object is a Imgpublic int propertyAsInt(NativeObject object, String key)
object - the object on which to define the property.key - the string name of the property to be defined or modified..Undefined.INTEGER if arguments are not consistent