Class BaseModelAction
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.joran.action.Action
ch.qos.logback.core.joran.action.BaseModelAction
- All Implemented Interfaces:
ContextAware
- Direct Known Subclasses:
AppenderAction, AppenderRefAction, ByPropertiesConditionAction, ConfigurationAction, ContextNameAction, ConversionRuleAction, DefinePropertyAction, ElseAction, EventEvaluatorAction, IfAction, ImportAction, InsertFromJNDIAction, LevelAction, LoggerAction, LoggerContextListenerAction, ParamAction, PropertyAction, ResourceAction, RootLoggerAction, SequenceNumberGeneratorAction, SerializeModelAction, ShutdownHookAction, SiftAction, StatusListenerAction, ThenAction, TimestampAction
-
Field Summary
Fields inherited from class Action
ACTION_CLASS_ATTRIBUTE, CLASS_ATTRIBUTE, FILE_ATTRIBUTE, KEY_ATTRIBUTE, NAME_ATTRIBUTE, PATTERN_ATTRIBUTE, SCOPE_ATTRIBUTE, VALUE_ATTRIBUTEFields inherited from class ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin(SaxEventInterpretationContext saxEventInterpretationContext, String name, Attributes attributes) Called when the parser encounters an element matching aPattern.voidbody(SaxEventInterpretationContext ec, String body) Called to pass the body (as text) contained within an element.protected abstract ModelbuildCurrentModel(SaxEventInterpretationContext interpretationContext, String name, Attributes attributes) Builds and returns a Model instance for the current XML element being processed.voidend(SaxEventInterpretationContext saxEventInterpretationContext, String name) protected booleanvalidPreconditions(SaxEventInterpretationContext intercon, String name, Attributes attributes) Validate preconditions of this action.Methods inherited from class Action
atLine, getColumnNumber, getLineColStr, getLineNumber, nearLine, toStringMethods inherited from class ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
Constructor Details
-
BaseModelAction
public BaseModelAction()
-
-
Method Details
-
begin
public void begin(SaxEventInterpretationContext saxEventInterpretationContext, String name, Attributes attributes) throws ActionException Description copied from class:ActionCalled when the parser encounters an element matching aPattern.- Specified by:
beginin classAction- Throws:
ActionException
-
buildCurrentModel
protected abstract Model buildCurrentModel(SaxEventInterpretationContext interpretationContext, String name, Attributes attributes) Builds and returns a Model instance for the current XML element being processed.This method is called during the begin phase of XML processing to create a Model object that represents the current element. The returned model will be configured with the element's tag name, line number, and will be pushed onto the model stack.
- Parameters:
interpretationContext- the context for interpreting SAX events, providing access to the model stack and other interpretation statename- the name of the XML element being processedattributes- the attributes of the XML element- Returns:
- a new Model instance representing the current XML element
-
validPreconditions
protected boolean validPreconditions(SaxEventInterpretationContext intercon, String name, Attributes attributes) Validate preconditions of this action. By default, true is returned. Subclasses should override appropriately.- Parameters:
intercon-name-attributes-- Returns:
-
body
Description copied from class:ActionCalled to pass the body (as text) contained within an element.- Overrides:
bodyin classAction- Parameters:
ec-body-- Throws:
ActionException
-
end
public void end(SaxEventInterpretationContext saxEventInterpretationContext, String name) throws ActionException - Specified by:
endin classAction- Throws:
ActionException
-