- java.lang.Object
-
- ch.qos.logback.core.joran.spi.SaxEventInterpreter
-
public class SaxEventInterpreter extends Object
SaxEventInterpreteris Joran's driving class for handling "low-level" SAX events. It extends SAXDefaultHandlerwhich invokes variousactionsaccording to predefined patterns.Patterns are kept in a
RuleStorewhich 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 "a".
The pattern corresponding to an element <b> embedded within a top level <a> element is the string
"a/b".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.
- Author:
- Ceki Gülcü
-
-
Constructor Summary
Constructors Constructor Description SaxEventInterpreter(Context context, RuleStore rs, ElementPath initialElementPath, List<SaxEvent> saxEvents)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(BodyEvent be)voidendElement(EndEvent endEvent)ElementPathgetCopyOfElementPath()EventPlayergetEventPlayer()LocatorgetLocator()RuleStoregetRuleStore()SaxEventInterpretationContextgetSaxEventInterpretationContext()voidsetDocumentLocator(Locator l)voidsetImplicitActionSupplier(Supplier<Action> actionSupplier)voidstartDocument()voidstartElement(StartEvent se)
-
-
-
Constructor Detail
-
SaxEventInterpreter
public SaxEventInterpreter(Context context, RuleStore rs, ElementPath initialElementPath, List<SaxEvent> saxEvents)
-
-
Method Detail
-
getEventPlayer
public EventPlayer getEventPlayer()
-
getCopyOfElementPath
public ElementPath getCopyOfElementPath()
-
getSaxEventInterpretationContext
public SaxEventInterpretationContext getSaxEventInterpretationContext()
-
startDocument
public void startDocument()
-
startElement
public void startElement(StartEvent se)
-
characters
public void characters(BodyEvent be)
-
endElement
public void endElement(EndEvent endEvent)
-
getLocator
public Locator getLocator()
-
setDocumentLocator
public void setDocumentLocator(Locator l)
-
setImplicitActionSupplier
public void setImplicitActionSupplier(Supplier<Action> actionSupplier)
-
getRuleStore
public RuleStore getRuleStore()
-
-