public class SimpleRuleStore extends ContextAwareBase implements RuleStore
RuleStore interface. It is the rule store
implementation used by default in Joran.| Modifier and Type | Field and Description |
|---|---|
(package private) static java.lang.String |
KLEENE_STAR |
(package private) java.util.HashMap<ElementSelector,java.util.List<Action>> |
rules |
context| Constructor and Description |
|---|
SimpleRuleStore(Context context) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRule(ElementSelector elementSelector,
Action action)
Add a new rule, i.e.
|
void |
addRule(ElementSelector elementSelector,
java.lang.String actionClassName)
Add a new rule, given by a pattern and a action class (String).
|
(package private) java.util.List<Action> |
fullPathMatch(ElementPath elementPath) |
private boolean |
isKleeneStar(java.lang.String last) |
private boolean |
isSuffixPattern(ElementSelector p) |
java.util.List<Action> |
matchActions(ElementPath elementPath)
Return a list of actions matching a pattern.
|
(package private) java.util.List<Action> |
middleMatch(ElementPath path) |
(package private) java.util.List<Action> |
prefixMatch(ElementPath elementPath) |
(package private) java.util.List<Action> |
suffixMatch(ElementPath elementPath) |
java.lang.String |
toString() |
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextstatic java.lang.String KLEENE_STAR
java.util.HashMap<ElementSelector,java.util.List<Action>> rules
public SimpleRuleStore(Context context)
public void addRule(ElementSelector elementSelector, Action action)
Note that the added action's LoggerRepository will be set in the process.
public void addRule(ElementSelector elementSelector, java.lang.String actionClassName)
RuleStorepublic java.util.List<Action> matchActions(ElementPath elementPath)
RuleStorematchActions in interface RuleStoreelementPath - the path to match forjava.util.List<Action> fullPathMatch(ElementPath elementPath)
java.util.List<Action> suffixMatch(ElementPath elementPath)
private boolean isSuffixPattern(ElementSelector p)
java.util.List<Action> prefixMatch(ElementPath elementPath)
private boolean isKleeneStar(java.lang.String last)
java.util.List<Action> middleMatch(ElementPath path)
public java.lang.String toString()
toString in class java.lang.Object