org.thymeleaf.templateparser.xmlsax
Class AbstractNonValidatingSAXTemplateParser

Object
  extended by org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser
All Implemented Interfaces:
ITemplateParser
Direct Known Subclasses:
AbstractValidatingSAXTemplateParser, XhtmlAndHtml5NonValidatingSAXTemplateParser, XmlNonValidatingSAXTemplateParser

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).

Since:
2.0.0
Author:
Guven Demir, Daniel Fernández

Constructor Summary
protected AbstractNonValidatingSAXTemplateParser(int poolSize)
           
 
Method Summary
protected  ResourcePool<javax.xml.parsers.SAXParser> createSaxParsers(int poolSize, boolean validating)
           
protected  ResourcePool<javax.xml.parsers.SAXParser> getNonValidatingPool()
           
protected  ResourcePool<javax.xml.parsers.SAXParser> getPool()
           
 java.util.List<Node> parseFragment(Configuration configuration, String fragment)
           Parses the document fragment contained in the given String object.
 Document parseTemplate(Configuration configuration, String documentName, java.io.Reader reader)
           Parses the document contained in the given Reader object.
protected abstract  java.util.List<Node> unwrapFragment(Document document)
           
protected abstract  String wrapFragment(String fragment)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractNonValidatingSAXTemplateParser

protected AbstractNonValidatingSAXTemplateParser(int poolSize)
Method Detail

getPool

protected ResourcePool<javax.xml.parsers.SAXParser> getPool()

getNonValidatingPool

protected final ResourcePool<javax.xml.parsers.SAXParser> getNonValidatingPool()

createSaxParsers

protected final ResourcePool<javax.xml.parsers.SAXParser> createSaxParsers(int poolSize,
                                                                           boolean validating)

parseTemplate

public final Document parseTemplate(Configuration configuration,
                                    String documentName,
                                    java.io.Reader reader)
Description copied from interface: ITemplateParser

Parses the document contained in the given Reader object.

Specified by:
parseTemplate in interface ITemplateParser
Parameters:
configuration - the Configuration object
documentName - the document name (optional).
reader - the Reader on the document to be parsed (required).
Returns:
the parsed Document.

parseFragment

public final java.util.List<Node> parseFragment(Configuration configuration,
                                                String fragment)
Description copied from interface: ITemplateParser

Parses the document fragment contained in the given String object.

Specified by:
parseFragment in interface ITemplateParser
Parameters:
configuration - the Configuration object
fragment - the String containing the fragment
Returns:
the resulting list of nodes.

wrapFragment

protected abstract String wrapFragment(String fragment)

unwrapFragment

protected abstract java.util.List<Node> unwrapFragment(Document document)


Copyright © 2012 The THYMELEAF team. All Rights Reserved.