From a953097a8960cd0013fa28ddc7ee54277a82fb67 Mon Sep 17 00:00:00 2001
From: Joe Wang
- * ${JAVA_HOME}/conf/jaxp.properties: This configuration file is in standard - * {@link java.util.Properties} format. If the file exists and the system property is specified, - * its value will be used to override the default of the property. + * jaxp.properties: This configuration file is in standard + * {@link java.util.Properties} format and typically located in the {@code conf} + * directory of the Java installation. If the file exists and the system + * property is specified, its value will be used to override the default + * of the property. *
* *@@ -314,9 +316,11 @@ public final class XMLConstants { *
* *- * ${JAVA_HOME}/conf/jaxp.properties: This configuration file is in standard - * java.util.Properties format. If the file exists and the system property is specified, - * its value will be used to override the default of the property. + * jaxp.properties: This configuration file is in standard + * {@link java.util.Properties} format and typically located in the {@code conf} + * directory of the Java installation. If the file exists and the system + * property is specified, its value will be used to override the default + * of the property. * * @since 1.7 *
@@ -380,9 +384,11 @@ public final class XMLConstants { * * *- * ${JAVA_HOME}/conf/jaxp.properties: This configuration file is in standard - * java.util.Properties format. If the file exists and the system property is specified, - * its value will be used to override the default of the property. + * jaxp.properties: This configuration file is in standard + * {@link java.util.Properties} format and typically located in the {@code conf} + * directory of the Java installation. If the file exists and the system + * property is specified, its value will be used to override the default + * of the property. * * @since 1.7 */ diff --git a/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java index de6050ac4e8..d3afb25888e 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/datatype/DatatypeFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,23 +32,34 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** - *
Factory that creates new javax.xml.datatype
Object
s that map XML to/from Java Object
s.
A new instance of the DatatypeFactory
is created through the {@link #newInstance()} method
- * that uses the following implementation resolution mechanisms to determine an implementation:
javax.xml.datatype
Object
s that map XML to/from Java Object
s.
+ * + * A new instance of the {@code DatatypeFactory} is created through the {@link #newInstance()} method + * that uses the following implementation resolution mechanisms to determine an implementation: + *
*
javax.xml.datatype.DatatypeFactory
",
+ * If the system property specified by {@link #DATATYPEFACTORY_PROPERTY}, "{@code javax.xml.datatype.DatatypeFactory}",
* exists, a class with the name of the property value is instantiated.
* Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}.
* Object
.
- * The Properties
Object
is then queried for the property as documented in the prior step
- * and processed as documented in the prior step.
+ * + * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *
+ * The jaxp.properties file is read only once by the JAXP implementation + * and its values are then cached for future use. If the file does not exist + * 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. *
+ * Use the service-provider loading facility, defined by the {@link java.util.ServiceLoader} class, to attempt
* to locate and load an implementation of the service using the {@linkplain
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
* the service-provider loading facility will use the {@linkplain
@@ -56,13 +67,14 @@ import java.util.regex.Pattern;
* to attempt to load the service. If the context class
* loader is null, the {@linkplain
* ClassLoader#getSystemClassLoader() system class loader} will be used.
- *
+ *
* In case of {@link java.util.ServiceConfigurationError service - * configuration error} a {@link javax.xml.datatype.DatatypeConfigurationException} + * configuration error}, a {@link javax.xml.datatype.DatatypeConfigurationException} * will be thrown. *
Class
specified by
+ * + * The final mechanism is to attempt to instantiate the {@code Class} specified by * {@link #DATATYPEFACTORY_IMPLEMENTATION_CLASS}. * Any Exception thrown during the instantiation process is wrapped as a {@link DatatypeConfigurationException}. *
Default property name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3.
* - *Default value is javax.xml.datatype.DatatypeFactory
.
Default value is {@code javax.xml.datatype.DatatypeFactory}.
*/ public static final String DATATYPEFACTORY_PROPERTY = // We use a String constant here, rather than calling @@ -120,18 +132,18 @@ public abstract class DatatypeFactory { /** *Protected constructor to prevent instantiation outside of package.
* - *Use {@link #newInstance()} to create a DatatypeFactory
.
Use {@link #newInstance()} to create a {@code DatatypeFactory}.
*/ protected DatatypeFactory() { } /** - *Obtain a new instance of a DatatypeFactory
.
Obtain a new instance of a {@code DatatypeFactory}.
* *The implementation resolution mechanisms are defined in this
* Class
's documentation.
DatatypeFactory
+ * @return New instance of a {@code DatatypeFactory}
*
* @throws DatatypeConfigurationException If the implementation is not
* available or cannot be instantiated.
@@ -149,12 +161,12 @@ public abstract class DatatypeFactory {
}
/**
- * Obtain a new instance of a DatatypeFactory
from class name.
+ *
Obtain a new instance of a {@code DatatypeFactory} from class name. * This function is useful when there are multiple providers in the classpath. * It gives more control to the application as it can specify which provider * should be loaded.
* - *Once an application has obtained a reference to a DatatypeFactory
+ *
Once an application has obtained a reference to a {@code DatatypeFactory} * it can use the factory to configure and obtain datatype instances.
* * @@ -168,12 +180,12 @@ public abstract class DatatypeFactory { * java -Djaxp.debug=1 YourProgram .... * * - * @param factoryClassName fully qualified factory class name that provides implementation ofjavax.xml.datatype.DatatypeFactory
.
+ * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.datatype.DatatypeFactory}.
*
* @param classLoader ClassLoader
used to load the factory class. If null
* current Thread
's context classLoader is used to load the factory class.
*
- * @return New instance of a DatatypeFactory
+ * @return New instance of a {@code DatatypeFactory}
*
* @throws DatatypeConfigurationException if factoryClassName
is null
, or
* the factory class cannot be loaded, instantiated.
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java
index 62bd3bd27c0..c500869cd7f 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/DocumentBuilderFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -55,31 +55,34 @@ public abstract class DocumentBuilderFactory {
/**
* Obtain a new instance of a
- * DocumentBuilderFactory
. This static method creates
+ * {@code DocumentBuilderFactory}. This static method creates
* a new factory instance.
* This method uses the following ordered lookup procedure to determine
- * the DocumentBuilderFactory
implementation class to
+ * the {@code DocumentBuilderFactory} implementation class to
* load:
+ * *
javax.xml.parsers.DocumentBuilderFactory
system
+ * Use the {@code javax.xml.parsers.DocumentBuilderFactory} system
* property.
* java.util.Properties
- *
format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- *
+ * + * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *
* The jaxp.properties file is read only once by the JAXP implementation - * and it's values are then cached for future use. If the file does not exist + * and its values are then cached for future use. If the file does not exist * 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. *
+ * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -90,26 +93,30 @@ public abstract class DocumentBuilderFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *
* Otherwise, the system-default implementation is returned. *
* Once an application has obtained a reference to a
- * DocumentBuilderFactory
it can use the factory to
+ * {@code DocumentBuilderFactory} it can use the factory to
* configure and obtain parser instances.
*
*
*
Setting the jaxp.debug
system property will cause
+ *
+ * Setting the {@code jaxp.debug} system property will cause
* this method to print a lot of debug messages
- * to System.err
about what it is doing and where it is looking at.
If you have problems loading {@link DocumentBuilder}s, try:
+ *+ * If you have problems loading {@link DocumentBuilder}s, try: *
* java -Djaxp.debug=1 YourProgram .... ** - * @return New instance of a
DocumentBuilderFactory
+ * @return New instance of a {@code DocumentBuilderFactory}
*
* @throws FactoryConfigurationError in case of {@linkplain
* java.util.ServiceConfigurationError service configuration error} or if
@@ -124,31 +131,31 @@ public abstract class DocumentBuilderFactory {
}
/**
- * Obtain a new instance of a DocumentBuilderFactory
from class name.
+ *
Obtain a new instance of a {@code DocumentBuilderFactory} from class name. * This function is useful when there are multiple providers in the classpath. * It gives more control to the application as it can specify which provider - * should be loaded.
+ * should be loaded. * - *Once an application has obtained a reference to a DocumentBuilderFactory
- * it can use the factory to configure and obtain parser instances.
Once an application has obtained a reference to a {@code DocumentBuilderFactory} + * it can use the factory to configure and obtain parser instances. * * *
Setting the jaxp.debug
system property will cause
+ *
Setting the {@code jaxp.debug} system property will cause
* this method to print a lot of debug messages
- * to System.err
about what it is doing and where it is looking at.
If you have problems try:
** java -Djaxp.debug=1 YourProgram .... ** - * @param factoryClassName fully qualified factory class name that provides implementation of
javax.xml.parsers.DocumentBuilderFactory
.
+ * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.parsers.DocumentBuilderFactory}.
*
* @param classLoader ClassLoader
used to load the factory class. If null
* current Thread
's context classLoader is used to load the factory class.
*
- * @return New instance of a DocumentBuilderFactory
+ * @return New instance of a {@code DocumentBuilderFactory}
*
* @throws FactoryConfigurationError if factoryClassName
is null
, or
* the factory class cannot be loaded, instantiated.
@@ -406,14 +413,14 @@ public abstract class DocumentBuilderFactory {
throws IllegalArgumentException;
/**
- * Set a feature for this DocumentBuilderFactory
and DocumentBuilder
s created by this factory.
Set a feature for this {@code DocumentBuilderFactory} and DocumentBuilder
s created by this factory.
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
- * A {@link ParserConfigurationException} is thrown if this DocumentBuilderFactory
or the
+ * A {@link ParserConfigurationException} is thrown if this {@code DocumentBuilderFactory} or the
* DocumentBuilder
s it creates cannot support the feature.
- * It is possible for a DocumentBuilderFactory
to expose a feature value but be unable to change its state.
+ * It is possible for a {@code DocumentBuilderFactory} to expose a feature value but be unable to change its state.
*
@@ -436,7 +443,7 @@ public abstract class DocumentBuilderFactory {
* @param name Feature name.
* @param value Is feature state true
or false
.
*
- * @throws ParserConfigurationException if this DocumentBuilderFactory
or the DocumentBuilder
s
+ * @throws ParserConfigurationException if this {@code DocumentBuilderFactory} or the DocumentBuilder
s
* it creates cannot support this feature.
* @throws NullPointerException If the name
parameter is null.
* @since 1.5
@@ -450,16 +457,16 @@ public abstract class DocumentBuilderFactory {
*
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
- * An {@link ParserConfigurationException} is thrown if this DocumentBuilderFactory
or the
+ * An {@link ParserConfigurationException} is thrown if this {@code DocumentBuilderFactory} or the
* DocumentBuilder
s it creates cannot support the feature.
- * It is possible for an DocumentBuilderFactory
to expose a feature value but be unable to change its state.
+ * It is possible for an {@code DocumentBuilderFactory} to expose a feature value but be unable to change its state.
*
DocumentBuilderFactory
+ * @throws ParserConfigurationException if this {@code DocumentBuilderFactory}
* or the DocumentBuilder
s it creates cannot support this feature.
* @since 1.5
*/
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java
index f2e9120a02f..1160a62edf4 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/parsers/SAXParserFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,31 +59,34 @@ public abstract class SAXParserFactory {
}
/**
- * Obtain a new instance of a SAXParserFactory
. This
+ * Obtain a new instance of a {@code SAXParserFactory}. This
* static method creates a new factory instance
* This method uses the following ordered lookup procedure to determine
- * the SAXParserFactory
implementation class to
+ * the {@code SAXParserFactory} implementation class to
* load:
+ * *
javax.xml.parsers.SAXParserFactory
system
+ * Use the {@code javax.xml.parsers.SAXParserFactory} system
* property.
* java.util.Properties
- *
format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- *
+ * + * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *
* The jaxp.properties file is read only once by the JAXP implementation - * and it's values are then cached for future use. If the file does not exist + * and its values are then cached for future use. If the file does not exist * 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. *
+ * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -94,22 +97,26 @@ public abstract class SAXParserFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *
* Otherwise the system-default implementation is returned. *
* Once an application has obtained a reference to a
- * SAXParserFactory
it can use the factory to
+ * {@code SAXParserFactory} it can use the factory to
* configure and obtain parser instances.
*
*
*
*
Setting the jaxp.debug
system property will cause
+ *
+ * Setting the {@code jaxp.debug} system property will cause
* this method to print a lot of debug messages
- * to System.err
about what it is doing and where it is looking at.
If you have problems loading {@link SAXParser}s, try:
+ *+ * If you have problems loading {@link SAXParser}s, try: *
* java -Djaxp.debug=1 YourProgram .... *@@ -131,31 +138,32 @@ public abstract class SAXParserFactory { } /** - *
Obtain a new instance of a SAXParserFactory
from class name.
+ *
Obtain a new instance of a {@code SAXParserFactory} from class name. * This function is useful when there are multiple providers in the classpath. * It gives more control to the application as it can specify which provider * should be loaded.
* - *Once an application has obtained a reference to a SAXParserFactory
+ *
Once an application has obtained a reference to a {@code SAXParserFactory} * it can use the factory to configure and obtain parser instances.
* * *Setting the jaxp.debug
system property will cause
+ *
Setting the {@code jaxp.debug} system property will cause
* this method to print a lot of debug messages
- * to System.err
about what it is doing and where it is looking at.
If you have problems, try:
+ *+ * If you have problems, try: *
* java -Djaxp.debug=1 YourProgram .... ** - * @param factoryClassName fully qualified factory class name that provides implementation of
javax.xml.parsers.SAXParserFactory
.
+ * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.parsers.SAXParserFactory}.
*
* @param classLoader ClassLoader
used to load the factory class. If null
* current Thread
's context classLoader is used to load the factory class.
*
- * @return New instance of a SAXParserFactory
+ * @return New instance of a {@code SAXParserFactory}
*
* @throws FactoryConfigurationError if factoryClassName
is null
, or
* the factory class cannot be loaded, instantiated.
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java
index 548feeb272a..fc14bc620bc 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/stream/XMLEventFactory.java
@@ -23,7 +23,7 @@
*/
/*
- * Copyright (c) 2009, 2013, by Oracle Corporation. All Rights Reserved.
+ * Copyright (c) 2009, 2015, by Oracle Corporation. All Rights Reserved.
*/
package javax.xml.stream;
@@ -70,19 +70,34 @@ public abstract class XMLEventFactory {
* This static method creates a new factory instance.
* This method uses the following ordered lookup procedure to determine
* the XMLEventFactory implementation class to load:
- *
+ * *
+ * Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *
+ * The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * 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 stax.properties after it has been read for the first time. + * + *
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *
+ * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -93,18 +108,18 @@ public abstract class XMLEventFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *
* Otherwise, the system-default implementation is returned. *
* Once an application has obtained a reference to a XMLEventFactory it * can use the factory to configure and obtain stream instances. - *
** Note that this is a new method that replaces the deprecated newInstance() method. * No changes in behavior are defined by this replacement method relative to * the deprecated method. - *
+ * * @throws FactoryConfigurationError in case of {@linkplain * java.util.ServiceConfigurationError service configuration error} or if * the implementation is not available or cannot be instantiated. @@ -143,20 +158,35 @@ public abstract class XMLEventFactory { ** This method uses the following ordered lookup procedure to determine * the XMLEventFactory implementation class to load: - *
+ **
+ * Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * conf directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *
+ * The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * 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 stax.properties after it has been read for the first time. + * + *
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *
* If {@code factoryId} is "javax.xml.stream.XMLEventFactory", - * use the service-provider loading facilities, defined by the + * use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to {@linkplain * java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load} * an implementation of the service using the specified {@code ClassLoader}. @@ -169,6 +199,7 @@ public abstract class XMLEventFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *
* Otherwise, throws a {@link FactoryConfigurationError}. *
Use the javax.xml.stream.XMLInputFactory system property. *
Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *
The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * 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 stax.properties after it has been read for the first time. + * + *
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *
Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -183,7 +195,7 @@ public abstract class XMLInputFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *
Otherwise, the system-default implementation is returned. *
@@ -233,20 +245,36 @@ public abstract class XMLInputFactory { *
* This method uses the following ordered lookup procedure to determine * the XMLInputFactory implementation class to load: - *
+ **
* Use the value of the system property identified by {@code factoryId}. *
+ * Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *
+ * The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * 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 stax.properties after it has been read for the first time. + * + *
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *
* If {@code factoryId} is "javax.xml.stream.XMLInputFactory", - * use the service-provider loading facilities, defined by the + * use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to {@linkplain * java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load} * an implementation of the service using the specified {@code ClassLoader}. @@ -259,6 +287,7 @@ public abstract class XMLInputFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *
* Otherwise, throws a {@link FactoryConfigurationError}. *
*
+ * Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *
+ * The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * 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 stax.properties after it has been read for the first time. + * + *
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *
+ * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -159,17 +174,17 @@ public abstract class XMLOutputFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *
* Otherwise, the system-default implementation is returned. *
* Once an application has obtained a reference to a XMLOutputFactory it * can use the factory to configure and obtain stream instances. - *
** Note that this is a new method that replaces the deprecated newInstance() method. * No changes in behavior are defined by this replacement method relative to the * deprecated method. - *
+ * * @throws FactoryConfigurationError in case of {@linkplain * java.util.ServiceConfigurationError service configuration error} or if * the implementation is not available or cannot be instantiated. @@ -207,20 +222,35 @@ public abstract class XMLOutputFactory { ** This method uses the following ordered lookup procedure to determine * the XMLOutputFactory implementation class to load: - *
+ **
+ * Use the configuration file "stax.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + * + *
+ * The stax.properties file is read only once by the implementation + * and its values are then cached for future use. If the file does not exist + * 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 stax.properties after it has been read for the first time. + * + *
+ * Use the jaxp configuration file "jaxp.properties". The file is in the same + * format as stax.properties and will only be read if stax.properties does + * not exist. *
* If {@code factoryId} is "javax.xml.stream.XMLOutputFactory", - * use the service-provider loading facilities, defined by the + * use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to {@linkplain * java.util.ServiceLoader#load(java.lang.Class, java.lang.ClassLoader) locate and load} * an implementation of the service using the specified {@code ClassLoader}. @@ -233,6 +263,7 @@ public abstract class XMLOutputFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *
* Otherwise, throws a {@link FactoryConfigurationError}. *
The system property that determines which Factory implementation
* to create is named "javax.xml.transform.TransformerFactory"
.
* This property names a concrete subclass of the
- * TransformerFactory
abstract class. If the property is not
+ * {@code TransformerFactory} abstract class. If the property is not
* defined, a platform default is be used.
Obtain a new instance of a TransformerFactory
.
- * This static method creates a new factory instance.
This method uses the following ordered lookup procedure to determine
- * the TransformerFactory
implementation class to
- * load:
+ * Obtain a new instance of a {@code TransformerFactory}. + * This static method creates a new factory instance. + *
+ * This method uses the following ordered lookup procedure to determine + * the {@code TransformerFactory} implementation class to + * load: + *
*
javax.xml.transform.TransformerFactory
system
+ * Use the {@code javax.xml.transform.TransformerFactory} system
* property.
* java.util.Properties
- *
format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- * + * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * {@code conf} directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *
* The jaxp.properties file is read only once by the JAXP implementation - * and it's values are then cached for future use. If the file does not exist + * and its values are then cached for future use. If the file does not exist * 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. *
+ * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -86,13 +91,15 @@ public abstract class TransformerFactory { * ClassLoader#getSystemClassLoader() system class loader} will be used. *
* Otherwise, the system-default implementation is returned. *
Once an application has obtained a reference to a
- * TransformerFactory
it can use the factory to configure
- * and obtain transformer instances.
+ * Once an application has obtained a reference to a + * {@code TransformerFactory} it can use the factory to configure + * and obtain transformer instances. * * @return new TransformerFactory instance, never null. * @@ -111,13 +118,13 @@ public abstract class TransformerFactory { } /** - *
Obtain a new instance of a TransformerFactory
from factory class name.
+ *
Obtain a new instance of a {@code TransformerFactory} from factory class name. * This function is useful when there are multiple providers in the classpath. * It gives more control to the application as it can specify which provider * should be loaded.
* - *Once an application has obtained a reference to a
- * TransformerFactory
it can use the factory to configure
+ *
Once an application has obtained a reference to a + * {@code TransformerFactory} it can use the factory to configure * and obtain transformer instances.
* *javax.xml.transform.TransformerFactory
.
+ * @param factoryClassName fully qualified factory class name that provides implementation of {@code javax.xml.transform.TransformerFactory}.
*
* @param classLoader ClassLoader
used to load the factory class. If null
* current Thread
's context classLoader is used to load the factory class.
@@ -232,7 +239,7 @@ public abstract class TransformerFactory {
* @param charset The value of the charset attribute to match. May be null.
*
* @return A Source
Object
suitable for passing
- * to the TransformerFactory
.
+ * to the {@code TransformerFactory}.
*
* @throws TransformerConfigurationException An Exception
* is thrown if an error occurings during parsing of the
@@ -268,15 +275,15 @@ public abstract class TransformerFactory {
//======= CONFIGURATION METHODS =======
/**
- * Set a feature for this TransformerFactory
and Transformer
s
+ *
Set a feature for this {@code TransformerFactory} and Transformer
s
* or Template
s created by this factory.
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
- * An {@link TransformerConfigurationException} is thrown if this TransformerFactory
or the
+ * An {@link TransformerConfigurationException} is thrown if this {@code TransformerFactory} or the
* Transformer
s or Template
s it creates cannot support the feature.
- * It is possible for an TransformerFactory
to expose a feature value but be unable to change its state.
+ * It is possible for an {@code TransformerFactory} to expose a feature value but be unable to change its state.
*
All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
@@ -299,7 +306,7 @@ public abstract class TransformerFactory {
* @param name Feature name.
* @param value Is feature state true
or false
.
*
- * @throws TransformerConfigurationException if this TransformerFactory
+ * @throws TransformerConfigurationException if this {@code TransformerFactory}
* or the Transformer
s or Template
s it creates cannot support this feature.
* @throws NullPointerException If the name
parameter is null.
*/
@@ -312,9 +319,9 @@ public abstract class TransformerFactory {
*
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
- * false
is returned if this TransformerFactory
or the
+ * false
is returned if this {@code TransformerFactory} or the
* Transformer
s or Template
s it creates cannot support the feature.
- * It is possible for an TransformerFactory
to expose a feature value but be unable to change its state.
+ * It is possible for an {@code TransformerFactory} to expose a feature value but be unable to change its state.
*
* If the system property
- * "javax.xml.validation.SchemaFactory:schemaLanguage"
+ * {@code "javax.xml.validation.SchemaFactory:schemaLanguage"}
* is present (where schemaLanguage is the parameter
* to this method), then its value is read
* as a class name. The method will try to
@@ -141,12 +142,22 @@ public abstract class SchemaFactory {
* and returns it if it is successfully created.
*
$java.home/conf/jaxp.properties
is read and
- * the value associated with the key being the system property above
- * is looked for. If present, the value is processed just like above.
+ * + * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * conf directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *
+ * The jaxp.properties file is read only once by the JAXP implementation + * and its values are then cached for future use. If the file does not exist + * 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. *
+ * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -166,19 +177,20 @@ public abstract class SchemaFactory { * {@link SchemaFactoryConfigurationError} will be thrown. *
* Platform default SchemaFactory
is located
* in a implementation specific way. There must be a platform default
* SchemaFactory
for W3C XML Schema.
*
If everything fails, {@link IllegalArgumentException} will be thrown.
+ *If everything fails, {@link IllegalArgumentException} will be thrown. * - *
Tip for Trouble-shooting:
+ *Tip for Trouble-shooting: *
See {@link java.util.Properties#load(java.io.InputStream)} for * exactly how a property file is parsed. In particular, colons ':' * need to be escaped in a property file, so make sure schema language - * URIs are properly escaped in it. For example:
+ * URIs are properly escaped in it. For example: ** http\://www.w3.org/2001/XMLSchema=org.acme.foo.XSSchemaFactory *diff --git a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java index ea7370e06e7..05f7a4e52c0 100644 --- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java +++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ package javax.xml.xpath; /** - *
An XPathFactory
instance can be used to create
+ *
An {@code XPathFactory} instance can be used to create * {@link javax.xml.xpath.XPath} objects.
* *See {@link #newInstance(String uri)} for lookup mechanism.
@@ -68,13 +68,13 @@ public abstract class XPathFactory { /** *Protected constructor as {@link #newInstance()} or {@link #newInstance(String uri)}
* or {@link #newInstance(String uri, String factoryClassName, ClassLoader classLoader)}
- * should be used to create a new instance of an XPathFactory
.
Get a new XPathFactory
instance using the default object model,
+ *
Get a new {@code XPathFactory} instance using the default object model, * {@link #DEFAULT_OBJECT_MODEL_URI}, * the W3C DOM.
* @@ -85,10 +85,10 @@ public abstract class XPathFactory { * *Since the implementation for the W3C DOM is always available, this method will never fail.
* - * @return Instance of anXPathFactory
.
+ * @return Instance of an {@code XPathFactory}.
*
* @throws RuntimeException When there is a failure in creating an
- * XPathFactory
for the default object model.
+ * {@code XPathFactory} for the default object model.
*/
public static XPathFactory newInstance() {
@@ -105,23 +105,35 @@ public abstract class XPathFactory {
}
/**
- * Get a new XPathFactory
instance using the specified object model.
Get a new {@code XPathFactory} instance using the specified object model.
* - *To find a XPathFactory
object,
+ *
To find a {@code XPathFactory} object, * this method looks the following places in the following order where "the class loader" refers to the context class loader:
** If the system property {@link #DEFAULT_PROPERTY_NAME} + ":uri" is present, * where uri is the parameter to this method, then its value is read as a class name. * The method will try to create a new instance of this class by using the class loader, * and returns it if it is successfully created. *
+ * Use the configuration file "jaxp.properties". The file is in standard + * {@link java.util.Properties} format and typically located in the + * conf directory of the Java installation. It contains the fully qualified + * name of the implementation class with the key being the system property + * defined above. + *
+ * The jaxp.properties file is read only once by the JAXP implementation + * and its values are then cached for future use. If the file does not exist + * 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. *
+ * Use the service-provider loading facility, defined by the * {@link java.util.ServiceLoader} class, to attempt to locate and load an * implementation of the service using the {@linkplain * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: @@ -140,16 +152,17 @@ public abstract class XPathFactory { * {@link XPathFactoryConfigurationException} will be thrown. *
XPathFactory
is located in a platform specific way.
+ * + * Platform default {@code XPathFactory} is located in a platform specific way. * There must be a platform default XPathFactory for the W3C DOM, i.e. {@link #DEFAULT_OBJECT_MODEL_URI}. *
If everything fails, an XPathFactoryConfigurationException
will be thrown.
If everything fails, an {@code XPathFactoryConfigurationException} will be thrown. * - *
Tip for Trouble-shooting:
+ *Tip for Trouble-shooting: *
See {@link java.util.Properties#load(java.io.InputStream)} for exactly how a property file is parsed. * In particular, colons ':' need to be escaped in a property file, so make sure the URIs are properly escaped in it. - * For example:
+ * For example: ** http\://java.sun.com/jaxp/xpath/dom=org.acme.DomXPathFactory *@@ -159,7 +172,7 @@ public abstract class XPathFactory { *
http://java.sun.com/jaxp/xpath/dom
for the W3C DOM,
* the org.w3c.dom package, and implementations are free to introduce other URIs for other object models.
*
- * @return Instance of an XPathFactory
.
+ * @return Instance of an {@code XPathFactory}.
*
* @throws XPathFactoryConfigurationException If the specified object model
* is unavailable, or if there is a configuration error.
@@ -199,7 +212,7 @@ public abstract class XPathFactory {
}
/**
- * Obtain a new instance of a XPathFactory
from a factory class name. XPathFactory
+ *
Obtain a new instance of a {@code XPathFactory} from a factory class name. {@code XPathFactory}
* is returned if specified factory class supports the specified object model.
* This function is useful when there are multiple providers in the classpath.
* It gives more control to the application as it can specify which provider
@@ -227,7 +240,7 @@ public abstract class XPathFactory {
* current Thread
's context classLoader is used to load the factory class.
*
*
- * @return New instance of a XPathFactory
+ * @return New instance of a {@code XPathFactory}
*
* @throws XPathFactoryConfigurationException
* if factoryClassName
is null
, or
@@ -281,11 +294,11 @@ public abstract class XPathFactory {
}
/**
- *
Is specified object model supported by this XPathFactory
?
Is specified object model supported by this {@code XPathFactory}?
* - * @param objectModel Specifies the object model which the returnedXPathFactory
will understand.
+ * @param objectModel Specifies the object model which the returned {@code XPathFactory} will understand.
*
- * @return true
if XPathFactory
supports objectModel
, else false
.
+ * @return true
if {@code XPathFactory} supports objectModel
, else false
.
*
* @throws NullPointerException If objectModel
is null
.
* @throws IllegalArgumentException If objectModel.length() == 0
.
@@ -293,16 +306,16 @@ public abstract class XPathFactory {
public abstract boolean isObjectModelSupported(String objectModel);
/**
- * Set a feature for this XPathFactory
and
+ *
Set a feature for this {@code XPathFactory} and
* XPath
s created by this factory.
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
* An {@link XPathFactoryConfigurationException} is thrown if this
- * XPathFactory
or the XPath
s
+ * {@code XPathFactory} or the XPath
s
* it creates cannot support the feature.
- * It is possible for an XPathFactory
to expose a feature value
+ * It is possible for an {@code XPathFactory} to expose a feature value
* but be unable to change its state.
*
true
or false
.
*
- * @throws XPathFactoryConfigurationException if this XPathFactory
or the XPath
s
+ * @throws XPathFactoryConfigurationException if this {@code XPathFactory} or the XPath
s
* it creates cannot support this feature.
* @throws NullPointerException if name
is null
.
*/
@@ -330,9 +343,9 @@ public abstract class XPathFactory {
* Feature names are fully qualified {@link java.net.URI}s.
* Implementations may define their own features.
* An {@link XPathFactoryConfigurationException} is thrown if this
- * XPathFactory
or the XPath
s
+ * {@code XPathFactory} or the XPath
s
* it creates cannot support the feature.
- * It is possible for an XPathFactory
to expose a feature value
+ * It is possible for an {@code XPathFactory} to expose a feature value
* but be unable to change its state.
*
*
@@ -341,7 +354,7 @@ public abstract class XPathFactory {
* @return State of the named feature.
*
* @throws XPathFactoryConfigurationException if this
- * XPathFactory
or the XPath
s
+ * {@code XPathFactory} or the XPath
s
* it creates cannot support this feature.
* @throws NullPointerException if name
is null
.
*/
@@ -382,7 +395,7 @@ public abstract class XPathFactory {
/**
* Return a new XPath
using the underlying object
- * model determined when the XPathFactory
was instantiated.
XPath
.
*/