Package ch.qos.logback.core.joran.spi
Class SimpleRuleStore
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.joran.spi.SimpleRuleStore
-
- All Implemented Interfaces:
RuleStore
,ContextAware
public class SimpleRuleStore extends ContextAwareBase implements RuleStore
This class implements theRuleStore
interface. It is the rule store implementation used by default in Joran.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
KLEENE_STAR
(package private) java.util.HashMap<ElementSelector,java.util.List<Action>>
rules
-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description SimpleRuleStore(Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
-
-
-
Field Detail
-
KLEENE_STAR
static java.lang.String KLEENE_STAR
-
rules
java.util.HashMap<ElementSelector,java.util.List<Action>> rules
-
-
Constructor Detail
-
SimpleRuleStore
public SimpleRuleStore(Context context)
-
-
Method Detail
-
addRule
public void addRule(ElementSelector elementSelector, Action action)
Add a new rule, i.e. a pattern, action pair to the rule store.Note that the added action's LoggerRepository will be set in the process.
-
addRule
public void addRule(ElementSelector elementSelector, java.lang.String actionClassName)
Description copied from interface:RuleStore
Add a new rule, given by a pattern and a action class (String).
-
matchActions
public java.util.List<Action> matchActions(ElementPath elementPath)
Description copied from interface:RuleStore
Return a list of actions matching a pattern.- Specified by:
matchActions
in interfaceRuleStore
- Parameters:
elementPath
- the path to match for- Returns:
- list of matching actions
-
fullPathMatch
java.util.List<Action> fullPathMatch(ElementPath elementPath)
-
suffixMatch
java.util.List<Action> suffixMatch(ElementPath elementPath)
-
isSuffixPattern
private boolean isSuffixPattern(ElementSelector p)
-
prefixMatch
java.util.List<Action> prefixMatch(ElementPath elementPath)
-
isKleeneStar
private boolean isKleeneStar(java.lang.String last)
-
middleMatch
java.util.List<Action> middleMatch(ElementPath path)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-