You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by je...@locus.apache.org on 2000/05/02 02:05:59 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/validators/schema SchemaGrammarResolver.java
jeffreyr 00/05/01 17:05:58
Modified: java/src/org/apache/xerces/validators/schema Tag: schemawork
SchemaGrammarResolver.java
Log:
implement GrammarResolver Interface
Revision Changes Path
No revision
No revision
1.1.2.3 +8 -46 xml-xerces/java/src/org/apache/xerces/validators/schema/Attic/SchemaGrammarResolver.java
Index: SchemaGrammarResolver.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/schema/Attic/SchemaGrammarResolver.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- SchemaGrammarResolver.java 2000/04/28 19:40:23 1.1.2.2
+++ SchemaGrammarResolver.java 2000/05/02 00:05:58 1.1.2.3
@@ -64,7 +64,7 @@
/**
- * This class embodies the representation of a Grammar
+ * This class embodies the representation of a Schema Grammar
* pool.
* This class is called from the validator.
* Grammar pool maps to a set of Grammar Proxy classes.
@@ -105,7 +105,7 @@
public String[] getNSKeysInPool() {
int numberOfNSKeysInPool = fGrammarRegistry.size();
String[] NSArray = new String[numberOfNSKeysInPool];
- Enumeration enumOfKeys = fGrammarRegistry.keys();
+ Enumeration enumOfKeys = nameSpaceKeys();
for (int i = 0; i<numberOfNSKeysInPool; i ++ ) {
NSArray[i] = (String )( enumOfKeys.nextElement() );
}
@@ -129,47 +129,7 @@
}
/**
- * Removes association of Namespace key and Grammar from
- * Grammar pool
- *
- * @param nameSpaceKey
- * Name space key
- */
- public void deleteGrammarForNS( String nameSpaceKey ) {
- if ( isNSInPool( nameSpaceKey ) == true )
- fGrammarRegistry.remove( nameSpaceKey );
- }
-
- /**
- * Is Grammar abstraction in Grammar pool?
*
- * @param grammar Grammar Abstraction
- * @return true - Yes there is at least one instance
- * false - No
- */
- public boolean isGrammarInPool( Grammar grammar ) {
- return fGrammarRegistry.contains( grammar );
- }
-
- /**
- * Is Namespace key in Grammar pool
- *
- * @param nameSpaceKey
- * Namespace key
- * @return Boolean- true - Namespace key association
- * is in grammar pool.
- */
- public boolean isNSInPool( String nameSpaceKey ) {
- return fGrammarRegistry.containsKey( nameSpaceKey );
- }
- /**
- * Reset internal Namespace/Grammar registry.
- */
- public void resetGrammarResolver() {
- fGrammarRegistry.clear( );
- }
- /**
- *
* @return Only instance of Grammar pool ( Singleton
* pattern).
*/
@@ -191,7 +151,7 @@
*/
public Enumeration nameSpaceKeys(){
- return null;
+ return fGrammarRegistry.keys();
}
@@ -203,6 +163,8 @@
* Name space key
*/
public Grammar removeGrammar( String nameSpaceKey ) {
+ if ( containsNamesSpace( nameSpaceKey ) == true )
+ fGrammarRegistry.remove( nameSpaceKey );
return null;
}
@@ -216,8 +178,7 @@
* false - No
*/
public boolean contains( Grammar grammar ){
- return false;
-
+ return fGrammarRegistry.contains( grammar );
}
/**
@@ -229,13 +190,14 @@
* is in grammar pool.
*/
public boolean containsNamesSpace( String nameSpaceKey ){
- return false;
+ return fGrammarRegistry.containsKey( nameSpaceKey );
}
/**
* Reset internal Namespace/Grammar registry.
*/
public void clearGrammarResolver() {
+ fGrammarRegistry.clear();
}