Java Code Examples for com.sun.org.apache.xerces.internal.utils.ObjectFactory#newInstance()

The following examples show how to use com.sun.org.apache.xerces.internal.utils.ObjectFactory#newInstance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DTDDVFactory.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Get an instance of DTDDVFactory implementation.
 *
 * @param factoryClass  name of the implementation to load.
 * @return  an instance of DTDDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException {
    try {
        if (DEFAULT_FACTORY_CLASS.equals(factoryClass)) {
            return new DTDDVFactoryImpl();
        } else if (XML11_DATATYPE_VALIDATOR_FACTORY.equals(factoryClass)) {
            return new XML11DTDDVFactoryImpl();
        } else {
            //fall back for compatibility
            return (DTDDVFactory)
                (ObjectFactory.newInstance(factoryClass, true));
        }
    }
    catch (ClassCastException e) {
        throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory.");
    }
}
 
Example 2
Source File: DTDDVFactory.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Get an instance of DTDDVFactory implementation.
 *
 * @param factoryClass  name of the implementation to load.
 * @return  an instance of DTDDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException {
    try {
        if (DEFAULT_FACTORY_CLASS.equals(factoryClass)) {
            return new DTDDVFactoryImpl();
        } else if (XML11_DATATYPE_VALIDATOR_FACTORY.equals(factoryClass)) {
            return new XML11DTDDVFactoryImpl();
        } else {
            //fall back for compatibility
            return (DTDDVFactory)
                (ObjectFactory.newInstance(factoryClass, true));
        }
    }
    catch (ClassCastException e) {
        throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory.");
    }
}
 
Example 3
Source File: XMLGrammarPreparser.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
public boolean registerPreparser(String grammarType, XMLGrammarLoader loader) {
    if(loader == null) { // none specified!
        if(KNOWN_LOADERS.containsKey(grammarType)) {
            // got one; just instantiate it...
            String loaderName = KNOWN_LOADERS.get(grammarType);
            try {
                XMLGrammarLoader gl = (XMLGrammarLoader)(ObjectFactory.newInstance(loaderName, true));
                fLoaders.put(grammarType, gl);
            } catch (Exception e) {
                return false;
            }
            return true;
        }
        return false;
    }
    // were given one
    fLoaders.put(grammarType, loader);
    return true;
}
 
Example 4
Source File: DTDDVFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get an instance of DTDDVFactory implementation.
 *
 * @param factoryClass  name of the implementation to load.
 * @return  an instance of DTDDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException {
    try {
        if (DEFAULT_FACTORY_CLASS.equals(factoryClass)) {
            return new DTDDVFactoryImpl();
        } else if (XML11_DATATYPE_VALIDATOR_FACTORY.equals(factoryClass)) {
            return new XML11DTDDVFactoryImpl();
        } else {
            //fall back for compatibility
            return (DTDDVFactory)
                (ObjectFactory.newInstance(factoryClass, true));
        }
    }
    catch (ClassCastException e) {
        throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory.");
    }
}
 
Example 5
Source File: DTDDVFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get an instance of DTDDVFactory implementation.
 *
 * @param factoryClass  name of the implementation to load.
 * @return  an instance of DTDDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException {
    try {
        if (DEFAULT_FACTORY_CLASS.equals(factoryClass)) {
            return new DTDDVFactoryImpl();
        } else if (XML11_DATATYPE_VALIDATOR_FACTORY.equals(factoryClass)) {
            return new XML11DTDDVFactoryImpl();
        } else {
            //fall back for compatibility
            return (DTDDVFactory)
                (ObjectFactory.newInstance(factoryClass, true));
        }
    }
    catch (ClassCastException e) {
        throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory.");
    }
}
 
Example 6
Source File: DTDDVFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Get an instance of DTDDVFactory implementation.
 *
 * @param factoryClass  name of the implementation to load.
 * @return  an instance of DTDDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException {
    try {
        if (DEFAULT_FACTORY_CLASS.equals(factoryClass)) {
            return new DTDDVFactoryImpl();
        } else if (XML11_DATATYPE_VALIDATOR_FACTORY.equals(factoryClass)) {
            return new XML11DTDDVFactoryImpl();
        } else {
            //fall back for compatibility
            return (DTDDVFactory)
                (ObjectFactory.newInstance(factoryClass, true));
        }
    }
    catch (ClassCastException e) {
        throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory.");
    }
}
 
