|
Log4j 1.3alpha-1 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--org.apache.joran.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> embeded 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 a big no-no for log4j. Last but not least, joran is quite tiny and is expected to remain so.
Constructor Summary | |
Interpreter(RuleStore rs)
|
Method Summary | |
void |
addImplcitAction(ImplicitAction ia)
|
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
|
void |
endPrefixMapping(java.lang.String prefix)
|
void |
error(SAXParseException spe)
|
void |
fatalError(SAXParseException spe)
|
EntityResolver |
getEntityResolver()
|
ExecutionContext |
getExecutionContext()
|
Locator |
getLocator()
|
RuleStore |
getRuleStore()
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
void |
processingInstruction(java.lang.String target,
java.lang.String data)
|
InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
If a specific entityResolver is set for this Interpreter instance, then we use it to resolve entities. |
void |
setDocumentLocator(Locator l)
|
void |
setEntityResolver(EntityResolver entityResolver)
|
void |
setRuleStore(RuleStore ruleStore)
|
void |
skippedEntity(java.lang.String name)
|
void |
startDocument()
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
Attributes atts)
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
|
void |
warning(SAXParseException spe)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, notationDecl, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Interpreter(RuleStore rs)
Method Detail |
public ExecutionContext getExecutionContext()
public void startDocument()
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes atts)
startElement
in interface ContentHandler
startElement
in class DefaultHandler
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
endElement
in interface ContentHandler
endElement
in class DefaultHandler
public Locator getLocator()
public void setDocumentLocator(Locator l)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class DefaultHandler
public void addImplcitAction(ImplicitAction ia)
public RuleStore getRuleStore()
public void setRuleStore(RuleStore ruleStore)
public void error(SAXParseException spe) throws SAXException
error
in interface ErrorHandler
error
in class DefaultHandler
SAXException
public void fatalError(SAXParseException spe) throws SAXException
fatalError
in interface ErrorHandler
fatalError
in class DefaultHandler
SAXException
public void warning(SAXParseException spe) throws SAXException
warning
in interface ErrorHandler
warning
in class DefaultHandler
SAXException
public void endPrefixMapping(java.lang.String prefix)
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class DefaultHandler
public void ignorableWhitespace(char[] ch, int start, int length)
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class DefaultHandler
public void processingInstruction(java.lang.String target, java.lang.String data)
processingInstruction
in interface ContentHandler
processingInstruction
in class DefaultHandler
public void skippedEntity(java.lang.String name)
skippedEntity
in interface ContentHandler
skippedEntity
in class DefaultHandler
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class DefaultHandler
public EntityResolver getEntityResolver()
public void setEntityResolver(EntityResolver entityResolver)
public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws SAXException
Due to inexplicable voodoo, the original resolveEntity method in org.xml.sax.helpers.DefaultHandler declares throwing an IOException, whereas the org.xml.sax.helpers.DefaultHandler class included in JDK 1.4 masks this exception.
In order to compile under JDK 1.4, we are forced to mask the IOException as well. Since its signatures varies, we cannot call our super class' resolveEntity method. We are forced to implement the default behavior ourselves, which in this case, is just returning null.
resolveEntity
in interface EntityResolver
resolveEntity
in class DefaultHandler
SAXException
|
Log4j 1.3alpha-1 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |