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,100 **** * 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> * * Once an application has obtained a reference to a * <code>DocumentBuilderFactory</code> it can use the factory to --- 78,93 ---- * 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. * </li> * <li> ! * Otherwise, the system-default implementation is returned. * </li> * </ul> * * Once an application has obtained a reference to a * <code>DocumentBuilderFactory</code> it can use the factory to
*** 111,135 **** * java -Djaxp.debug=1 YourProgram .... * </pre> * * @return New instance of a <code>DocumentBuilderFactory</code> * ! * @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. --- 104,123 ---- * java -Djaxp.debug=1 YourProgram .... * </pre> * * @return New instance of a <code>DocumentBuilderFactory</code> * ! * @throws FactoryConfigurationError in case of {@linkplain ! * java.util.ServiceConfigurationError service configuration error} or 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. --- 151,163 ---- * @see #newInstance() * * @since 1.6 */ public static DocumentBuilderFactory newInstance(String factoryClassName, ClassLoader classLoader){ //do not fallback if given classloader can't find the class, throw exception ! return FactoryFinder.newInstance(DocumentBuilderFactory.class, ! factoryClassName, classLoader, false); } /** * Creates a new instance of a {@link javax.xml.parsers.DocumentBuilder} * using the currently configured parameters.
*** 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 --- 433,442 ----
*** 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> --- 459,468 ----