Class Digester
java.lang.Object
org.xml.sax.helpers.XMLFilterImpl
org.frankframework.xml.FullXmlFilter
org.frankframework.configuration.digester.Digester
- All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler, XMLFilter, XMLReader
public class Digester
extends FullXmlFilter
implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
This class was made to be a replacement for the Apache Commons Digester, which was used in the old configuration parsing.
The main reason for this replacement was to have better control over the parsing process, as well as ways to create beans.
The Digester works by having a list of DigesterRules, which are matched against the current element stack.
When a rule is matched, the appropriate factory is used to create a bean.
If the newly created bean is an ApplicationContext, it is pushed on the context stack and used for the creation of child elements.
- Author:
- Niels Meijer
-
Field Summary
Fields inherited from class FullXmlFilter
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcharacters(char[] ch, int start, int length) voidendElement(String uri, String localName, String qName) @Nullable Objectpeek()voidsetApplicationContext(@NonNull org.springframework.context.ApplicationContext ac) This Class is created via the Configuration context.voidsetParsedPatterns(Map<String, DigesterRule> parsedPatterns) List of DigesterRules that apply to elements created through thisDigester.voidstartElement(String uri, String localName, String qName, Attributes atts) Methods inherited from class FullXmlFilter
comment, endCDATA, endDTD, endEntity, setContentHandler, setDocumentLocator, setParent, setParentsLexicalHandler, startCDATA, startDTD, startEntityMethods inherited from class XMLFilterImpl
endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setProperty, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContentHandler
declaration
-
Constructor Details
-
Digester
public Digester()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(@NonNull org.springframework.context.ApplicationContext ac) This Class is created via the Configuration context. This is also the first element to populate.- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
setParsedPatterns
List of DigesterRules that apply to elements created through thisDigester. -
peek
-
afterPropertiesSet
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classXMLFilterImpl- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classXMLFilterImpl- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classXMLFilterImpl- Throws:
SAXException
-