Example 7
Source File: XMLGrammarPreparser.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public boolean registerPreparser(String grammarType, XMLGrammarLoader loader) {
    if(loader == null) { // none specified!
        if(KNOWN_LOADERS.containsKey(grammarType)) {
            // got one; just instantiate it...
            String loaderName = (String)KNOWN_LOADERS.get(grammarType);
            try {
                XMLGrammarLoader gl = (XMLGrammarLoader)(ObjectFactory.newInstance(loaderName, true));
                fLoaders.put(grammarType, gl);
            } catch (Exception e) {
                return false;
            }
            return true;
        }
        return false;
    }
    // were given one
    fLoaders.put(grammarType, loader);
    return true;
}
 
Example 8
Source File: XMLGrammarPreparser.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public boolean registerPreparser(String grammarType, XMLGrammarLoader loader) {
    if(loader == null) { // none specified!
        if(KNOWN_LOADERS.containsKey(grammarType)) {
            // got one; just instantiate it...
            String loaderName = (String)KNOWN_LOADERS.get(grammarType);
            try {
                XMLGrammarLoader gl = (XMLGrammarLoader)(ObjectFactory.newInstance(loaderName, true));
                fLoaders.put(grammarType, gl);
            } catch (Exception e) {
                return false;
            }
            return true;
        }
        return false;
    }
    // were given one
    fLoaders.put(grammarType, loader);
    return true;
}
 
Example 9
Source File: XMLGrammarPreparser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean registerPreparser(String grammarType, XMLGrammarLoader loader) {
    if(loader == null) { // none specified!
        if(KNOWN_LOADERS.containsKey(grammarType)) {
            // got one; just instantiate it...
            String loaderName = (String)KNOWN_LOADERS.get(grammarType);
            try {
                XMLGrammarLoader gl = (XMLGrammarLoader)(ObjectFactory.newInstance(loaderName, true));
                fLoaders.put(grammarType, gl);
            } catch (Exception e) {
                return false;
            }
            return true;
        }
        return false;
    }
    // were given one
    fLoaders.put(grammarType, loader);
    return true;
}
 
Example 10
Source File: XMLGrammarPreparser.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public boolean registerPreparser(String grammarType, XMLGrammarLoader loader) {
    if(loader == null) { // none specified!
        if(KNOWN_LOADERS.containsKey(grammarType)) {
            // got one; just instantiate it...
            String loaderName = (String)KNOWN_LOADERS.get(grammarType);
            try {
                XMLGrammarLoader gl = (XMLGrammarLoader)(ObjectFactory.newInstance(loaderName, true));
                fLoaders.put(grammarType, gl);
            } catch (Exception e) {
                return false;
            }
            return true;
        }
        return false;
    }
    // were given one
    fLoaders.put(grammarType, loader);
    return true;
}
 
Example 11
Source File: DTDDVFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get an instance of DTDDVFactory implementation.
 *
 * @param factoryClass  name of the implementation to load.
 * @return  an instance of DTDDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException {
    try {
        // if the class name is not specified, use the default one
        return (DTDDVFactory)
            (ObjectFactory.newInstance(factoryClass, true));
    }
    catch (ClassCastException e) {
        throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory.");
    }
}
 
Example 12
Source File: SchemaDVFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get an instance of SchemaDVFactory implementation.
 *
 * @param factoryClass   name of the schema factory implementation to instantiate.
 * @return  an instance of SchemaDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static synchronized final SchemaDVFactory getInstance(String factoryClass) throws DVFactoryException {

    try {
        // if the class name is not specified, use the default one
        return (SchemaDVFactory)(ObjectFactory.newInstance(factoryClass, true));
    } catch (ClassCastException e4) {
        throw new DVFactoryException("Schema factory class " + factoryClass + " does not extend from SchemaDVFactory.");
    }

}
 
Example 13
Source File: SchemaDVFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get an instance of SchemaDVFactory implementation.
 *
 * @param factoryClass   name of the schema factory implementation to instantiate.
 * @return  an instance of SchemaDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static synchronized final SchemaDVFactory getInstance(String factoryClass) throws DVFactoryException {

    try {
        // if the class name is not specified, use the default one
        return (SchemaDVFactory)(ObjectFactory.newInstance(factoryClass, true));
    } catch (ClassCastException e4) {
        throw new DVFactoryException("Schema factory class " + factoryClass + " does not extend from SchemaDVFactory.");
    }

}
 
