Package de.inetsoftware.jwebassembly.web
Class JSObject
java.lang.Object
de.inetsoftware.jwebassembly.web.JSObject
- Direct Known Subclasses:
EventTarget,NodeList,Window
The base type for all wrapped JavaScript objects.
- Author:
- Volker Berlin
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DOMStringGet the dom string from a java string https://developer.mozilla.org/de/docs/Web/API/DOMStringprotected <T> TGet the value of a property of this object.protected <T> TInvoke a JavaScript method with one non string parameter of this object.protected <T> TInvoke a JavaScript method with one string parameter of this object.protected voidSet the value of a property of this object.protected static <T> TGet a JavaScript property value by name from global variable window.
-
Field Details
-
peer
Native object from JavaScript.
-
-
Constructor Details
-
JSObject
Create a Java instance as wrapper of the JavaScript object.- Parameters:
peer- the native JavaScript object
-
-
Method Details
-
win_get
Get a JavaScript property value by name from global variable window.- Type Parameters:
T- the return type- Parameters:
propName- the name of the property as DOMString- Returns:
- the value of the property
-
get
Get the value of a property of this object.- Type Parameters:
T- the return type- Parameters:
propName- the name of the property- Returns:
- the value of the property
-
set
Set the value of a property of this object.- Parameters:
propName- the name of the propertyvalue- the value of the property
-
invoke
Invoke a JavaScript method with one string parameter of this object.- Type Parameters:
T- the return type- Parameters:
methodName- the method nameparam1- the parameter- Returns:
- the return value
-
invoke
Invoke a JavaScript method with one non string parameter of this object.- Type Parameters:
T- the return type- Parameters:
methodName- the method nameparam1- the parameter- Returns:
- the return value
-
domString
Get the dom string from a java string https://developer.mozilla.org/de/docs/Web/API/DOMString- Parameters:
str- the Java string- Returns:
- dom string
-