org.exolab.castor.xml.util
Class XMLParserUtils
java.lang.Object
org.exolab.castor.xml.util.XMLParserUtils
public class XMLParserUtils
extends java.lang.Object
A couple of routines to manipulate XMLParser instances. Mostly extracted
from 'old' LocalConfiguration class.
- Joachim Grueneis, jgrueneis_at_gmail_dot_com
(package private) static Log | LOG - Logger to be used.
|
static OutputFormat | getOutputFormat(Configuration configuration)
|
static Parser | getParser(Configuration configuration, String features)
|
static SAXParser | getSAXParser(boolean validation, boolean namespaces) - To get a SAXParser instance which is then used to get either
parser or XMLReader.
|
static Serializer | getSerializer(Configuration configuration)
|
static XMLSerializerFactory | getSerializerFactory(String serializerFactoryName) - Returns the currently configured XMLSerializerFactory instance.
|
static Parser | instantiateParser(String className) - Instantiates an
Parser instance directly, using Class.forName(String)
to obtain the Class instance, and uses Class.newInstance()
to create the actual instance.
|
static XMLReader | instantiateXMLReader(String className) - Instantiates an
XMLReader instance directly, using Class.forName(String)
to obtain the Class instance, and uses Class.newInstance()
to create the actual instance.
|
static void | setFeaturesOnXmlReader(String parserFeatures, String parserFeaturesToDisable, boolean validation, boolean namespaces, XMLReader xmlReader) - Sets features on XML reader instance.
|
LOG
(package private) static final Log LOG
Logger to be used.
getParser
public static Parser getParser(Configuration configuration,
String features)
getSAXParser
public static SAXParser getSAXParser(boolean validation,
boolean namespaces)
To get a SAXParser instance which is then used to get either
parser or XMLReader.
validation
- validation flag to set into parser factorynamespaces
- namespace flag to set into parser factory
- the SAXParser for further use
getSerializerFactory
public static XMLSerializerFactory getSerializerFactory(String serializerFactoryName)
Returns the currently configured XMLSerializerFactory instance.
serializerFactoryName
- the class name of the serializer factory
- XMLSerializerFactory to use by Castor
instantiateParser
public static Parser instantiateParser(String className)
Instantiates an Parser
instance directly, using Class.forName(String)
to obtain the Class
instance, and uses Class.newInstance()
to create the actual instance.
className
- The class name of the Parser
instance to be instantiated.
instantiateXMLReader
public static XMLReader instantiateXMLReader(String className)
Instantiates an XMLReader
instance directly, using Class.forName(String)
to obtain the Class
instance, and uses Class.newInstance()
to create the actual instance.
className
- The class name of the XMLReader
instance to be instantiated.
setFeaturesOnXmlReader
public static void setFeaturesOnXmlReader(String parserFeatures,
String parserFeaturesToDisable,
boolean validation,
boolean namespaces,
XMLReader xmlReader)
Sets features on XML reader instance.
validation
- Whether to enable validation or not.namespaces
- Whether to enable namespace support for not.xmlReader
- The XMLReader instance to configure.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com