org.apache.xerces.impl.validation
Class GrammarPool

java.lang.Object
  |
  +--org.apache.xerces.impl.validation.GrammarPool
Direct Known Subclasses:
CachingParserPool.ShadowedGrammarPool, CachingParserPool.SynchronizedGrammarPool

public class GrammarPool
extends java.lang.Object

Stores grammars in a pool associated to a specific key. This grammar pool implementation stores two types of grammars: those keyed by the root element name, and those keyed by the grammar's target namespace.

Version:
$Id: GrammarPool.java,v 1.1.2.5 2001/01/10 07:45:45 andyc Exp $
Author:
Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000, Jeffrey Rodriguez, IBM, Andy Clark, IBM

Field Summary
protected  java.util.Hashtable fGrammars
          Grammars associated with element root name.
protected  java.util.Hashtable fGrammarsNS
          Grammars associated with namespaces.
 
Constructor Summary
GrammarPool()
          Default constructor.
 
Method Summary
 boolean containsGrammar(java.lang.String rootElement)
          Returns true if the grammar pool contains a grammar associated to the specified root element name.
 boolean containsGrammarNS(java.lang.String namespace)
          Returns true if the grammar pool contains a grammar associated to the specified target namespace.
 Grammar getGrammar(java.lang.String rootElement)
          Returns the grammar associated to the specified root element name.
 Grammar getGrammarNS(java.lang.String namespace)
          Returns the grammar associated to the specified target namespace.
 void putGrammar(java.lang.String rootElement, Grammar grammar)
          Puts the specified grammar into the grammar pool and associate it to a root element name.
 void putGrammarNS(java.lang.String namespace, Grammar grammar)
          Puts the specified grammar into the grammar pool and associate it to a target namespace.
 Grammar removeGrammar(java.lang.String rootElement)
          Removes the grammar associated to the specified root elememt name from the grammar pool and returns the removed grammar.
 Grammar removeGrammarNS(java.lang.String namespace)
          Removes the grammar associated to the specified namespace from the grammar pool and returns the removed grammar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fGrammars

protected java.util.Hashtable fGrammars
Grammars associated with element root name.

fGrammarsNS

protected java.util.Hashtable fGrammarsNS
Grammars associated with namespaces.
Constructor Detail

GrammarPool

public GrammarPool()
Default constructor.
Method Detail

putGrammar

public void putGrammar(java.lang.String rootElement,
                       Grammar grammar)
Puts the specified grammar into the grammar pool and associate it to a root element name.
Parameters:
rootElement - Root element name.
grammar - The grammar.

putGrammarNS

public void putGrammarNS(java.lang.String namespace,
                         Grammar grammar)
Puts the specified grammar into the grammar pool and associate it to a target namespace.
Parameters:
namespace - The grammar namespace.
grammar - The grammar.

getGrammar

public Grammar getGrammar(java.lang.String rootElement)
Returns the grammar associated to the specified root element name.
Parameters:
rootElement - Root element name.

getGrammarNS

public Grammar getGrammarNS(java.lang.String namespace)
Returns the grammar associated to the specified target namespace.
Parameters:
namespace - Target namespace.

removeGrammar

public Grammar removeGrammar(java.lang.String rootElement)
Removes the grammar associated to the specified root elememt name from the grammar pool and returns the removed grammar.
Parameters:
rootElement - Root element name.

removeGrammarNS

public Grammar removeGrammarNS(java.lang.String namespace)
Removes the grammar associated to the specified namespace from the grammar pool and returns the removed grammar.
Parameters:
namespace - Target namespace.

containsGrammar

public boolean containsGrammar(java.lang.String rootElement)
Returns true if the grammar pool contains a grammar associated to the specified root element name.
Parameters:
rootElement - Root element name.

containsGrammarNS

public boolean containsGrammarNS(java.lang.String namespace)
Returns true if the grammar pool contains a grammar associated to the specified target namespace.
Parameters:
namespace - Target namespace.


Copyright © 1999-2001 Apache XML Project. All Rights Reserved.