Class Interpreter
DefaultHandler
which invokes
various actions
according to predefined patterns.
Patterns are kept in a RuleStore
which is programmed to store and
then later produce the applicable actions for a given pattern.
The pattern corresponding to a top level <a> element is the string
The pattern corresponding to an element <b> embedded within a top level
<a> element is the string
The pattern corresponding to an <b> and any level of nesting is "*/b. Thus, the * character placed at the beginning of a pattern serves as a wildcard for the level of nesting. Conceptually, this is very similar to the API of commons-digester. Joran offers several small advantages. First and foremost, it offers support for implicit actions which result in a significant leap in flexibility. Second, in our opinion better error reporting capability. Third, it is self-reliant. It does not depend on other APIs, in particular commons-logging which is too unreliable. Last but not least, Joran is quite tiny and is expected to remain so.
-
Field Summary
FieldsModifier and TypeFieldDescriptionTheactionListStack contains a list of actions that are executing for the given XML element.private final CAI_WithLocatorSupport
private ElementPath
(package private) EventPlayer
private final ArrayList<ImplicitAction>
private final InterpretationContext
(package private) Locator
private final RuleStore
(package private) ElementPath
If the skip nested is set, then we skip all its nested elements until it is set back to null at when the element's end is reached. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
(package private) void
callBeginAction
(List<Action> applicableActionList, String tagName, Attributes atts) private void
callBodyAction
(List<Action> applicableActionList, String body) private void
callEndAction
(List<Action> applicableActionList, String tagName) void
characters
(BodyEvent be) void
endElement
(EndEvent endEvent) private void
endElement
(String namespaceURI, String localName, String qName) getApplicableActionList
(ElementPath elementPath, Attributes attributes) Return the list of applicable patterns for thisDeprecated.(package private) String
getTagName
(String localName, String qName) lookupImplicitAction
(ElementPath elementPath, Attributes attributes, InterpretationContext ec) Check if any implicit actions are applicable.private void
This method is used tovoid
void
setInterpretationContextPropertiesMap
(Map<String, String> propertiesMap) void
void
private void
startElement
(String namespaceURI, String localName, String qName, Attributes atts)
-
Field Details
-
EMPTY_LIST
-
ruleStore
-
interpretationContext
-
implicitActions
-
cai
-
elementPath
-
locator
Locator locator -
eventPlayer
EventPlayer eventPlayer -
actionListStack
TheactionListStack contains a list of actions that are executing for the given XML element. A list of actions is pushed by the {link #startElement} and popped byendElement(ch.qos.logback.core.joran.event.EndEvent)
. -
skip
ElementPath skipIf the skip nested is set, then we skip all its nested elements until it is set back to null at when the element's end is reached.
-
-
Constructor Details
-
Interpreter
-
-
Method Details
-
getEventPlayer
-
setInterpretationContextPropertiesMap
-
getExecutionContext
Deprecated.replaced bygetInterpretationContext()
-
getInterpretationContext
-
startDocument
public void startDocument() -
startElement
-
startElement
-
pushEmptyActionList
private void pushEmptyActionList()This method is used to -
characters
-
endElement
-
endElement
-
getLocator
-
setDocumentLocator
-
getTagName
-
addImplicitAction
-
lookupImplicitAction
List<Action> lookupImplicitAction(ElementPath elementPath, Attributes attributes, InterpretationContext ec) Check if any implicit actions are applicable. As soon as an applicable action is found, it is returned. Thus, the returned list will have at most one element. -
getApplicableActionList
Return the list of applicable patterns for this -
callBeginAction
-
callBodyAction
-
callEndAction
-
getRuleStore
-
getInterpretationContext()