com.ibm.ims.xms
Class XMSGrammarPool

java.lang.Object
  |
  +--com.ibm.ims.xms.XMSGrammarPool

public class XMSGrammarPool
extends java.lang.Object

This uses the Xerces2's grammar preparsing and caching functionality, to parses and cache Schema grammars.


Field Summary
static int BIG_PRIME
           
static java.lang.String GRAMMAR_POOL
          Property identifier: grammar pool.
protected  org.apache.xerces.util.XMLGrammarPoolImpl grammarPool
           
protected static java.lang.String NAMESPACES_FEATURE_ID
          Namespaces feature id (http://xml.org/sax/features/namespaces).
protected static java.lang.String SCHEMA_FULL_CHECKING_FEATURE_ID
          Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking).
static java.lang.String SCHEMA_RESOLVER
          Identifies the type of XMS Schema Resolver to use
protected static java.lang.String SCHEMA_VALIDATION_FEATURE_ID
          Schema validation feature id (http://apache.org/xml/features/validation/schema).
protected  XMSSchemaResolver schemaResolver
           
protected static XMSGrammarPool sharedGrammarPool
          This is used temporarily for a shared grammar pool implementation.
static java.lang.String SYMBOL_TABLE
          Property identifier: symbol table.
protected  org.apache.xerces.util.SynchronizedSymbolTable symbolTable
           
protected static java.lang.String VALIDATION_FEATURE_ID
          Validation feature id (http://xml.org/sax/features/validation).
 
Constructor Summary
XMSGrammarPool()
          Constructor.
 
Method Summary
protected  XMSSchemaResolver createXMSSchemaResolver()
          Creates the XMSSchemaResolver, based on an environment variable Called at construction time.
 org.apache.xerces.xni.grammars.XMLGrammarPool getGrammarPool()
          Returns the Grammar Pool being used for this GrammarPool.
static XMSGrammarPool getSharedGrammarPool()
          This is used temporarily for a shared grammar pool implementation.
 org.apache.xerces.util.SymbolTable getSymbolTable()
          Returns the Symbol Table being used for this GrammarPool.
static void main(java.lang.String[] args)
          This method is used for internal testing only
 org.apache.xerces.impl.xs.SchemaGrammar preparse(org.apache.xerces.xni.parser.XMLInputSource xmlInput)
          Preparses a Schema into the Grammar Pool.
 org.apache.xerces.impl.xs.SchemaGrammar retrieveGrammar(java.lang.String namespace)
          Retrives a Grammar based on passed in file name.
 void setXMSSchemaResolver(XMSSchemaResolver xmsSchemaResolver)
          Sets the XMSSchemaResolver to use to resolve the location of requested XMS Schema documents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYMBOL_TABLE

public static final java.lang.String SYMBOL_TABLE
Property identifier: symbol table.

GRAMMAR_POOL

public static final java.lang.String GRAMMAR_POOL
Property identifier: grammar pool.

SCHEMA_RESOLVER

public static final java.lang.String SCHEMA_RESOLVER
Identifies the type of XMS Schema Resolver to use

NAMESPACES_FEATURE_ID

protected static final java.lang.String NAMESPACES_FEATURE_ID
Namespaces feature id (http://xml.org/sax/features/namespaces).

VALIDATION_FEATURE_ID

protected static final java.lang.String VALIDATION_FEATURE_ID
Validation feature id (http://xml.org/sax/features/validation).

SCHEMA_VALIDATION_FEATURE_ID

protected static final java.lang.String SCHEMA_VALIDATION_FEATURE_ID
Schema validation feature id (http://apache.org/xml/features/validation/schema).

SCHEMA_FULL_CHECKING_FEATURE_ID

protected static final java.lang.String SCHEMA_FULL_CHECKING_FEATURE_ID
Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking).

BIG_PRIME

public static final int BIG_PRIME

symbolTable

protected org.apache.xerces.util.SynchronizedSymbolTable symbolTable

grammarPool

protected org.apache.xerces.util.XMLGrammarPoolImpl grammarPool

schemaResolver

protected XMSSchemaResolver schemaResolver

sharedGrammarPool

protected static XMSGrammarPool sharedGrammarPool
This is used temporarily for a shared grammar pool implementation. Sure wish Java had a friends clause.
Constructor Detail

XMSGrammarPool

public XMSGrammarPool()
               throws XMSException
Constructor. Initializes symbol table, grammar parser, and grammar pool.
Method Detail

main

public static void main(java.lang.String[] args)
This method is used for internal testing only

getSharedGrammarPool

public static XMSGrammarPool getSharedGrammarPool()
                                           throws XMSException
This is used temporarily for a shared grammar pool implementation. Sure wish Java had a friends clause.

getSymbolTable

public org.apache.xerces.util.SymbolTable getSymbolTable()
Returns the Symbol Table being used for this GrammarPool.

getGrammarPool

public org.apache.xerces.xni.grammars.XMLGrammarPool getGrammarPool()
Returns the Grammar Pool being used for this GrammarPool.

setXMSSchemaResolver

public void setXMSSchemaResolver(XMSSchemaResolver xmsSchemaResolver)
Sets the XMSSchemaResolver to use to resolve the location of requested XMS Schema documents.

createXMSSchemaResolver

protected XMSSchemaResolver createXMSSchemaResolver()
                                             throws XMSException
Creates the XMSSchemaResolver, based on an environment variable Called at construction time.

preparse

public org.apache.xerces.impl.xs.SchemaGrammar preparse(org.apache.xerces.xni.parser.XMLInputSource xmlInput)
                                                 throws org.apache.xerces.xni.XNIException,
                                                        java.io.IOException
Preparses a Schema into the Grammar Pool.

retrieveGrammar

public org.apache.xerces.impl.xs.SchemaGrammar retrieveGrammar(java.lang.String namespace)
                                                        throws org.apache.xerces.xni.XNIException,
                                                               java.io.IOException
Retrives a Grammar based on passed in file name. If Grammar has not been cached uses Resolver (if set) to parse Grammar. Returns null if grammar could not be found to parse or Resolver has not set.


(C) International Business Machines Corporation 2004. All rights reserved.