Question

I'd like to use the NativeJSON class from a Rhino shell script. The only things I can find about how to use it on the Web are from Java.

// Load the configuration file
load(arguments[0]);

// Extract the configuration for the target environment
print(NativeJSON.stringify(environments[arguments[1]]));

Any clue how I'd get at it from a Rhino shell script?

Était-ce utile?

La solution

The NativeJSON class is an implementation of the JSON object from ECMAScript 5, so you shouldn't need to do anything special. You can access it by calling JSON.stringify(object) or JSON.parse(jsonString).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top