FileDocCategorySizeDatePackage
XPointerParserConfiguration.javaAPI DocJava SE 5 API7764Fri Aug 26 14:55:54 BST 2005com.sun.org.apache.xerces.internal.parsers

XPointerParserConfiguration

public class XPointerParserConfiguration extends XML11Configuration
author
Arun Yadav, Sun Microsystem.

Fields Summary
private com.sun.org.apache.xerces.internal.xinclude.XPointerSchema
fXPointerSchemaComponent
protected static final String
XINCLUDE_HANDLER
Property identifier: error reporter.
protected static final String
NAMESPACE_CONTEXT
Property identifier: error reporter.
Constructors Summary
public XPointerParserConfiguration()
Default constructor.

    
       
      
        this(null, null, null);
        //this(null, new XMLGrammarPoolImpl(), null);
    
public XPointerParserConfiguration(SymbolTable symbolTable)
Constructs a parser configuration using the specified symbol table.

param
symbolTable The symbol table to use.

        this(symbolTable, null, null);
        //this(symbolTable, new XMLGrammarPoolImpl(), null);
    
public XPointerParserConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool)
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.

        this(symbolTable, grammarPool, null);
    
public XPointerParserConfiguration(SymbolTable symbolTable, XMLGrammarPool grammarPool, XMLComponentManager parentSettings)
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.

        super(symbolTable, grammarPool, parentSettings);
        
        // add default recognized properties
        final String[] recognizedProperties =
        { XINCLUDE_HANDLER, NAMESPACE_CONTEXT };
        
        addRecognizedProperties(recognizedProperties);
        setProperty(NAMESPACE_CONTEXT, new XIncludeNamespaceSupport());
        
    
Methods Summary
protected voidconfigurePipeline()
Configures the pipeline.

        
        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);
        }