/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2001, 2002,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is configuration uses a scanner that integrates both scanning of the document
* and binding namespaces.
*
* If namespace feature is turned on, the pipeline is constructured with the
* following components:
* XMLNSDocumentScannerImpl -> XMLNSDTDValidator -> (optional) XMLSchemaValidator
*
* If the namespace feature is turned off the default document scanner implementation
* is used (XMLDocumentScannerImpl).
* <p>
* In addition to the features and properties recognized by the base
* parser configuration, this class recognizes these additional
* features and properties:
* <ul>
* <li>Features
* <ul>
* </ul>
* <li>Properties
* <ul>
* </ul>
* </ul>
*
* @author Elena Litani, IBM
*
*/
public class IntegratedParserConfiguration
extends StandardParserConfiguration {
//
// REVISIT: should this configuration depend on the others
//
/** Document scanner that does namespace binding. */
/** Default Xerces implementation of scanner */
/** DTD Validator that does not bind namespaces */
//
// Constructors
//
/** Default constructor. */
public IntegratedParserConfiguration() {
} // <init>()
/**
* Constructs a parser configuration using the specified symbol table.
*
* @param symbolTable The symbol table to use.
*/
} // <init>(SymbolTable)
/**
* Constructs a parser configuration using the specified symbol table and
* grammar pool.
* <p>
* <strong>REVISIT:</strong>
* Grammar pool will be updated when the new validation engine is
* implemented.
*
* @param symbolTable The symbol table to use.
* @param grammarPool The grammar pool to use.
*/
} // <init>(SymbolTable,XMLGrammarPool)
/**
* Constructs a parser configuration using the specified symbol table,
* grammar pool, and parent settings.
* <p>
* <strong>REVISIT:</strong>
* Grammar pool will be updated when the new validation engine is
* implemented.
*
* @param symbolTable The symbol table to use.
* @param grammarPool The grammar pool to use.
* @param parentSettings The parent settings.
*/
// create components
fNonNSScanner = new XMLDocumentScannerImpl();
fNonNSDTDValidator = new XMLDTDValidator();
// add components
} // <init>(SymbolTable,XMLGrammarPool)
/** Configures the pipeline. */
protected void configurePipeline() {
// use XML 1.0 datatype library
// setup DTD pipeline
// setup document pipeline
if (fDTDValidator != null) {
if (fDocumentHandler != null) {
}
}
else {
if (fDocumentHandler != null) {
}
}
}
else {
if (fNonNSDTDValidator != null) {
if (fDocumentHandler != null) {
}
}
else {
if (fDocumentHandler != null) {
}
}
}
// setup document pipeline
// If schema validator was not in the pipeline insert it.
if (fSchemaValidator == null) {
fSchemaValidator = new XMLSchemaValidator();
// add schema component
// add schema message formatter
}
}
if (fDocumentHandler != null) {
}
}
} // configurePipeline()
/** Create a document scanner: this scanner performs namespace binding
*/
return fNamespaceScanner;
} // createDocumentScanner():XMLDocumentScanner
/** Create a DTD validator: this validator performs namespace binding.
*/
return new XMLNSDTDValidator();
} // createDTDValidator():XMLDTDValidator
} // class IntegratedParserConfiguration