|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.castor.xml.util.XMLParserUtils
public class XMLParserUtils
A couple of routines to manipulate XMLParser instances. Mostly extracted from 'old' LocalConfiguration class.
| Constructor Summary | |
|---|---|
XMLParserUtils()
|
|
| Method Summary | |
|---|---|
static OutputFormat |
getOutputFormat(AbstractProperties properties)
|
static Parser |
getParser(AbstractProperties properties,
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 SAXParser |
getSAXParser(SAXParserFactory saxParserFactory)
To get a SAXParser instance from a given SAXParserFactory, which is then used to obtain either
Parser or XMLReader. |
static SAXParserFactory |
getSAXParserFactory(boolean validation,
boolean namespaces)
To get a SAXParserFactory instance which is then used to obtain an SAXParser instance. |
static Serializer |
getSerializer(AbstractProperties properties)
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLParserUtils()
| Method Detail |
|---|
public static void setFeaturesOnXmlReader(String parserFeatures,
String parserFeaturesToDisable,
boolean validation,
boolean namespaces,
XMLReader xmlReader)
properties - the Properties to read parser features fromdefaultFeatures - any default features to usevalidation - Whether to enable validation or not.namespaces - Whether to enable namespace support for not.xmlReader - The XMLReader instance to configure.
public static SAXParser getSAXParser(boolean validation,
boolean namespaces)
validation - validation flag to set into parser factorynamespaces - namespace flag to set into parser factory
public static SAXParser getSAXParser(SAXParserFactory saxParserFactory)
SAXParserFactory, which is then used to obtain either
Parser or XMLReader.
SAXParser for further use
public static SAXParserFactory getSAXParserFactory(boolean validation,
boolean namespaces)
SAXParser instance.
namespaces - Whether to provide namespace support.validation - Whether to produce a validating SAX parser.
public static XMLReader instantiateXMLReader(String className)
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.
XMLReader instance.public static Parser instantiateParser(String className)
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.
Parser instance.
public static Parser getParser(AbstractProperties properties,
String features)
public static Serializer getSerializer(AbstractProperties properties)
InternalContext.getSerializer()public static OutputFormat getOutputFormat(AbstractProperties properties)
InternalContext.getOutputFormat()public static XMLSerializerFactory getSerializerFactory(String serializerFactoryName)
serializerFactoryName - the class name of the serializer factory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||