Package org.smooks.engine.delivery
Class AbstractParser
- java.lang.Object
-
- org.smooks.engine.delivery.AbstractParser
-
- Direct Known Subclasses:
DOMParser
,SaxNgParser
public class AbstractParser extends Object
Abstract Parser.- Author:
- tom.fennelly@gmail.com
-
-
Field Summary
Fields Modifier and Type Field Description static String
FEATURE_OFF
static String
FEATURE_ON
static String
ORG_XML_SAX_DRIVER
-
Constructor Summary
Constructors Constructor Description AbstractParser(ExecutionContext executionContext)
AbstractParser(ExecutionContext executionContext, ResourceConfig saxDriverConfig)
Public constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
attachNamespaceDeclarationStack(XMLReader reader, ExecutionContext execContext)
static void
attachXMLReader(XMLReader xmlReader, ExecutionContext execContext)
protected void
configureReader(XMLReader xmlReader, DefaultHandler2 contentHandler, ExecutionContext executionContext, Source source)
protected InputSource
createInputSource(Source source, String contentEncoding)
protected XMLReader
createXMLReader()
static void
detachXMLReader(ExecutionContext executionContext)
protected ExecutionContext
getExecutionContext()
protected InputStream
getInputStream(StreamSource streamSource)
static Stack<XMLReader>
getReaders(ExecutionContext executionContext)
protected ResourceConfig
getSaxDriverConfig()
static ResourceConfig
getSAXParserConfiguration(ContentDeliveryConfig deliveryConfig)
Get the SAX Parser configuration for the profile associated with the supplied delivery configuration.static XMLReader
getXMLReader(ExecutionContext executionContext)
static boolean
isFeatureOff(String name, ResourceConfig saxDriverConfig)
static boolean
isFeatureOn(String name, ResourceConfig saxDriverConfig)
static void
setReaders(Stack<XMLReader> readers, ExecutionContext executionContext)
-
-
-
Field Detail
-
ORG_XML_SAX_DRIVER
public static final String ORG_XML_SAX_DRIVER
- See Also:
- Constant Field Values
-
FEATURE_ON
public static final String FEATURE_ON
- See Also:
- Constant Field Values
-
FEATURE_OFF
public static final String FEATURE_OFF
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractParser
public AbstractParser(ExecutionContext executionContext, ResourceConfig saxDriverConfig)
Public constructor.- Parameters:
executionContext
- The Smooks Container Request that the parser is being instantiated on behalf of.saxDriverConfig
- SAX Parser configuration. See .cdrl Configuration.
-
AbstractParser
public AbstractParser(ExecutionContext executionContext)
-
-
Method Detail
-
getExecutionContext
protected ExecutionContext getExecutionContext()
-
getSaxDriverConfig
protected ResourceConfig getSaxDriverConfig()
-
attachXMLReader
public static void attachXMLReader(XMLReader xmlReader, ExecutionContext execContext)
-
getXMLReader
public static XMLReader getXMLReader(ExecutionContext executionContext)
-
detachXMLReader
public static void detachXMLReader(ExecutionContext executionContext)
-
getReaders
public static Stack<XMLReader> getReaders(ExecutionContext executionContext)
-
setReaders
public static void setReaders(Stack<XMLReader> readers, ExecutionContext executionContext)
-
getSAXParserConfiguration
public static ResourceConfig getSAXParserConfiguration(ContentDeliveryConfig deliveryConfig)
Get the SAX Parser configuration for the profile associated with the supplied delivery configuration.- Parameters:
deliveryConfig
- Content delivery configuration.- Returns:
- Returns the SAX Parser configuration for the profile associated with the supplied delivery configuration, or null if no parser configuration is specified.
-
createInputSource
protected InputSource createInputSource(Source source, String contentEncoding)
-
getInputStream
protected InputStream getInputStream(StreamSource streamSource)
-
createXMLReader
protected XMLReader createXMLReader() throws SAXException
- Throws:
SAXException
-
attachNamespaceDeclarationStack
protected void attachNamespaceDeclarationStack(XMLReader reader, ExecutionContext execContext)
-
configureReader
protected void configureReader(XMLReader xmlReader, DefaultHandler2 contentHandler, ExecutionContext executionContext, Source source) throws SAXException
- Throws:
SAXException
-
isFeatureOn
public static boolean isFeatureOn(String name, ResourceConfig saxDriverConfig)
-
isFeatureOff
public static boolean isFeatureOff(String name, ResourceConfig saxDriverConfig)
-
-