/* */ package org.jaxen.saxpath.helpers;
/* */
/* */ import org.jaxen.saxpath.
SAXPathException;
/* */ import org.jaxen.saxpath.
XPathReader;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class
XPathReaderFactory
/* */ {
/* */ public static final
String DRIVER_PROPERTY = "org.saxpath.driver";
/* */ protected static final
String DEFAULT_DRIVER = "org.jaxen.saxpath.base.XPathReader";
/* */
/* */ public static
XPathReader createReader() throws
SAXPathException {
/* 92 */
String className = null;
/* */
/* */
/* */ try {
/* 96 */
className =
System.
getProperty("org.saxpath.driver");
/* */ }
/* 98 */ catch (
SecurityException e) {}
/* */
/* */
/* */
/* */
/* 103 */ if (
className == null ||
className.
length() == 0)
/* */ {
/* */
/* */
/* 107 */
className = "org.jaxen.saxpath.base.XPathReader";
/* */ }
/* */
/* 110 */ return
createReader(
className);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static
XPathReader createReader(
String className) throws
SAXPathException {
/* 128 */
Class readerClass = null;
/* 129 */
XPathReader reader = null;
/* */
/* */
/* */
/* */
/* */
/* */
/* */ try {
/* 137 */
readerClass =
Class.
forName(
className, true,
XPathReaderFactory.class.
getClassLoader());
/* */
/* */
/* */
/* */
/* */
/* */
/* 144 */ if (!
XPathReader.class.
isAssignableFrom(
readerClass))
/* */ {
/* 146 */ throw new
SAXPathException("Class [" +
className + "] does not implement the org.jaxen.saxpath.XPathReader interface.");
/* */
/* */ }
/* */ }
/* 150 */ catch (
ClassNotFoundException e) {
/* */
/* 152 */ throw new
SAXPathException(
e);
/* */ }
/* */
/* */
/* */ try {
/* 157 */
reader = (
XPathReader)
readerClass.
newInstance();
/* */ }
/* 159 */ catch (
IllegalAccessException e) {
/* */
/* 161 */ throw new
SAXPathException(
e);
/* */ }
/* 163 */ catch (
InstantiationException e) {
/* */
/* 165 */ throw new
SAXPathException(
e);
/* */ }
/* */
/* 168 */ return
reader;
/* */ }
/* */ }
/* Location: /Users/tommy/.m2/repository/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar!/org/jaxen/saxpath/helpers/XPathReaderFactory.class
* Java compiler version: 2 (46.0)
* JD-Core Version: 1.1.3
*/