xml.parser
Class SchemaLoader

java.lang.Object
  extended by xml.parser.SchemaLoader

public final class SchemaLoader
extends java.lang.Object

Utility class to load a schema

Version:
$Id: SchemaLoader.java 20811 2012-01-15 15:40:14Z kerik-sf $
Author:
Eric Le Lay

Field Summary
static java.lang.String GRAMMAR_POOL
          Property identifier: grammar pool.
protected static java.lang.String NAMESPACES_FEATURE_ID
          Namespaces feature id (http://xml.org/sax/features/namespaces).
protected static java.lang.String SCHEMA_LOCATION
          Property identifier: namespace-schema location pairs.
protected static java.lang.String SCHEMA_NONS_LOCATION
          Property identifier: no namespace schema location.
static java.lang.String SYMBOL_TABLE
          Property identifier: symbol table.
 
Method Summary
static SchemaLoader instance()
           
 javax.xml.validation.ValidatorHandler loadJaxpGrammar(java.lang.String current, java.lang.String schemaFileNameOrURL, org.xml.sax.ErrorHandler handler, org.gjt.sp.jedit.Buffer requestingBuffer)
           
 org.apache.xerces.xni.grammars.Grammar loadXercesGrammar(org.gjt.sp.jedit.Buffer current, java.lang.String systemId, java.lang.String schemaLocation, java.lang.String nonsSchemaLocation, org.xml.sax.ErrorHandler handler)
          load a native Xerces Grammar, which can be used to get an XSModel for CompletionInfo
 
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.

See Also:
Constant Field Values

GRAMMAR_POOL

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

See Also:
Constant Field Values

NAMESPACES_FEATURE_ID

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

See Also:
Constant Field Values

SCHEMA_LOCATION

protected static final java.lang.String SCHEMA_LOCATION
Property identifier: namespace-schema location pairs.

See Also:
Constant Field Values

SCHEMA_NONS_LOCATION

protected static final java.lang.String SCHEMA_NONS_LOCATION
Property identifier: no namespace schema location.

See Also:
Constant Field Values
Method Detail

loadJaxpGrammar

public javax.xml.validation.ValidatorHandler loadJaxpGrammar(java.lang.String current,
                                                             java.lang.String schemaFileNameOrURL,
                                                             org.xml.sax.ErrorHandler handler,
                                                             org.gjt.sp.jedit.Buffer requestingBuffer)
                                                      throws org.xml.sax.SAXException,
                                                             java.io.IOException,
                                                             java.lang.IllegalArgumentException
Parameters:
current - systemId of the parsed document
schemaFileNameOrURL - identifier of the schema to load
handler - channel to report errors
requestingBuffer - buffer requesting the ValidatorHandler, for caching
Throws:
org.xml.sax.SAXException
java.io.IOException
java.lang.IllegalArgumentException

loadXercesGrammar

public org.apache.xerces.xni.grammars.Grammar loadXercesGrammar(org.gjt.sp.jedit.Buffer current,
                                                                java.lang.String systemId,
                                                                java.lang.String schemaLocation,
                                                                java.lang.String nonsSchemaLocation,
                                                                org.xml.sax.ErrorHandler handler)
                                                         throws java.io.IOException,
                                                                org.xml.sax.SAXException
load a native Xerces Grammar, which can be used to get an XSModel for CompletionInfo

Parameters:
schemaLocation - required to find imported grammars (see test_data/import_schema)
Throws:
java.io.IOException
org.xml.sax.SAXException

instance

public static SchemaLoader instance()
Returns:
singleton instance