ariba.ui.meta.core
Class Context

java.lang.Object
  extended by ariba.ui.meta.core.Context
All Implemented Interfaces:
Extensible
Direct Known Subclasses:
ObjectMeta.ObjectMetaContext

public class Context
extends java.lang.Object
implements Extensible

Context represents a stack of assignments (e.g. class=User, field=birthDay, operation=edit) The current set of assignments can be retrieved via values(). The current values are run against the Meta rule set to compute the effective PropertyMap (e.g. visible:true, editable:true, component:AWTextField). Some rule evaluations result in *chaining* -- where additional assignments that are "implied" by the current assignments are applied, (resulting in a revised computation of the current PropertyMap, and possible further chaining). (e.g. field=birthDay may result in type=Date which may result in component:DatePicker) Assignments can be scoped and popped (push(), set(key, value); ...; pop()). The actual computation of rule matches is cached so once a "path" down the context tree has been exercized subsequent matching traversals (even by other threads/users) is fast.


Nested Class Summary
static class Context.AssignmentInfo
          An externally intelligible snapshot of an assignment in a InspectorInfo Context snapshot for use by Inspectors / Editors.
static interface Context.AssignmentRecord
           
static class Context.FieldValue_ContextPropertyAccessor
           
static class Context.InspectorInfo
          An externally intelligible snapshot of current Context state for use by Inspectors / Editors.
 class Context.PropertyAccessor
          PropertyAccessor provides a handle for FieldValue lookups on the Context properties that should lookup and resolve property values.
static class Context.Snapshot
           
 
Field Summary
static Meta.PropertyMap EmptyMap
           
 
Constructor Summary
Context(Meta meta)
           
 
Method Summary
 Meta.PropertyMap allProperties()
           
static java.util.Map<Rule.AssignmentSource,java.util.List<AWDebugTrace.Assignment>> assignmentMap(Context.AssignmentRecord arec)
           
 boolean booleanPropertyForKey(java.lang.String key, boolean defaultVal)
           
 boolean currentRecordPathMatches(Context.AssignmentRecord rec)
           
 boolean currentRecordPathMatches(Context.InspectorInfo other)
           
 void debug()
           
 java.lang.String debugString()
           
 java.lang.Object debugTracePropertyProvider()
           
static java.lang.Object elementOrFirst(java.lang.Object listOrElement)
           
 java.util.Map extendedFields()
          Returns the Map in which the dynamically added fields reside.
 java.util.List listPropertyForKey(java.lang.String key)
           
 void merge(java.lang.String key, java.lang.Object value)
           
 Meta meta()
           
static java.lang.Object newInnerInstance(java.lang.Class innerClass, java.lang.Object outerInstance)
           
 void pop()
           
 java.lang.Object properties()
           
 java.lang.Object propertyForKey(java.lang.String key)
           
 void push()
           
 java.lang.Object pushAndResolve(java.util.Map<java.lang.String,java.lang.Object> contextVals, java.lang.String propertyKey)
           
 java.lang.Object pushAndResolve(java.util.Map<java.lang.String,java.lang.Object> contextVals, java.lang.String propertyKey, boolean staticResolve)
           
 java.lang.Object resolveValue(java.lang.Object value)
           
 void set(java.lang.String key, java.lang.Object value)
           
 void setScopeKey(java.lang.String key)
           
 Context.Snapshot snapshot()
           
 java.lang.Object staticallyResolveValue(java.lang.Object value)
           
static Context.InspectorInfo staticContext(Meta meta, Context.AssignmentRecord arec)
           
static Context.InspectorInfo staticContext(Meta meta, Context.AssignmentRecord arec, boolean includeSetInfo)
           
 java.util.Map values()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EmptyMap

public static final Meta.PropertyMap EmptyMap
Constructor Detail

Context

public Context(Meta meta)
Method Detail

push

public void push()

pop

public void pop()

set

public void set(java.lang.String key,
                java.lang.Object value)

merge

public void merge(java.lang.String key,
                  java.lang.Object value)

setScopeKey

public void setScopeKey(java.lang.String key)

meta

public Meta meta()

values

public java.util.Map values()

extendedFields

public java.util.Map extendedFields()
Description copied from interface: Extensible
Returns the Map in which the dynamically added fields reside.

Specified by:
extendedFields in interface Extensible

properties

public java.lang.Object properties()

propertyForKey

public java.lang.Object propertyForKey(java.lang.String key)

listPropertyForKey

public java.util.List listPropertyForKey(java.lang.String key)

booleanPropertyForKey

public boolean booleanPropertyForKey(java.lang.String key,
                                     boolean defaultVal)

allProperties

public Meta.PropertyMap allProperties()

resolveValue

public java.lang.Object resolveValue(java.lang.Object value)

staticallyResolveValue

public java.lang.Object staticallyResolveValue(java.lang.Object value)

pushAndResolve

public java.lang.Object pushAndResolve(java.util.Map<java.lang.String,java.lang.Object> contextVals,
                                       java.lang.String propertyKey,
                                       boolean staticResolve)

pushAndResolve

public java.lang.Object pushAndResolve(java.util.Map<java.lang.String,java.lang.Object> contextVals,
                                       java.lang.String propertyKey)

snapshot

public Context.Snapshot snapshot()

debug

public void debug()

debugString

public java.lang.String debugString()

newInnerInstance

public static java.lang.Object newInnerInstance(java.lang.Class innerClass,
                                                java.lang.Object outerInstance)

elementOrFirst

public static java.lang.Object elementOrFirst(java.lang.Object listOrElement)

assignmentMap

public static java.util.Map<Rule.AssignmentSource,java.util.List<AWDebugTrace.Assignment>> assignmentMap(Context.AssignmentRecord arec)

staticContext

public static Context.InspectorInfo staticContext(Meta meta,
                                                  Context.AssignmentRecord arec)

staticContext

public static Context.InspectorInfo staticContext(Meta meta,
                                                  Context.AssignmentRecord arec,
                                                  boolean includeSetInfo)

debugTracePropertyProvider

public java.lang.Object debugTracePropertyProvider()

currentRecordPathMatches

public boolean currentRecordPathMatches(Context.AssignmentRecord rec)

currentRecordPathMatches

public boolean currentRecordPathMatches(Context.InspectorInfo other)


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.