xdc.services.getset
Class GetSet

java.lang.Object
  extended by xdc.services.getset.GetSet

public class GetSet
extends java.lang.Object

A helper class to add getters and setters to a field of an XDCscript object.


Constructor Summary
GetSet()
           
 
Method Summary
static boolean getDebug()
          Get whether to print debug trace.
static void init(xdc.services.intern.xsr.Value.Obj obj)
          Initialize getter and setter support on every field.
static void init(xdc.services.intern.xsr.Value.Obj obj, java.lang.String name)
          Initialize getter and setter support on a field.
static void onGet(xdc.services.intern.xsr.Value.Obj obj, java.lang.String name, org.mozilla.javascript.Callable getter)
          Add a user getter to the named field of the object.
static void onSet(xdc.services.intern.xsr.Value.Obj obj, java.lang.String name, org.mozilla.javascript.Callable setter)
          Add a user setter to the named field of the object.
static void setDebug(boolean debug)
          Set whether to print debug trace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetSet

public GetSet()
Method Detail

init

public static void init(xdc.services.intern.xsr.Value.Obj obj)
Initialize getter and setter support on every field.


init

public static void init(xdc.services.intern.xsr.Value.Obj obj,
                        java.lang.String name)
Initialize getter and setter support on a field. If it does not already exist, add it.


onSet

public static void onSet(xdc.services.intern.xsr.Value.Obj obj,
                         java.lang.String name,
                         org.mozilla.javascript.Callable setter)
Add a user setter to the named field of the object.


onGet

public static void onGet(xdc.services.intern.xsr.Value.Obj obj,
                         java.lang.String name,
                         org.mozilla.javascript.Callable getter)
Add a user getter to the named field of the object.


getDebug

public static boolean getDebug()
Get whether to print debug trace.


setDebug

public static void setDebug(boolean debug)
Set whether to print debug trace.