diff options
author | asaha <none@none> | 2015-07-28 23:11:47 -0700 |
---|---|---|
committer | asaha <none@none> | 2015-07-28 23:11:47 -0700 |
commit | 2e2ceac5a7acab7adc6a07bddbb42fd43bf93529 (patch) | |
tree | 8f3dc35e82c43acc8d737aae7180e402f641ff42 /src | |
parent | ba2cdf5fe508c3fbce555960ab29c385dcb5e3cd (diff) | |
parent | 549d705cfdecb69635b4a6ab27c5c7b465712333 (diff) | |
download | jdk8u_jaxp-2e2ceac5a7acab7adc6a07bddbb42fd43bf93529.tar.gz |
Merge
Diffstat (limited to 'src')
-rw-r--r-- | src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java b/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java index 9b4b296..ccfccb0 100644 --- a/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java +++ b/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java @@ -20,8 +20,10 @@ package com.sun.org.apache.xerces.internal.impl.dv; -import java.util.Map; +import com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl; +import com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl; import com.sun.org.apache.xerces.internal.utils.ObjectFactory; +import java.util.Map; /** * The factory to create and return DTD types. The implementation should @@ -36,7 +38,11 @@ import com.sun.org.apache.xerces.internal.utils.ObjectFactory; */ public abstract class DTDDVFactory { - private static final String DEFAULT_FACTORY_CLASS = "com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl"; + private static final String DEFAULT_FACTORY_CLASS = + "com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl"; + + private static final String XML11_DATATYPE_VALIDATOR_FACTORY = + "com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl"; /** * Get an instance of the default DTDDVFactory implementation. @@ -59,9 +65,15 @@ public abstract class DTDDVFactory { */ 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)); + 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."); |