You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2008/09/27 19:08:46 UTC

svn commit: r699688 - /xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java

Author: mrglavas
Date: Sat Sep 27 10:08:45 2008
New Revision: 699688

URL: http://svn.apache.org/viewvc?rev=699688&view=rev
Log:
Return true for each of the JAXP Source features to indicate
to the caller of getFeature() that this SchemaFactory supports 
all of the built-in JAXP Source types.

Modified:
    xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java

Modified: xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java?rev=699688&r1=699687&r2=699688&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java Sat Sep 27 10:08:45 2008
@@ -67,6 +67,9 @@
     
     // feature identifiers
     
+    /** JAXP Source feature prefix. */
+    private static final String JAXP_SOURCE_FEATURE_PREFIX = "http://javax.xml.transform";
+    
     /** Feature identifier: schema full checking. */
     private static final String SCHEMA_FULL_CHECKING =
         Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING;
@@ -299,6 +302,15 @@
             throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(Locale.getDefault(), 
                     "FeatureNameNull", null));
         }
+        if (name.startsWith(JAXP_SOURCE_FEATURE_PREFIX)) {
+            // Indicates to the caller that this SchemaFactory supports a specific JAXP Source.
+            if (name.equals(StreamSource.FEATURE) ||
+                name.equals(SAXSource.FEATURE) ||
+                name.equals(DOMSource.FEATURE) ||
+                name.equals(StAXSource.FEATURE)) {
+                return true;
+            }
+        }
         if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
             return (fSecurityManager != null);
         }
@@ -361,6 +373,16 @@
             throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(Locale.getDefault(), 
                     "FeatureNameNull", null));
         }
+        if (name.startsWith(JAXP_SOURCE_FEATURE_PREFIX)) {
+            if (name.equals(StreamSource.FEATURE) ||
+                name.equals(SAXSource.FEATURE) ||
+                name.equals(DOMSource.FEATURE) ||
+                name.equals(StAXSource.FEATURE)) {
+                throw new SAXNotSupportedException(
+                        SAXMessageFormatter.formatMessage(Locale.getDefault(), 
+                        "feature-read-only", new Object [] {name}));
+            }
+        }
         if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
             fSecurityManager = value ? new SecurityManager() : null;
             fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org