Package org.htmlunit.corejs.javascript
Class NativeJSON
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.corejs.javascript.NativeJSON
-
- All Implemented Interfaces:
java.io.Serializable
,ConstProperties
,DebuggableObject
,Scriptable
,SymbolScriptable
public final class NativeJSON extends ScriptableObject
This class implements the JSON native object. See ECMA 15.12.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
NativeJSON.StringifyState
-
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
JSON_TAG
private static int
MAX_STRINGIFY_GAP_LENGTH
private static long
serialVersionUID
-
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
-
Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
-
-
Constructor Summary
Constructors Modifier Constructor Description private
NativeJSON()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getClassName()
Return the name of the class.(package private) static void
init(Scriptable scope, boolean sealed)
private static boolean
isObjectArrayLike(java.lang.Object o)
private static java.lang.String
ja(Scriptable value, NativeJSON.StringifyState state)
private static java.lang.Object
javaToJSON(java.lang.Object value, NativeJSON.StringifyState state)
private static java.lang.String
jo(Scriptable value, NativeJSON.StringifyState state)
private static java.lang.String
join(java.util.Collection<java.lang.Object> objs, java.lang.String delimiter)
private static java.lang.Object
parse(Context cx, Scriptable scope, java.lang.String jtext)
static java.lang.Object
parse(Context cx, Scriptable scope, java.lang.String jtext, Callable reviver)
private static java.lang.Object
parse(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
private static java.lang.String
quote(java.lang.String string)
private static java.lang.String
repeat(char c, int count)
private static java.lang.Object
str(java.lang.Object key, Scriptable holder, NativeJSON.StringifyState state)
static java.lang.Object
stringify(Context cx, Scriptable scope, java.lang.Object value, java.lang.Object replacer, java.lang.Object space)
private static java.lang.Object
stringify(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
private static java.lang.Object
walk(Context cx, Scriptable scope, Callable reviver, Scriptable holder, java.lang.Object name)
-
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
addLazilyInitializedValue, applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildClassCtor, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, checkValidAttributes, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getBase, getBase, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, put, putConst, putConstProperty, putImpl, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
JSON_TAG
private static final java.lang.String JSON_TAG
- See Also:
- Constant Field Values
-
MAX_STRINGIFY_GAP_LENGTH
private static final int MAX_STRINGIFY_GAP_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
static void init(Scriptable scope, boolean sealed)
-
getClassName
public java.lang.String getClassName()
Description copied from class:ScriptableObject
Return the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassName
in interfaceScriptable
- Specified by:
getClassName
in classScriptableObject
-
parse
private static java.lang.Object parse(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
-
stringify
private static java.lang.Object stringify(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
-
parse
private static java.lang.Object parse(Context cx, Scriptable scope, java.lang.String jtext)
-
parse
public static java.lang.Object parse(Context cx, Scriptable scope, java.lang.String jtext, Callable reviver)
-
walk
private static java.lang.Object walk(Context cx, Scriptable scope, Callable reviver, Scriptable holder, java.lang.Object name)
-
repeat
private static java.lang.String repeat(char c, int count)
-
stringify
public static java.lang.Object stringify(Context cx, Scriptable scope, java.lang.Object value, java.lang.Object replacer, java.lang.Object space)
-
str
private static java.lang.Object str(java.lang.Object key, Scriptable holder, NativeJSON.StringifyState state)
-
join
private static java.lang.String join(java.util.Collection<java.lang.Object> objs, java.lang.String delimiter)
-
jo
private static java.lang.String jo(Scriptable value, NativeJSON.StringifyState state)
-
ja
private static java.lang.String ja(Scriptable value, NativeJSON.StringifyState state)
-
quote
private static java.lang.String quote(java.lang.String string)
-
javaToJSON
private static java.lang.Object javaToJSON(java.lang.Object value, NativeJSON.StringifyState state)
-
isObjectArrayLike
private static boolean isObjectArrayLike(java.lang.Object o)
-
-