List of usage examples for jdk.nashorn.internal.objects Global newEmptyInstance
public static ScriptObject newEmptyInstance()
From source file:com.threecrickets.jvm.json.nashorn.NashornJsonImplementation.java
License:Mozilla Public License
public Object createObject() { return Global.newEmptyInstance(); }
From source file:com.threecrickets.jvm.json.nashorn.util.NashornNativeUtil.java
License:Mozilla Public License
public static ScriptObject newObject() { return Global.newEmptyInstance(); }
From source file:org.bson.jvm.nashorn.ScriptObjectCodec.java
License:Apache License
public Object decode(BsonReader reader, DecoderContext decoderContext) { ScriptObject scriptObject = Global.newEmptyInstance(); reader.readStartDocument();//from ww w .jav a 2 s.c o m while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) { String key = reader.readName(); Object value = BsonUtil.read(reader, decoderContext, codecRegistry, bsonTypeClassMap); scriptObject.put(key, value, false); } reader.readEndDocument(); // The driver does not support decoding DBRef, so we'll do it here Object dbRef = new DBRefTransformer().transform(scriptObject, null); if (dbRef != null) return dbRef; return scriptObject; }