src/javax/xml/parsers/DocumentBuilderFactory.java

Print this page

        

*** 38,59 **** */ public abstract class DocumentBuilderFactory { - /** The default property name according to the JAXP spec */ - private static final String DEFAULT_PROPERTY_NAME = "javax.xml.parsers.DocumentBuilderFactory"; - private boolean validating = false; private boolean namespaceAware = false; private boolean whitespace = false; private boolean expandEntityRef = true; private boolean ignoreComments = false; private boolean coalescing = false; - private boolean canonicalState = false; - /** * <p>Protected constructor to prevent instantiation. * Use {@link #newInstance()}.</p> */ protected DocumentBuilderFactory () { --- 38,54 ----
*** 83,97 **** * when the first attempt is made to read from it, no further attempts are * made to check for its existence. It is not possible to change the value * of any property in jaxp.properties after it has been read for the first time. * </li> * <li> ! * Use the Services API (as detailed in the JAR specification), if ! * available, to determine the classname. The Services API will look ! * for a classname in the file ! * <code>META-INF/services/javax.xml.parsers.DocumentBuilderFactory</code> ! * in jars available to the runtime. * </li> * <li> * Platform default <code>DocumentBuilderFactory</code> instance. * </li> * </ul> --- 78,94 ---- * when the first attempt is made to read from it, no further attempts are * made to check for its existence. It is not possible to change the value * of any property in jaxp.properties after it has been read for the first time. * </li> * <li> ! * Uses the service-provider loading facilities, defined by the {@link java.util.ServiceLoader} class, to attempt ! * to locate and load an implementation of the service. If there are providers other than the implementation specific ! * default located, then the first provider that is not the default is instantiated and returned; Otherwise ! * the default implementation is returned if it is on the classpath or installed as a module. ! * <br> ! * If a misconfigured provider is encountered and {@link java.util.ServiceConfigurationError} is thrown, the error will be wrapped ! * in a {@link javax.xml.parsers.FactoryConfigurationException}. * </li> * <li> * Platform default <code>DocumentBuilderFactory</code> instance. * </li> * </ul>
*** 115,135 **** * * @throws FactoryConfigurationError if the implementation is not * available or cannot be instantiated. */ public static DocumentBuilderFactory newInstance() { ! try { ! return (DocumentBuilderFactory) FactoryFinder.find( /* The default property name according to the JAXP spec */ ! "javax.xml.parsers.DocumentBuilderFactory", /* The fallback implementation class name */ "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); - } catch (FactoryFinder.ConfigurationError e) { - throw new FactoryConfigurationError(e.getException(), - e.getMessage()); - } - } /** * <p>Obtain a new instance of a <code>DocumentBuilderFactory</code> from class name. * This function is useful when there are multiple providers in the classpath. --- 112,126 ---- * * @throws FactoryConfigurationError if the implementation is not * available or cannot be instantiated. */ public static DocumentBuilderFactory newInstance() { ! return FactoryFinder.find( /* The default property name according to the JAXP spec */ ! DocumentBuilderFactory.class, // "javax.xml.parsers.DocumentBuilderFactory" /* The fallback implementation class name */ "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); } /** * <p>Obtain a new instance of a <code>DocumentBuilderFactory</code> from class name. * This function is useful when there are multiple providers in the classpath.
*** 163,179 **** * @see #newInstance() * * @since 1.6 */ public static DocumentBuilderFactory newInstance(String factoryClassName, ClassLoader classLoader){ - try { //do not fallback if given classloader can't find the class, throw exception return (DocumentBuilderFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false); - } catch (FactoryFinder.ConfigurationError e) { - throw new FactoryConfigurationError(e.getException(), - e.getMessage()); - } } /** * Creates a new instance of a {@link javax.xml.parsers.DocumentBuilder} * using the currently configured parameters. --- 154,165 ----
*** 449,469 **** */ public abstract boolean getFeature(String name) throws ParserConfigurationException; - /** <p>Get current state of canonicalization.</p> - * - * @return current state canonicalization control - */ - /* - public boolean getCanonicalization() { - return canonicalState; - } - */ - - /** * Gets the {@link Schema} object specified through * the {@link #setSchema(Schema schema)} method. * * @return --- 435,444 ----
*** 486,506 **** + "\"" ); } - /* <p>Set canonicalization control to <code>true</code> or - * </code>false</code>.</p> - * - * @param state of canonicalization - */ - /* - public void setCanonicalization(boolean state) { - canonicalState = state; - } - */ - /** * <p>Set the {@link Schema} to be used by parsers created * from this factory. * * <p> --- 461,470 ----