public class JSStringObject extends JSObject
| Modifier and Type | Method and Description |
|---|---|
JSStringObject |
asStringObject()
Casts the current JavaScript object to
将当前的JavaScript对象转换为JSStringObject类型。 JSStringObject type.
|
java.lang.String |
getStringValue()
Returns string value of the current JavaScript object if object represents a primitive string or String object, otherwise throws
如果object表示原始字符串或String对象,则返回当前JavaScript对象的字符串值,否则抛出IllegalStateException。 IllegalStateException.
|
boolean |
isStringObject()
Indicates whether JavaScript value is a String object.
指示JavaScript值是否为String对象。 |
java.lang.String |
toString() |
java.lang.String |
valueOf()
Returns the primitive value of the String object.
返回String对象的原始值。 |
asJavaObject, asObject, getContext, getOwnPropertyNames, getProperty, getPropertyNames, hasProperty, isJavaObject, isObject, removeProperty, setProperty, setProperty, toJSONStringasArray, asBoolean, asBooleanObject, asFunction, asNumber, asNumberObject, asString, getBooleanValue, getNumberValue, isArray, isBoolean, isBooleanObject, isFunction, isNull, isNumber, isNumberObject, isString, isUndefinedpublic java.lang.String valueOf()
public java.lang.String getStringValue()
JSValue
IllegalStateException.
getStringValue in class
JSValue
public boolean isStringObject()
JSValue
true, then the value can be casted to
JSStringObject type. For example:
if (value.isStringObject()) {
JSStringObject stringObject = value.asStringObject();
}
isStringObject in class
JSValue
true when JavaScript value is a String object.
当JavaScript值为String对象时。
public JSStringObject asStringObject()
JSValue
JSStringObject type. If the current object doesn't represent a String object, the
IllegalStateException error is thrown.
asStringObject in class
JSValue