ariba.ui.meta.core
Class Meta

java.lang.Object
  extended by ariba.ui.meta.core.Meta
Direct Known Subclasses:
ObjectMeta

public class Meta
extends java.lang.Object

Meta is the core class in MetaUI. An instance of meta represents a "Rule Base" (a repository rules), and this rule base is used to compute property maps based on a series of key/value constraints (typically based on the current values in a Context instance). Typically a single Meta instance is shared process wide, usually by way of multiple Context instances on various threads. Meta works in concert with Match.MatchResult to cache partial matches (match trees) with cached computed property maps. Meta is generally used by way of its subclasses ObjectMeta and UIMeta (which extend Meta with behaviors around auto-creating rules for references Java classes, auto-reading rule files associated with referenced java packages, and dynamic properties for field and layout zoning)


Nested Class Summary
static class Meta.OverrideValue
          Wrapper for a value that should, in rule application, override any previous value for its property.
 class Meta.PropertyManager
          Store of policy information for particular properties -- most significantly, how successive values of this property are to be *merged* during rule application.
static class Meta.PropertyMap
          The Map type used to accumulate the effective properties through the successive application of rules.
static interface Meta.PropertyMapAwaking
          Called on implementing values to allow statically resolvable (but dynamic) values to evaluate/copy themselves for inclusion in a new map (to ensure that a value that derived its value based on a different context doesn't get reused in another)
static interface Meta.PropertyMerger
          Define policy for merging a property value assigned by one rule to a subsequent value from a higher ranked rule.
static class Meta.PropertyMerger_And
          PropertyMerger implementing AND semantics -- i.e.
static class Meta.PropertyMergerDeclareList
          PropertyMerger for properties the should override normally, but return lists when in declare mode (e.g.
static interface Meta.PropertyMergerDynamic
           
static interface Meta.PropertyMergerIsChaining
           
 class Meta.RuleSet
          A group of rules originating from a common source.
static interface Meta.ValueQueriedObserver
          Implemented by observers for notification of when a paricular key/value has been referenced in the rule base for the first time.
 
Field Summary
static int ClassRulePriority
           
static int EditorRulePriority
           
static java.lang.String KeyAny
           
static java.lang.String KeyDeclare
           
static java.lang.String KeyTrait
           
static int LowRulePriority
           
static Meta.PropertyMerger PropertyMerger_DeclareList
           
static Meta.PropertyMerger PropertyMerger_List
          PropertyMerger for properties the should be unioned as lists
 Meta.PropertyMerger PropertyMerger_Traits
          PropertyMerger for the 'trait' property.
static java.lang.String RuleFileDelimeter
           
static java.lang.String RuleFileDelimeterStart
           
static int SystemRulePriority
           
static int TemplateRulePriority
           
static ariba.ui.meta.core.Meta.KeyValueTransformer Transformer_KeyPresent
           
 
Constructor Summary
Meta()
           
 
Method Summary
 void _addRule(Rule rule, boolean checkPropScope)
           
 java.util.List<Rule> _addRuleAndReturnExtras(Rule rule)
           
 void _logRuleStats()
           
 void _resumeEditingRuleSet(Meta.RuleSet ruleSet)
           
 java.util.List<Rule> _updateEditedRule(Rule rule, java.util.List<Rule> extras)
           
 void addRule(java.util.Map selectorMap, java.util.Map propertyMap)
           
 void addRule(java.util.Map selectorMap, java.util.Map propertyMap, int rank)
           
 void addRule(Rule rule)
           
 void addRules(java.util.Map<java.lang.String,java.lang.Object> ruleSet)
           
 void addRules(java.util.Map<java.lang.String,java.lang.Object> ruleSet, java.util.List selectors)
           
static void addTrait(java.lang.String trait, java.util.Map map)
           
static void addTraits(java.util.List traits, java.util.Map map)
           
 void beginReplacementRuleSet(Meta.RuleSet orig)
           
 void beginRuleSet(int rank, java.lang.String filePath)
           
 void beginRuleSet(java.lang.String filePath)
           
 void defineKeyAsPropertyScope(java.lang.String contextKey)
           
 Meta.RuleSet endRuleSet()
           
 void invalidateRules()
           
static boolean isPropertyScopeKey(java.lang.String key)
           
 void loadRules(java.lang.String ruleText)
           
 void loadRules(java.lang.String filename, java.io.InputStream inputStream, int rank, boolean editable)
           
 Meta.PropertyMerger mergerForProperty(java.lang.String propertyName)
           
 void mirrorPropertyToContext(java.lang.String propertyName, java.lang.String contextKey)
           
 Context newContext()
           
 java.lang.String parsePropertyAssignment(java.lang.String propString, java.util.Map propertyMap)
           
 boolean propertyWillDoMerge(java.lang.String propertyName, java.lang.Object origValue)
           
 void registerKeyInitObserver(java.lang.String key, Meta.ValueQueriedObserver o)
           
 void registerPropertyMerger(java.lang.String propertyName, Meta.PropertyMerger merger)
           
 void registerValueTransformerForKey(java.lang.String key, ariba.ui.meta.core.Meta.KeyValueTransformer transformer)
           
 int ruleSetGeneration()
           
 java.lang.String scopeKeyForSelector(java.util.List<Rule.Selector> preds)
           
 void touch(java.lang.String key, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KeyAny

public static final java.lang.String KeyAny
See Also:
Constant Field Values

KeyDeclare

public static final java.lang.String KeyDeclare
See Also:
Constant Field Values

KeyTrait

public static final java.lang.String KeyTrait
See Also:
Constant Field Values

LowRulePriority

public static final int LowRulePriority
See Also:
Constant Field Values

SystemRulePriority

public static final int SystemRulePriority
See Also:
Constant Field Values

ClassRulePriority

public static final int ClassRulePriority
See Also:
Constant Field Values

TemplateRulePriority

public static final int TemplateRulePriority
See Also:
Constant Field Values

EditorRulePriority

public static final int EditorRulePriority
See Also:
Constant Field Values

RuleFileDelimeter

public static final java.lang.String RuleFileDelimeter
See Also:
Constant Field Values

RuleFileDelimeterStart

public static final java.lang.String RuleFileDelimeterStart
See Also:
Constant Field Values

Transformer_KeyPresent

public static final ariba.ui.meta.core.Meta.KeyValueTransformer Transformer_KeyPresent

PropertyMerger_List

public static Meta.PropertyMerger PropertyMerger_List
PropertyMerger for properties the should be unioned as lists


PropertyMerger_DeclareList

public static Meta.PropertyMerger PropertyMerger_DeclareList

PropertyMerger_Traits

public Meta.PropertyMerger PropertyMerger_Traits
PropertyMerger for the 'trait' property. Generally, traits are unioned, except for traits from the same "traitGroup", which override (i.e. only one trait from each traitGroup should survive).

Constructor Detail

Meta

public Meta()
Method Detail

addRule

public void addRule(Rule rule)

_addRule

public void _addRule(Rule rule,
                     boolean checkPropScope)

_addRuleAndReturnExtras

public java.util.List<Rule> _addRuleAndReturnExtras(Rule rule)

_updateEditedRule

public java.util.List<Rule> _updateEditedRule(Rule rule,
                                              java.util.List<Rule> extras)

scopeKeyForSelector

public java.lang.String scopeKeyForSelector(java.util.List<Rule.Selector> preds)

addRule

public void addRule(java.util.Map selectorMap,
                    java.util.Map propertyMap)

addRule

public void addRule(java.util.Map selectorMap,
                    java.util.Map propertyMap,
                    int rank)

addRules

public void addRules(java.util.Map<java.lang.String,java.lang.Object> ruleSet,
                     java.util.List selectors)

addRules

public void addRules(java.util.Map<java.lang.String,java.lang.Object> ruleSet)

loadRules

public void loadRules(java.lang.String filename,
                      java.io.InputStream inputStream,
                      int rank,
                      boolean editable)

loadRules

public void loadRules(java.lang.String ruleText)

parsePropertyAssignment

public java.lang.String parsePropertyAssignment(java.lang.String propString,
                                                java.util.Map propertyMap)

beginRuleSet

public void beginRuleSet(java.lang.String filePath)

beginRuleSet

public void beginRuleSet(int rank,
                         java.lang.String filePath)

beginReplacementRuleSet

public void beginReplacementRuleSet(Meta.RuleSet orig)

endRuleSet

public Meta.RuleSet endRuleSet()

_resumeEditingRuleSet

public void _resumeEditingRuleSet(Meta.RuleSet ruleSet)

ruleSetGeneration

public int ruleSetGeneration()

invalidateRules

public void invalidateRules()

newContext

public Context newContext()

touch

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

registerKeyInitObserver

public void registerKeyInitObserver(java.lang.String key,
                                    Meta.ValueQueriedObserver o)

registerValueTransformerForKey

public void registerValueTransformerForKey(java.lang.String key,
                                           ariba.ui.meta.core.Meta.KeyValueTransformer transformer)

propertyWillDoMerge

public boolean propertyWillDoMerge(java.lang.String propertyName,
                                   java.lang.Object origValue)

mirrorPropertyToContext

public void mirrorPropertyToContext(java.lang.String propertyName,
                                    java.lang.String contextKey)

defineKeyAsPropertyScope

public void defineKeyAsPropertyScope(java.lang.String contextKey)

isPropertyScopeKey

public static boolean isPropertyScopeKey(java.lang.String key)

registerPropertyMerger

public void registerPropertyMerger(java.lang.String propertyName,
                                   Meta.PropertyMerger merger)

mergerForProperty

public Meta.PropertyMerger mergerForProperty(java.lang.String propertyName)

addTraits

public static void addTraits(java.util.List traits,
                             java.util.Map map)

addTrait

public static void addTrait(java.lang.String trait,
                            java.util.Map map)

_logRuleStats

public void _logRuleStats()


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