com.threerings.expr
Class ExpressionBinding

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.expr.ExpressionBinding
All Implemented Interfaces:
Exportable, Copyable, Cloneable
Direct Known Subclasses:
ExpressionBinding.Color4fBinding, ExpressionBinding.FloatBinding, ExpressionBinding.IntegerBinding, ExpressionBinding.StringBinding, ExpressionBinding.Transform3DBinding

@EditorTypes(value={ExpressionBinding.FloatBinding.class,ExpressionBinding.IntegerBinding.class,ExpressionBinding.Color4fBinding.class,ExpressionBinding.StringBinding.class,ExpressionBinding.Transform3DBinding.class})
public abstract class ExpressionBinding
extends DeepObject
implements Exportable

The superclass of the expression bindings.


Nested Class Summary
static class ExpressionBinding.Color4fBinding
          A color binding.
static class ExpressionBinding.FloatBinding
          A float binding.
static class ExpressionBinding.IntegerBinding
          An integer binding.
static class ExpressionBinding.StringBinding
          A string binding.
static class ExpressionBinding.Transform3DBinding
          A transform binding.
 
Field Summary
protected  Property[][] _flagPaths
          The cached dirty flag paths.
protected  Property[][] _paths
          The cached paths.
 String[] flags
          The paths of any dirty flags to set.
 String[] paths
          The paths of the bound variables.
 
Constructor Summary
ExpressionBinding()
           
 
Method Summary
protected  Property[][] createPaths(ConfigManager cfgmgr, Object reference, String[] paths, Class<?> type)
          Creates and returns the paths in the supplied array using the given object as a reference.
abstract  Updater createUpdater(ConfigManager cfgmgr, Scope scope, Object object)
          Creates a value updater for the supplied context and target object.
protected
<T> Updater
createUpdater(ConfigManager cfgmgr, Scope scope, Object object, ObjectExpression<T> expression, Class<T> clazz)
          Creates an updater for an object expression.
protected  Tuple<Property,Object>[] getFlags(ConfigManager cfgmgr, Object object)
          Returns the array of property/object pairs representing the flags to set.
protected  Tuple<Property,Object>[] getTargets(ConfigManager cfgmgr, Object object, Class<?> type)
          Returns the array of property/object pairs representing the targets to update.
 void invalidate()
          Invalidates any cached data.
protected  Tuple<Property,Object>[] resolvePaths(Object object, Property[][] paths)
          Resolves the supplied paths against the object, return a property/object pair to use to update the property.
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy, copy, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

paths

@Editable(width=40)
public String[] paths
The paths of the bound variables.


flags

@Editable(width=40)
public String[] flags
The paths of any dirty flags to set.


_paths

@DeepOmit
protected transient Property[][] _paths
The cached paths.


_flagPaths

@DeepOmit
protected transient Property[][] _flagPaths
The cached dirty flag paths.

Constructor Detail

ExpressionBinding

public ExpressionBinding()
Method Detail

createUpdater

public abstract Updater createUpdater(ConfigManager cfgmgr,
                                      Scope scope,
                                      Object object)
Creates a value updater for the supplied context and target object.


invalidate

public void invalidate()
Invalidates any cached data.


createUpdater

protected <T> Updater createUpdater(ConfigManager cfgmgr,
                                    Scope scope,
                                    Object object,
                                    ObjectExpression<T> expression,
                                    Class<T> clazz)
Creates an updater for an object expression.


getTargets

protected Tuple<Property,Object>[] getTargets(ConfigManager cfgmgr,
                                              Object object,
                                              Class<?> type)
Returns the array of property/object pairs representing the targets to update.

Parameters:
type - the required type.

getFlags

protected Tuple<Property,Object>[] getFlags(ConfigManager cfgmgr,
                                            Object object)
Returns the array of property/object pairs representing the flags to set.


createPaths

protected Property[][] createPaths(ConfigManager cfgmgr,
                                   Object reference,
                                   String[] paths,
                                   Class<?> type)
Creates and returns the paths in the supplied array using the given object as a reference.

Parameters:
type - the required end type.

resolvePaths

protected Tuple<Property,Object>[] resolvePaths(Object object,
                                                Property[][] paths)
Resolves the supplied paths against the object, return a property/object pair to use to update the property.