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/11/25 05:18:47 UTC
svn commit: r720409 - in
/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs:
SchemaGrammar.java traversers/XSDHandler.java
Author: mrglavas
Date: Mon Nov 24 20:18:45 2008
New Revision: 720409
URL: http://svn.apache.org/viewvc?rev=720409&view=rev
Log:
Adding a flag to control the mutability of SchemaGrammars.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java?rev=720409&r1=720408&r2=720409&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java Mon Nov 24 20:18:45 2008
@@ -102,6 +102,9 @@
// parsers for annotation support
private SoftReference fSAXParser = null;
private SoftReference fDOMParser = null;
+
+ // is this grammar immutable? (fully constructed and not changeable)
+ private boolean fIsImmutable = false;
//
// Constructors
@@ -1298,5 +1301,13 @@
}
fAnnotations[fNumAnnotations++] = annotation;
}
+
+ public void setImmutable(boolean isImmutable) {
+ fIsImmutable = isImmutable;
+ }
+
+ public boolean isImmutable() {
+ return fIsImmutable;
+ }
} // class SchemaGrammar
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java?rev=720409&r1=720408&r2=720409&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java Mon Nov 24 20:18:45 2008
@@ -1010,13 +1010,17 @@
private boolean isExistingGrammar(XSDDescription desc) {
SchemaGrammar sg = fGrammarBucket.getGrammar(desc.getTargetNamespace());
- if(sg == null) {
+ if (sg == null) {
return findGrammar(desc) != null;
}
+ else if (sg.isImmutable()) {
+ return true;
+ }
else {
try {
return sg.getDocumentLocations().contains(XMLEntityManager.expandSystemId(desc.getLiteralSystemId(), desc.getBaseSystemId(), false));
- } catch (MalformedURIException e) {
+ }
+ catch (MalformedURIException e) {
return false;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org