ariba.ui.meta.core
Class Rule

java.lang.Object
  extended by ariba.ui.meta.core.Rule

public class Rule
extends java.lang.Object

A Rule defines a map of properties that should apply in the event that a set of Selectors are matched. Given a rule base (Meta) and a set of asserted values (Context) a list of matching rules can be computed (by matching their selectors against the values) and by successively (in rank / priority order) applying (merging) their property maps a set of effective properties can be computed.


Nested Class Summary
static class Rule.AssignmentSource
           
static class Rule.Selector
          A Selector defines a sort of key/value predicate that must be satisfied for a rule to apply.
static class Rule.Wrapper
           
 
Constructor Summary
Rule(java.util.List<Rule.Selector> selectors, java.util.Map<java.lang.String,java.lang.Object> properties)
           
Rule(java.util.List<Rule.Selector> selectors, java.util.Map<java.lang.String,java.lang.Object> properties, int rank)
           
Rule(java.util.List<Rule.Selector> selectors, java.util.Map<java.lang.String,java.lang.Object> properties, int rank, int lineNumber)
           
Rule(java.util.Map selectorValues, java.util.Map properties)
           
 
Method Summary
 long apply(Meta meta, Meta.PropertyMap properties, java.lang.String declareKey, AWDebugTrace.AssignmentRecorder recorder)
           
 void disable()
           
 boolean disabled()
           
 int getLineNumber()
           
 java.util.Map<java.lang.String,java.lang.Object> getProperties()
           
 int getRank()
           
 Meta.RuleSet getRuleSet()
           
 java.util.List<Rule.Selector> getSelectors()
           
 boolean isEditable()
           
 boolean matches(ariba.ui.meta.core.Meta.MatchValue[] matchArray)
           
static long merge(Meta meta, java.util.Map<java.lang.String,java.lang.Object> src, java.util.Map<java.lang.String,java.lang.Object> dest, java.lang.String declareKey, AWDebugTrace.AssignmentRecorder recorder)
           
 void setLineNumber(int lineNumber)
           
 void setSelectors(java.util.List<Rule.Selector> preds)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule(java.util.List<Rule.Selector> selectors,
            java.util.Map<java.lang.String,java.lang.Object> properties,
            int rank,
            int lineNumber)

Rule

public Rule(java.util.List<Rule.Selector> selectors,
            java.util.Map<java.lang.String,java.lang.Object> properties,
            int rank)

Rule

public Rule(java.util.List<Rule.Selector> selectors,
            java.util.Map<java.lang.String,java.lang.Object> properties)

Rule

public Rule(java.util.Map selectorValues,
            java.util.Map properties)
Method Detail

matches

public boolean matches(ariba.ui.meta.core.Meta.MatchValue[] matchArray)

apply

public long apply(Meta meta,
                  Meta.PropertyMap properties,
                  java.lang.String declareKey,
                  AWDebugTrace.AssignmentRecorder recorder)

merge

public static long merge(Meta meta,
                         java.util.Map<java.lang.String,java.lang.Object> src,
                         java.util.Map<java.lang.String,java.lang.Object> dest,
                         java.lang.String declareKey,
                         AWDebugTrace.AssignmentRecorder recorder)

disable

public void disable()

disabled

public boolean disabled()

getLineNumber

public int getLineNumber()

setLineNumber

public void setLineNumber(int lineNumber)

getSelectors

public java.util.List<Rule.Selector> getSelectors()

setSelectors

public void setSelectors(java.util.List<Rule.Selector> preds)

getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties()

getRank

public int getRank()

getRuleSet

public Meta.RuleSet getRuleSet()

isEditable

public boolean isEditable()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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