Additional top-level class in compilation unit: CAI_WithLocatorSupport.
SaxEventInterpreter is Joran's driving class for handling "low-level"
SAX events. It extends SAX 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 "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.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Stack | actionStack
The <id>actionStack</id> contain the action that is executing for the given XML element. |
| private final CAI_WithLocatorSupport | |
| pack-priv Context | |
| private ElementPath | |
| pack-priv EventPlayer | |
| private Supplier | |
| private final SaxEventInterpretationContext | |
| pack-priv Locator | |
| private static Action | |
| private final RuleStore | |
| pack-priv ElementPath | skip
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. |
| Access | Constructor and Description |
|---|---|
| public | SaxEventInterpreter(Context context, RuleStore rs, ElementPath initialElementPath, List<SaxEvent> saxEvents)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| private void | |
| private void | |
| public void | |
| public void | |
| private void | |
| pack-priv Action | getApplicableAction(ElementPath elementPath, Attributes attributes)
Return the list of applicable patterns for this |
| public ElementPath | |
| public EventPlayer | |
| public Locator | |
| public RuleStore | |
| public SaxEventInterpretationContext | |
| pack-priv String | |
| private void | |
| public void | |
| public void | |
| public void | |
| public void | |
| private void |
| actionStack | back to summary |
|---|---|
| pack-priv Stack<Action> actionStack The <id>actionStack</id> contain the action that is executing
for the given XML element.
An action is pushed by the {link #startElement} and popped by
| |
| cai | back to summary |
|---|---|
| private final CAI_WithLocatorSupport cai | |
| context | back to summary |
|---|---|
| pack-priv Context context | |
| elementPath | back to summary |
|---|---|
| private ElementPath elementPath | |
| eventPlayer | back to summary |
|---|---|
| pack-priv EventPlayer eventPlayer | |
| implicitActionSupplier | back to summary |
|---|---|
| private Supplier<Action> implicitActionSupplier | |
| interpretationContext | back to summary |
|---|---|
| private final SaxEventInterpretationContext interpretationContext | |
| locator | back to summary |
|---|---|
| pack-priv Locator locator | |
| NOP_ACTION_SINGLETON | back to summary |
|---|---|
| private static Action NOP_ACTION_SINGLETON | |
| ruleStore | back to summary |
|---|---|
| private final RuleStore ruleStore | |
| skip | back to summary |
|---|---|
| pack-priv ElementPath skip 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. | |
| SaxEventInterpreter | back to summary |
|---|---|
| public SaxEventInterpreter(Context context, RuleStore rs, ElementPath initialElementPath, List<SaxEvent> saxEvents) | |
| callBeginAction | back to summary |
|---|---|
| pack-priv void callBeginAction(Action applicableAction, String tagName, Attributes atts) | |
| callBodyAction | back to summary |
|---|---|
| private void callBodyAction(Action applicableAction, String body) | |
| callEndAction | back to summary |
|---|---|
| private void callEndAction(Action applicableAction, String tagName) | |
| characters | back to summary |
|---|---|
| public void characters(BodyEvent be) | |
| endElement | back to summary |
|---|---|
| public void endElement(EndEvent endEvent) | |
| endElement | back to summary |
|---|---|
| private void endElement(String namespaceURI, String localName, String qName) | |
| getApplicableAction | back to summary |
|---|---|
| pack-priv Action getApplicableAction(ElementPath elementPath, Attributes attributes) Return the list of applicable patterns for this | |
| getCopyOfElementPath | back to summary |
|---|---|
| public ElementPath getCopyOfElementPath() | |
| getEventPlayer | back to summary |
|---|---|
| public EventPlayer getEventPlayer() | |
| getLocator | back to summary |
|---|---|
| public Locator getLocator() | |
| getRuleStore | back to summary |
|---|---|
| public RuleStore getRuleStore() | |
| getSaxEventInterpretationContext | back to summary |
|---|---|
| public SaxEventInterpretationContext getSaxEventInterpretationContext() | |
| getTagName | back to summary |
|---|---|
| pack-priv String getTagName(String localName, String qName) | |
| pushEmptyActionOntoActionStack | back to summary |
|---|---|
| private void pushEmptyActionOntoActionStack() This method is used to | |
| setDocumentLocator | back to summary |
|---|---|
| public void setDocumentLocator(Locator l) | |
| setImplicitActionSupplier | back to summary |
|---|---|
| public void setImplicitActionSupplier(Supplier<Action> actionSupplier) | |
| startDocument | back to summary |
|---|---|
| public void startDocument() | |
| startElement | back to summary |
|---|---|
| public void startElement(StartEvent se) | |
| startElement | back to summary |
|---|---|
| private void startElement(String namespaceURI, String localName, String qName, Attributes atts) | |