< prev index next >

jaxp/src/java.xml/share/classes/jdk/xml/internal/JdkXmlFeatures.java

Print this page




  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package jdk.xml.internal;
  27 
  28 import javax.xml.XMLConstants;
  29 import static jdk.xml.internal.JdkXmlUtils.SP_USE_CATALOG;

  30 
  31 /**
  32  * This class manages JDK's XML Features. Previously added features and properties
  33  * may be gradually moved to this class.
  34  */
  35 public class JdkXmlFeatures {
  36     public static final String ORACLE_JAXP_PROPERTY_PREFIX =
  37         "http://www.oracle.com/xml/jaxp/properties/";
  38     /**
  39      * Feature enableExtensionFunctions
  40      */
  41     public static final String ORACLE_ENABLE_EXTENSION_FUNCTION =
  42             ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions";
  43     public static final String SP_ENABLE_EXTENSION_FUNCTION =
  44             "javax.xml.enableExtensionFunctions";
  45     // This is the correct name by the spec
  46     public static final String SP_ENABLE_EXTENSION_FUNCTION_SPEC =
  47             "jdk.xml.enableExtensionFunctions";
  48     public static final String CATALOG_FEATURES = "javax.xml.catalog.catalogFeatures";
  49 
  50     public final static String PROPERTY_USE_CATALOG = XMLConstants.USE_CATALOG;
  51 
  52     public static enum XmlFeature {
  53         /**
  54          * Feature enableExtensionFunctions
  55          * FSP: extension function is enforced by FSP. When FSP is on, extension
  56          * function is disabled.
  57          */
  58         ENABLE_EXTENSION_FUNCTION(ORACLE_ENABLE_EXTENSION_FUNCTION,
  59                 SP_ENABLE_EXTENSION_FUNCTION_SPEC, true, false, true, true),
  60         /**
  61          * The {@link javax.xml.XMLConstants.USE_CATALOG} feature.
  62          * FSP: USE_CATALOG is not enforced by FSP.
  63          */
  64         USE_CATALOG(PROPERTY_USE_CATALOG, SP_USE_CATALOG, true, false, true, false);






  65 
  66         private final String name;
  67         private final String nameSP;
  68         private final boolean valueDefault;
  69         private final boolean valueEnforced;
  70         private final boolean hasSystem;
  71         private final boolean enforced;
  72 
  73         /**
  74          * Constructs an XmlFeature instance.
  75          * @param name the name of the feature
  76          * @param nameSP the name of the System Property
  77          * @param value the value of the feature
  78          * @param hasSystem a flag to indicate whether the feature is supported
  79          * @param enforced a flag indicating whether the feature is
  80          * FSP (Feature_Secure_Processing) enforced
  81          * with a System property
  82          */
  83         XmlFeature(String name, String nameSP, boolean value, boolean valueEnforced, boolean hasSystem, boolean enforced) {
  84             this.name = name;




  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package jdk.xml.internal;
  27 
  28 import javax.xml.XMLConstants;
  29 import static jdk.xml.internal.JdkXmlUtils.SP_USE_CATALOG;
  30 import static jdk.xml.internal.JdkXmlUtils.RESET_SYMBOL_TABLE;
  31 
  32 /**
  33  * This class manages JDK's XML Features. Previously added features and properties
  34  * may be gradually moved to this class.
  35  */
  36 public class JdkXmlFeatures {
  37     public static final String ORACLE_JAXP_PROPERTY_PREFIX =
  38         "http://www.oracle.com/xml/jaxp/properties/";
  39     /**
  40      * Feature enableExtensionFunctions
  41      */
  42     public static final String ORACLE_ENABLE_EXTENSION_FUNCTION =
  43             ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions";
  44     public static final String SP_ENABLE_EXTENSION_FUNCTION =
  45             "javax.xml.enableExtensionFunctions";
  46     // This is the correct name by the spec
  47     public static final String SP_ENABLE_EXTENSION_FUNCTION_SPEC =
  48             "jdk.xml.enableExtensionFunctions";
  49     public static final String CATALOG_FEATURES = "javax.xml.catalog.catalogFeatures";
  50 
  51     public final static String PROPERTY_USE_CATALOG = XMLConstants.USE_CATALOG;
  52 
  53     public static enum XmlFeature {
  54         /**
  55          * Feature enableExtensionFunctions
  56          * FSP: extension function is enforced by FSP. When FSP is on, extension
  57          * function is disabled.
  58          */
  59         ENABLE_EXTENSION_FUNCTION(ORACLE_ENABLE_EXTENSION_FUNCTION,
  60                 SP_ENABLE_EXTENSION_FUNCTION_SPEC, true, false, true, true),
  61         /**
  62          * The {@link javax.xml.XMLConstants.USE_CATALOG} feature.
  63          * FSP: USE_CATALOG is not enforced by FSP.
  64          */
  65         USE_CATALOG(PROPERTY_USE_CATALOG, SP_USE_CATALOG, true, false, true, false),
  66 
  67         /**
  68          * Feature resetSymbolTable
  69          * FSP: RESET_SYMBOL_TABLE_FEATURE is not enforced by FSP.
  70          */
  71         RESET_SYMBOL_TABLE_FEATURE(RESET_SYMBOL_TABLE, RESET_SYMBOL_TABLE, false, false, true, false);
  72 
  73         private final String name;
  74         private final String nameSP;
  75         private final boolean valueDefault;
  76         private final boolean valueEnforced;
  77         private final boolean hasSystem;
  78         private final boolean enforced;
  79 
  80         /**
  81          * Constructs an XmlFeature instance.
  82          * @param name the name of the feature
  83          * @param nameSP the name of the System Property
  84          * @param value the value of the feature
  85          * @param hasSystem a flag to indicate whether the feature is supported
  86          * @param enforced a flag indicating whether the feature is
  87          * FSP (Feature_Secure_Processing) enforced
  88          * with a System property
  89          */
  90         XmlFeature(String name, String nameSP, boolean value, boolean valueEnforced, boolean hasSystem, boolean enforced) {
  91             this.name = name;


< prev index next >