- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.joran.action.Action
-
- All Implemented Interfaces:
ContextAware
- Direct Known Subclasses:
BaseModelAction,ConsolePluginAction,ContextPropertyAction,ImplicitModelAction,NewRuleAction,NOPAction
public abstract class Action extends ContextAwareBase
Most of the work for configuring logback is done by Actions.Action methods are invoked as the XML file is parsed.
This class is largely inspired from the relevant class in the commons-digester project of the Apache Software Foundation.
- Author:
- Craig McClanahan, Christopher Lenz, Ceki Gülcü
-
-
Field Summary
Fields Modifier and Type Field Description static StringACTION_CLASS_ATTRIBUTEstatic StringCLASS_ATTRIBUTEstatic StringFILE_ATTRIBUTEstatic StringKEY_ATTRIBUTEstatic StringNAME_ATTRIBUTEstatic StringPATTERN_ATTRIBUTEstatic StringSCOPE_ATTRIBUTEstatic StringVALUE_ATTRIBUTE-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description Action()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringatLine(SaxEventInterpretationContext intercon)abstract voidbegin(SaxEventInterpretationContext intercon, String name, Attributes attributes)Called when the parser encounters an element matching aPattern.voidbody(SaxEventInterpretationContext intercon, String body)Called to pass the body (as text) contained within an element.abstract voidend(SaxEventInterpretationContext intercon, String name)protected intgetColumnNumber(SaxEventInterpretationContext intercon)protected StringgetLineColStr(SaxEventInterpretationContext intercon)static intgetLineNumber(SaxEventInterpretationContext intercon)protected StringnearLine(SaxEventInterpretationContext intercon)StringtoString()-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
-
-
-
Field Detail
-
NAME_ATTRIBUTE
public static final String NAME_ATTRIBUTE
- See Also:
- Constant Field Values
-
KEY_ATTRIBUTE
public static final String KEY_ATTRIBUTE
- See Also:
- Constant Field Values
-
VALUE_ATTRIBUTE
public static final String VALUE_ATTRIBUTE
- See Also:
- Constant Field Values
-
FILE_ATTRIBUTE
public static final String FILE_ATTRIBUTE
- See Also:
- Constant Field Values
-
CLASS_ATTRIBUTE
public static final String CLASS_ATTRIBUTE
- See Also:
- Constant Field Values
-
PATTERN_ATTRIBUTE
public static final String PATTERN_ATTRIBUTE
- See Also:
- Constant Field Values
-
SCOPE_ATTRIBUTE
public static final String SCOPE_ATTRIBUTE
- See Also:
- Constant Field Values
-
ACTION_CLASS_ATTRIBUTE
public static final String ACTION_CLASS_ATTRIBUTE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Action
public Action()
-
-
Method Detail
-
begin
public abstract void begin(SaxEventInterpretationContext intercon, String name, Attributes attributes) throws ActionException
Called when the parser encounters an element matching aPattern.- Throws:
ActionException
-
body
public void body(SaxEventInterpretationContext intercon, String body) throws ActionException
Called to pass the body (as text) contained within an element.- Parameters:
intercon-body-- Throws:
ActionException
-
end
public abstract void end(SaxEventInterpretationContext intercon, String name) throws ActionException
- Throws:
ActionException
-
getColumnNumber
protected int getColumnNumber(SaxEventInterpretationContext intercon)
-
getLineNumber
public static int getLineNumber(SaxEventInterpretationContext intercon)
-
getLineColStr
protected String getLineColStr(SaxEventInterpretationContext intercon)
-
atLine
protected String atLine(SaxEventInterpretationContext intercon)
-
nearLine
protected String nearLine(SaxEventInterpretationContext intercon)
-
-