Example 14
Source File: SchemaDVFactory.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Get an instance of SchemaDVFactory implementation.
 *
 * @param factoryClass   name of the schema factory implementation to instantiate.
 * @return  an instance of SchemaDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static synchronized final SchemaDVFactory getInstance(String factoryClass) throws DVFactoryException {

    try {
        // if the class name is not specified, use the default one
        return (SchemaDVFactory)(ObjectFactory.newInstance(factoryClass, true));
    } catch (ClassCastException e4) {
        throw new DVFactoryException("Schema factory class " + factoryClass + " does not extend from SchemaDVFactory.");
    }

}
 
Example 15
Source File: SchemaDVFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get an instance of SchemaDVFactory implementation.
 *
 * @param factoryClass   name of the schema factory implementation to instantiate.
 * @return  an instance of SchemaDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static synchronized final SchemaDVFactory getInstance(String factoryClass) throws DVFactoryException {

    try {
        // if the class name is not specified, use the default one
        return (SchemaDVFactory)(ObjectFactory.newInstance(factoryClass, true));
    } catch (ClassCastException e4) {
        throw new DVFactoryException("Schema factory class " + factoryClass + " does not extend from SchemaDVFactory.");
    }

}
 
Example 16
Source File: DTDDVFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get an instance of DTDDVFactory implementation.
 *
 * @param factoryClass  name of the implementation to load.
 * @return  an instance of DTDDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException {
    try {
        // if the class name is not specified, use the default one
        return (DTDDVFactory)
            (ObjectFactory.newInstance(factoryClass, true));
    }
    catch (ClassCastException e) {
        throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory.");
    }
}
 
Example 17
Source File: SchemaDVFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get an instance of SchemaDVFactory implementation.
 *
 * @param factoryClass   name of the schema factory implementation to instantiate.
 * @return  an instance of SchemaDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static synchronized final SchemaDVFactory getInstance(String factoryClass) throws DVFactoryException {

    try {
        // if the class name is not specified, use the default one
        return (SchemaDVFactory)(ObjectFactory.newInstance(factoryClass, true));
    } catch (ClassCastException e4) {
        throw new DVFactoryException("Schema factory class " + factoryClass + " does not extend from SchemaDVFactory.");
    }

}
 
Example 18
Source File: SchemaDVFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get an instance of SchemaDVFactory implementation.
 *
 * @param factoryClass   name of the schema factory implementation to instantiate.
 * @return  an instance of SchemaDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static synchronized final SchemaDVFactory getInstance(String factoryClass) throws DVFactoryException {

    try {
        // if the class name is not specified, use the default one
        return (SchemaDVFactory)(ObjectFactory.newInstance(factoryClass, true));
    } catch (ClassCastException e4) {
        throw new DVFactoryException("Schema factory class " + factoryClass + " does not extend from SchemaDVFactory.");
    }

}
 
Example 19
Source File: SchemaDVFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get an instance of SchemaDVFactory implementation.
 *
 * @param factoryClass   name of the schema factory implementation to instantiate.
 * @return  an instance of SchemaDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static synchronized final SchemaDVFactory getInstance(String factoryClass) throws DVFactoryException {

    try {
        // if the class name is not specified, use the default one
        return (SchemaDVFactory)(ObjectFactory.newInstance(factoryClass, true));
    } catch (ClassCastException e4) {
        throw new DVFactoryException("Schema factory class " + factoryClass + " does not extend from SchemaDVFactory.");
    }

}
 
Example 20
Source File: SchemaDVFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get an instance of SchemaDVFactory implementation.
 *
 * @param factoryClass   name of the schema factory implementation to instantiate.
 * @return  an instance of SchemaDVFactory implementation
 * @exception DVFactoryException  cannot create an instance of the specified
 *                                class name or the default class name
 */
public static synchronized final SchemaDVFactory getInstance(String factoryClass) throws DVFactoryException {

    try {
        // if the class name is not specified, use the default one
        return (SchemaDVFactory)(ObjectFactory.newInstance(factoryClass, true));
    } catch (ClassCastException e4) {
        throw new DVFactoryException("Schema factory class " + factoryClass + " does not extend from SchemaDVFactory.");
    }

}