Mercurial > hg > openjdk > jdk8u > jaxp
changeset 1102:be508e9bb42e
Merge
author | asaha |
---|---|
date | Tue, 28 Jul 2015 23:11:47 -0700 |
parents | 21bca422e763 (current diff) 60e623d06ebd (diff) |
children | b6ac3a1b7a2c |
files | .hgtags src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java |
diffstat | 2 files changed, 18 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Thu Jul 23 10:58:19 2015 -0700 +++ b/.hgtags Tue Jul 28 23:11:47 2015 -0700 @@ -463,3 +463,4 @@ f98b8f06a46ad7d7ab19179c8465c2861bf1a7f6 jdk8u65-b06 bc1ad5d83a65339c40a17406ea38d2ea8cbb9807 jdk8u66-b00 0f2ed27c7d793cee4d91591c6a0b1a730e985906 jdk8u66-b01 +096038a770142b0e6501d04d03283165da9661c6 jdk8u66-b02
--- a/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java Thu Jul 23 10:58:19 2015 -0700 +++ b/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java Tue Jul 28 23:11:47 2015 -0700 @@ -20,8 +20,10 @@ package com.sun.org.apache.xerces.internal.impl.dv; +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; -import com.sun.org.apache.xerces.internal.utils.ObjectFactory; /** * The factory to create and return DTD types. The implementation should @@ -36,7 +38,11 @@ */ 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 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.");