public abstract class AbstractNonValidatingSAXTemplateParser extends Object implements ITemplateParser
Parses XML documents, using a standard SAX parser.
This implementation populates tree nodes with detailed location information (document name and line number).
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractNonValidatingSAXTemplateParser(int poolSize) |
| Modifier and Type | Method and Description |
|---|---|
protected ResourcePool<SAXParser> |
createSaxParsers(int poolSize,
boolean validating) |
protected ResourcePool<SAXParser> |
getNonValidatingPool() |
protected ResourcePool<SAXParser> |
getPool() |
protected TemplatePreprocessingReader |
getTemplatePreprocessingReader(Reader reader) |
List<Node> |
parseFragment(Configuration configuration,
String fragment)
Parses the document fragment contained in the given String object.
|
Document |
parseTemplate(Configuration configuration,
String documentName,
Reader reader)
Parses the document contained in the given Reader object.
|
protected boolean |
shouldAddThymeleafRootToParser() |
protected abstract List<Node> |
unwrapFragment(Document document) |
protected abstract String |
wrapFragment(String fragment) |
protected AbstractNonValidatingSAXTemplateParser(int poolSize)
protected ResourcePool<SAXParser> getPool()
protected final ResourcePool<SAXParser> getNonValidatingPool()
protected final ResourcePool<SAXParser> createSaxParsers(int poolSize, boolean validating)
public final Document parseTemplate(Configuration configuration, String documentName, Reader reader)
ITemplateParserParses the document contained in the given Reader object.
parseTemplate in interface ITemplateParserconfiguration - the Configuration objectdocumentName - the document name (optional).reader - the Reader on the document to be parsed (required).public final List<Node> parseFragment(Configuration configuration, String fragment)
ITemplateParserParses the document fragment contained in the given String object.
parseFragment in interface ITemplateParserconfiguration - the Configuration objectfragment - the String containing the fragmentprotected boolean shouldAddThymeleafRootToParser()
protected TemplatePreprocessingReader getTemplatePreprocessingReader(Reader reader)
reader - readerCopyright © 2016 The THYMELEAF team. All rights reserved.