(SymbolTable)
/**
* Constructs a parser configuration using the specified symbol table and
* grammar pool.
*
* REVISIT:
* 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.
*/
public XPointerParserConfiguration(
SymbolTable symbolTable,
XMLGrammarPool grammarPool) {
this(symbolTable, grammarPool, null);
} // (SymbolTable,XMLGrammarPool)
/**
* Constructs a parser configuration using the specified symbol table,
* grammar pool, and parent settings.
*
* REVISIT:
* 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.
*/
public XPointerParserConfiguration(
SymbolTable symbolTable,
XMLGrammarPool grammarPool,
XMLComponentManager parentSettings) {
super(symbolTable, grammarPool, parentSettings);
// add default recognized properties
final String[] recognizedProperties =
{ XINCLUDE_HANDLER, NAMESPACE_CONTEXT };
addRecognizedProperties(recognizedProperties);
setProperty(NAMESPACE_CONTEXT, new XIncludeNamespaceSupport());
} // (SymbolTable,XMLGrammarPool)}
/** Configures the pipeline. */
protected void configurePipeline() {
super.configurePipeline();
// setup document pipeline
// add the XPointerSchema component to the list of recognized components
if (fXPointerSchemaComponent == null) {
if( (fXPointerSchemaComponent = (XPointerSchema)getProperty(XINCLUDE_HANDLER)) !=null){
addComponent(fXPointerSchemaComponent);
}
}
// insert before fSchemaValidator, if one exists.
XMLDocumentHandler next = null;
if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
// we don't have to worry about fSchemaValidator being null, since
// super.configurePipeline() instantiated it if the feature was set
next = fSchemaValidator.getDocumentHandler();
}
// Otherwise, insert after the last component in the pipeline
if (next != null) {
XMLDocumentSource prev = next.getDocumentSource();
if (prev != null) {
fXPointerSchemaComponent.setDocumentSource(prev);
prev.setDocumentHandler(fXPointerSchemaComponent);
}
next.setDocumentSource(fXPointerSchemaComponent);
fXPointerSchemaComponent.setDocumentHandler(next);
}
else {
next = fLastComponent.getDocumentHandler();
if (next != null) {
fXPointerSchemaComponent.setDocumentHandler(next);
next.setDocumentSource(fXPointerSchemaComponent);
}
fLastComponent.setDocumentHandler(fXPointerSchemaComponent);
fXPointerSchemaComponent.setDocumentSource(fLastComponent);
setDocumentHandler(fXPointerSchemaComponent);
}
} // configurePipeline()
}