Class NJSObject

java.lang.Object
org.bzdev.util.JSObject
org.bzdev.obnaming.NJSObject
All Implemented Interfaces:
JSOps

public class NJSObject extends JSObject
Simplified JavaScript-like object class. Objects defined by scripting languages can be used to configure instances of NamedObjectFactory. For this use, the objects contain properties but any methods explicitly defined for the objects are ignored. The types of the values that can be inserted into this object are NamedObjectOps, JSObject, JSArray,Boolean, Number, and String.

The class NJSUtilities.JSON can be used to create instances of NJSObject and NJSArray by reading from various sources, and instances of these two classes in turn can be used to configure a named-object factory, which can then create a named object.

This class is similar to a Map, but with some run-time type checking. Entries in the map can be other instances of JSObject (instances of NJSObject are preferred) or instances of JSArray (instances of NJSArray are preferred), allowing trees or directed graphs to be constructed. Iterators will use the keys in the order in which they were inserted.

See Also:
  • Constructor Details

    • NJSObject

      public NJSObject()
      Constructor.
    • NJSObject

      protected NJSObject(JSObject base)
      Constructor sharing the same tables. This is used by NJSObject.
      Parameters:
      base - the JSObject whose tables should be used
  • Method Details