|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.expr.util.ScopeUtil
public class ScopeUtil
Some general utility methods relating to scopes.
| Field Summary | |
|---|---|
protected static HashMap<Class<?>,Field[]> |
_bound
Cached bound fields. |
protected static HashMap<Class<?>,HashMap<String,Member>> |
_scoped
Cached scoped members. |
| Constructor Summary | |
|---|---|
ScopeUtil()
|
|
| Method Summary | ||
|---|---|---|
static Object |
call(Scope scope,
String name,
Object... args)
Attempts to resolve, then call the specified function with the given arguments. |
|
protected static Field[] |
createBound(Class<?> clazz)
Creates the list of bound fields for the specified class. |
|
protected static HashMap<String,Member> |
createScoped(Class<?> clazz)
Creates the mapping from name to member for all scoped members of the specified class. |
|
static
|
get(Object object,
String name,
Class<T> clazz)
Attempts to retrieve the value of the identified symbol using reflection. |
|
protected static Field[] |
getBound(Class<?> clazz)
Retrieves the list of the specified class's bound fields. |
|
protected static HashMap<String,Member> |
getScoped(Class<?> clazz)
Retrieves the mapping from name to member for all scoped members of the specified class. |
|
static Boolean |
resolve(Scope scope,
String name,
Boolean defvalue)
Attempts to resolve a boolean symbol. |
|
static Color4f |
resolve(Scope scope,
String name,
Color4f defvalue)
Attempts to resolve a color symbol. |
|
static Function |
resolve(Scope scope,
String name,
Function defvalue)
Attempts to resolve a function symbol. |
|
static MutableBoolean |
resolve(Scope scope,
String name,
MutableBoolean defvalue)
Attempts to resolve a mutable boolean symbol. |
|
static MutableFloat |
resolve(Scope scope,
String name,
MutableFloat defvalue)
Attempts to resolve a mutable float symbol. |
|
static MutableInteger |
resolve(Scope scope,
String name,
MutableInteger defvalue)
Attempts to resolve a mutable integer symbol. |
|
static MutableLong |
resolve(Scope scope,
String name,
MutableLong defvalue)
Attempts to resolve a mutable long symbol. |
|
static Quaternion |
resolve(Scope scope,
String name,
Quaternion defvalue)
Attempts to resolve a quaternion symbol. |
|
static String |
resolve(Scope scope,
String name,
String defvalue)
Attempts to resolve a string symbol. |
|
static
|
resolve(Scope scope,
String name,
T defvalue,
Class<T> clazz)
Attempts to resolve the identified symbol in the given scope. |
|
static Transform3D |
resolve(Scope scope,
String name,
Transform3D defvalue)
Attempts to resolve a transform symbol. |
|
static Variable |
resolve(Scope scope,
String name,
Variable defvalue)
Attempts to resolve a variable symbol. |
|
static Vector3f |
resolve(Scope scope,
String name,
Vector3f defvalue)
Attempts to resolve a vector symbol. |
|
protected static String |
stripUnderscore(String name)
Strips the leading underscore from the specified name, if present. |
|
static void |
updateBound(Object object,
Scope scope)
Updates the Bound fields of the specified object using the provided scope. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static HashMap<Class<?>,Field[]> _bound
protected static HashMap<Class<?>,HashMap<String,Member>> _scoped
| Constructor Detail |
|---|
public ScopeUtil()
| Method Detail |
|---|
public static void updateBound(Object object,
Scope scope)
Bound fields of the specified object using the provided scope.
public static Object call(Scope scope,
String name,
Object... args)
public static Quaternion resolve(Scope scope,
String name,
Quaternion defvalue)
public static Transform3D resolve(Scope scope,
String name,
Transform3D defvalue)
public static Vector3f resolve(Scope scope,
String name,
Vector3f defvalue)
public static Color4f resolve(Scope scope,
String name,
Color4f defvalue)
public static String resolve(Scope scope,
String name,
String defvalue)
public static Function resolve(Scope scope,
String name,
Function defvalue)
public static Variable resolve(Scope scope,
String name,
Variable defvalue)
public static MutableBoolean resolve(Scope scope,
String name,
MutableBoolean defvalue)
public static MutableFloat resolve(Scope scope,
String name,
MutableFloat defvalue)
public static MutableInteger resolve(Scope scope,
String name,
MutableInteger defvalue)
public static MutableLong resolve(Scope scope,
String name,
MutableLong defvalue)
public static Boolean resolve(Scope scope,
String name,
Boolean defvalue)
public static <T> T resolve(Scope scope,
String name,
T defvalue,
Class<T> clazz)
defvalue if not found anywhere in the
chain.
public static <T> T get(Object object,
String name,
Class<T> clazz)
object - the object upon which to reflect.
null if not found.protected static Field[] getBound(Class<?> clazz)
protected static Field[] createBound(Class<?> clazz)
protected static HashMap<String,Member> getScoped(Class<?> clazz)
protected static HashMap<String,Member> createScoped(Class<?> clazz)
protected static String stripUnderscore(String name)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||