286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 2001, 2002,2004 The Apache Software Foundation. 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A * <p> This class provides an easy way for a user to preparse grammars 286N/A * of various types. By default, it knows how to preparse external 286N/A * DTD's and schemas; it provides an easy way for user applications to 286N/A * register classes that know how to parse additional grammar types. 286N/A * By default, it does no grammar caching; but it provides ways for 286N/A * user applications to do so. 286N/A * @author Neil Graham, IBM 286N/A // feature: continue-after-fatal-error 286N/A /** Property identifier: symbol table. */ 286N/A /** Property identifier: error reporter. */ 286N/A /** Property identifier: error handler. */ 286N/A /** Property identifier: entity resolver. */ 286N/A /** Property identifier: grammar pool . */ 286N/A // the "built-in" grammar loaders 286N/A /** Recognized properties. */ 286N/A // Hashtable holding our loaders 286N/A /** Default constructor. */ 286N/A * Constructs a preparser using the specified symbol table. 286N/A * @param symbolTable The symbol table to use. 286N/A // those are all the basic properties... 286N/A }
// <init>(SymbolTable) 286N/A * Register a type of grammar to make it preparsable. If 286N/A * the second parameter is null, the parser will use its built-in 286N/A * facilities for that grammar type. 286N/A * This should be called by the application immediately 286N/A * @param type URI identifying the type of the grammar 286N/A * @param loader an object capable of preparsing that type; null if the ppreparser should use built-in knowledge. 286N/A * @return true if successful; false if no built-in knowledge of 286N/A * the type or if unable to instantiate the string we know about 286N/A // got one; just instantiate it... 286N/A }
// registerPreparser(String, XMLGrammarLoader): boolean 286N/A * Parse a grammar from a location identified by an 286N/A * This method also adds this grammar to the XMLGrammarPool 286N/A * @param type The type of the grammar to be constructed 286N/A * @param is The XMLInputSource containing this grammar's 286N/A * <strong>If a URI is included in the systemId field, the parser will not expand this URI or make it 286N/A * available to the EntityResolver</strong> 286N/A * @return The newly created <code>Grammar</code>. 286N/A * @exception XNIException thrown on an error in grammar 286N/A * @exception IOException thrown if an error is encountered 286N/A // make sure gl's been set up with all the "basic" properties: 286N/A // potentially, not all will support this one... 286N/A }
// preparseGrammar(String, XMLInputSource): Grammar 286N/A * Set the locale to use for messages. 286N/A * @param locale The locale object to use for localization of messages. 286N/A * @exception XNIException Thrown if the parser does not support the 286N/A /** Return the Locale the XMLGrammarLoader is using. */ 286N/A }
// getLocale(): Locale 286N/A * Sets the error handler. 286N/A * @param errorHandler The error handler. 286N/A }
// setErrorHandler(XMLErrorHandler) 286N/A /** Returns the registered error handler. */ 286N/A }
// getErrorHandler(): XMLErrorHandler 286N/A * Sets the entity resolver. 286N/A * @param entityResolver The new entity resolver. 286N/A }
// setEntityResolver(XMLEntityResolver) 286N/A /** Returns the registered entity resolver. */ 286N/A }
// getEntityResolver(): XMLEntityResolver 286N/A * Sets the grammar pool. 286N/A * @param grammarPool The new grammar pool. 286N/A }
// setGrammarPool(XMLGrammarPool) 286N/A /** Returns the registered grammar pool. */ 286N/A }
// getGrammarPool(): XMLGrammarPool 286N/A // it's possible the application may want access to a certain loader to do 286N/A }
// getLoader(String): XMLGrammarLoader 286N/A // set a feature. This method tries to set it on all 286N/A // registered loaders; it eats any resulting exceptions. If 286N/A // an app needs to know if a particular feature is supported 286N/A // by a grammar loader of a particular type, it will have 286N/A // to retrieve that loader and use the loader's setFeature method. 286N/A // since our error reporter is a property we set later, 286N/A // make sure features it understands are also set. 286N/A }
//setFeature(String, boolean) 286N/A // set a property. This method tries to set it on all 286N/A // registered loaders; it eats any resulting exceptions. If 286N/A // an app needs to know if a particular property is supported 286N/A // by a grammar loader of a particular type, it will have 286N/A // to retrieve that loader and use the loader's setProperty method. 286N/A // <p> <strong>An application should use the explicit method 286N/A // in this class to set "standard" properties like error handler etc.</strong> 286N/A }
//setProperty(String, Object) 286N/A // get status of feature in a particular loader. This 286N/A // catches no exceptions--including NPE's--so the application had 286N/A // better make sure the loader exists and knows about this feature. 286N/A // @param type type of grammar to look for the feature in. 286N/A // @param featureId the feature string to query. 286N/A // @return the value of the feature. 286N/A }
// getFeature (String, String): boolean 286N/A // get status of property in a particular loader. This 286N/A // catches no exceptions--including NPE's--so the application had 286N/A // better make sure the loader exists and knows about this property. 286N/A // <strong>For standard properties--that will be supported 286N/A // by all loaders--the specific methods should be queried!</strong> 286N/A // @param type type of grammar to look for the property in. 286N/A // @param propertyId the property string to query. 286N/A // @return the value of the property. 286N/A }
// getProperty(String, String): Object 286N/A}
// class XMLGrammarPreparser