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.Observable obj)
          Initialize getter and setter support on every field.
static void init(xdc.services.intern.xsr.Value.Observable obj, int prop)
          Initialize getter and setter support on an array element, or other property with a numeric index.
static void init(xdc.services.intern.xsr.Value.Observable obj, java.lang.String prop)
          Initialize getter and setter support on a field, or other property labeled by an identifier.
static void onGet(xdc.services.intern.xsr.Value.Observable obj, int prop, org.mozilla.javascript.Callable getter)
          Add a user getter to the indicated array element, or other property with a numeric index.
static void onGet(xdc.services.intern.xsr.Value.Observable obj, java.lang.String prop, org.mozilla.javascript.Callable getter)
          Add a user getter to the named field of the object, or other property labeled by an identifier.
static void onSet(xdc.services.intern.xsr.Value.Observable obj, int prop, org.mozilla.javascript.Callable setter)
          Add a user setter to the indicated array element, or other property with a numeric index.
static void onSet(xdc.services.intern.xsr.Value.Observable obj, java.lang.String prop, org.mozilla.javascript.Callable setter)
          Add a user setter to the named field of the object, or other property labeled by an identifier.
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.Observable obj)
Initialize getter and setter support on every field.


init

public static void init(xdc.services.intern.xsr.Value.Observable obj,
                        java.lang.String prop)
Initialize getter and setter support on a field, or other property labeled by an identifier. If it does not already exist, add it.


init

public static void init(xdc.services.intern.xsr.Value.Observable obj,
                        int prop)
Initialize getter and setter support on an array element, or other property with a numeric index. If it does not already exist, add it.


onSet

public static void onSet(xdc.services.intern.xsr.Value.Observable obj,
                         java.lang.String prop,
                         org.mozilla.javascript.Callable setter)
Add a user setter to the named field of the object, or other property labeled by an identifier.


onSet

public static void onSet(xdc.services.intern.xsr.Value.Observable obj,
                         int prop,
                         org.mozilla.javascript.Callable setter)
Add a user setter to the indicated array element, or other property with a numeric index.


onGet

public static void onGet(xdc.services.intern.xsr.Value.Observable obj,
                         java.lang.String prop,
                         org.mozilla.javascript.Callable getter)
Add a user getter to the named field of the object, or other property labeled by an identifier.


onGet

public static void onGet(xdc.services.intern.xsr.Value.Observable obj,
                         int prop,
                         org.mozilla.javascript.Callable getter)
Add a user getter to the indicated array element, or other property with a numeric index.


getDebug

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


setDebug

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