当前位置: 首页>>代码示例>>Java>>正文


Java XMLGrammarPool类代码示例

本文整理汇总了Java中org.apache.xerces.xni.grammars.XMLGrammarPool的典型用法代码示例。如果您正苦于以下问题:Java XMLGrammarPool类的具体用法?Java XMLGrammarPool怎么用?Java XMLGrammarPool使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XMLGrammarPool类属于org.apache.xerces.xni.grammars包,在下文中一共展示了XMLGrammarPool类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ValidatorImpl

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
ValidatorImpl(SymbolTable symbolTable, XMLGrammarPool grammarPool, PropertyMap properties) {
  this.symbolTable = symbolTable;
  XMLErrorHandler errorHandlerWrapper = new ErrorHandlerWrapper(properties.get(ValidateProperty.ERROR_HANDLER));
  components = new XMLComponent[] { errorReporter, schemaValidator, entityManager };
  for (int i = 0; i < components.length; i++) {
    addRecognizedFeatures(components[i].getRecognizedFeatures());
    addRecognizedProperties(components[i].getRecognizedProperties());
  }
  addRecognizedFeatures(recognizedFeatures);
  addRecognizedProperties(recognizedProperties);
  setFeature(Features.SCHEMA_AUGMENT_PSVI, false);
  setFeature(Features.SCHEMA_FULL_CHECKING, true);
  setFeature(Features.VALIDATION, true);
  setFeature(Features.SCHEMA_VALIDATION, true);
  setFeature(Features.ID_IDREF_CHECKING, true);
  setFeature(Features.IDC_CHECKING, true);
  setProperty(Properties.XMLGRAMMAR_POOL, grammarPool);
  setProperty(Properties.SYMBOL_TABLE, symbolTable);
  errorReporter.setDocumentLocator(this);
  setProperty(Properties.ERROR_REPORTER, errorReporter);
  setProperty(Properties.ERROR_HANDLER, errorHandlerWrapper);
  setProperty(Properties.VALIDATION_MANAGER, validationManager);
  setProperty(Properties.ENTITY_MANAGER, entityManager);
  setProperty(Properties.ENTITY_RESOLVER, this);
  reset();
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:27,代码来源:ValidatorImpl.java

示例2: SAXParserMMImpl

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Constructs a SAX parser using the specified symbol table and
 * grammar pool.
 */
public SAXParserMMImpl(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
    // modified by rsun 11/06/03 - use XML11ConfigurationMMImpl instead
    // of XML11ConfigurationImpl
    super((XMLParserConfiguration)ObjectFactory.createObject(
        "org.apache.xerces.xni.parser.XMLParserConfiguration",
        "org.apache.xerces.parsers.XML11ConfigurationMMImpl"
        ));

    // set features
    fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES);
    fConfiguration.setFeature(NOTIFY_BUILTIN_REFS, true);

    // set properties
    fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES);
    if (symbolTable != null) {
        fConfiguration.setProperty(SYMBOL_TABLE, symbolTable);
    }
    if (grammarPool != null) {
        fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool);
    }

}
 
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:27,代码来源:SAXParserMMImpl.java

示例3: SAXParser

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Constructs a SAX parser using the specified symbol table and
 * grammar pool.
 */
public SAXParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
    super((XMLParserConfiguration)ObjectFactory.createObject(
        "org.apache.xerces.xni.parser.XMLParserConfiguration",
        "org.apache.xerces.parsers.XIncludeAwareParserConfiguration"
        ));

    // set features
    fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES);
    fConfiguration.setFeature(NOTIFY_BUILTIN_REFS, true);

    // set properties
    fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES);
    if (symbolTable != null) {
        fConfiguration.setProperty(SYMBOL_TABLE, symbolTable);
    }
    if (grammarPool != null) {
        fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool);
    }

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:25,代码来源:SAXParser.java

示例4: DOMParser

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Constructs a DOM parser using the specified symbol table and
 * grammar pool.
 */
public DOMParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
    super((XMLParserConfiguration)ObjectFactory.createObject(
        "org.apache.xerces.xni.parser.XMLParserConfiguration",
        "org.apache.xerces.parsers.XIncludeAwareParserConfiguration"
        ));

    // set properties
    fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES);
    if (symbolTable != null) {
        fConfiguration.setProperty(SYMBOL_TABLE, symbolTable);
    }
    if (grammarPool != null) {
        fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool);
    }

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:21,代码来源:DOMParser.java

示例5: XMLGrammarCachingConfiguration

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * 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.
 */
public XMLGrammarCachingConfiguration(SymbolTable symbolTable,
                                   XMLGrammarPool grammarPool,
                                   XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    // REVISIT:  may need to add some features/properties
    // specific to this configuration at some point...

    // add default recognized features
    // set state for default features
    // add default recognized properties
    // create and register missing components
    fSchemaLoader = new XMLSchemaLoader(fSymbolTable);
    fSchemaLoader.setProperty(XMLGRAMMAR_POOL, fGrammarPool);

    // and set up the DTD loader too:
    fDTDLoader = new XMLDTDLoader(fSymbolTable, fGrammarPool);
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:31,代码来源:XMLGrammarCachingConfiguration.java

示例6: SchemaImpl

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
SchemaImpl(SymbolTable symbolTable,
           XMLGrammarPool grammarPool,
           PropertyMap properties,
           PropertyId<?>[] supportedPropertyIds) {
  super(properties, supportedPropertyIds);
  this.symbolTable = symbolTable;
  this.grammarPool = grammarPool;
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:9,代码来源:SchemaImpl.java

示例7: createSchema

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
public Schema createSchema(SAXSource source, PropertyMap properties)
        throws IOException, SAXException, IncorrectSchemaException {
  SymbolTable symbolTable = new SymbolTable();
  XMLGrammarPreparser preparser = new XMLGrammarPreparser(symbolTable);
  XMLGrammarPool grammarPool = new XMLGrammarPoolImpl();
  preparser.registerPreparser(XMLGrammarDescription.XML_SCHEMA, null);
  preparser.setGrammarPool(grammarPool);
  ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
  SAXXMLErrorHandler xeh = new SAXXMLErrorHandler(eh);
  preparser.setErrorHandler(xeh);
  EntityResolver er = properties.get(ValidateProperty.ENTITY_RESOLVER);
  if (er != null)
    preparser.setEntityResolver(new EntityResolverWrapper(er));
  try {
    preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA, toXMLInputSource(source.getInputSource()));
    Name attributeOwner = properties.get(WrapProperty.ATTRIBUTE_OWNER);
    if (attributeOwner != null) {
      Reader r = new StringReader(createWrapper(attributeOwner));
 	preparser.preparseGrammar(XMLGrammarDescription.XML_SCHEMA,
                                new XMLInputSource(null, null, null, r, null));
    }
  }
  catch (XNIException e) {
    throw ValidatorImpl.toSAXException(e);
  }
  if (xeh.getHadError())
    throw new IncorrectSchemaException();
  return new SchemaImpl(new SynchronizedSymbolTable(symbolTable),
                        new CachingParserPool.SynchronizedGrammarPool(grammarPool),
                        properties,
                        supportedPropertyIds);
}
 
开发者ID:relaxng,项目名称:jing-trang,代码行数:33,代码来源:SchemaReaderImpl.java

示例8: IntegratedParserConfigurationMMImpl

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * 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.
 */
public IntegratedParserConfigurationMMImpl(SymbolTable symbolTable,
                                     XMLGrammarPool grammarPool,
                                     XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);
    
    // create components
    fNonNSScanner = new XMLDocumentScannerImpl();
    fNonNSDTDValidator = new XMLDTDValidator();

    // add components
    addComponent((XMLComponent)fNonNSScanner);
    addComponent((XMLComponent)fNonNSDTDValidator);

}
 
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:27,代码来源:IntegratedParserConfigurationMMImpl.java

示例9: XPointerParserConfiguration

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 *
 * @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);

    fXIncludeHandler = new XIncludeHandler();
    addCommonComponent(fXIncludeHandler);
    
    fXPointerHandler = new XPointerHandler();
    addCommonComponent(fXPointerHandler);
    
    final String[] recognizedFeatures = {
        ALLOW_UE_AND_NOTATION_EVENTS,
        XINCLUDE_FIXUP_BASE_URIS,
        XINCLUDE_FIXUP_LANGUAGE
    };
    addRecognizedFeatures(recognizedFeatures);

    // add default recognized properties
    final String[] recognizedProperties =
        { XINCLUDE_HANDLER, XPOINTER_HANDLER, NAMESPACE_CONTEXT };
    addRecognizedProperties(recognizedProperties);
    
    setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true);
    setFeature(XINCLUDE_FIXUP_BASE_URIS, true);
    setFeature(XINCLUDE_FIXUP_LANGUAGE, true);
    
    setProperty(XINCLUDE_HANDLER, fXIncludeHandler);
    setProperty(XPOINTER_HANDLER, fXPointerHandler);
    setProperty(NAMESPACE_CONTEXT, new XIncludeNamespaceSupport());
    
        
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:44,代码来源:XPointerParserConfiguration.java

示例10: initGrammarPool

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
private void initGrammarPool(ASModelImpl currModel, XMLGrammarPool grammarPool) {
    // put all the grammars in fAbstractSchema into the grammar pool.
    // grammarPool must never be null!
    Grammar[] grammars = new Grammar[1];
    if ((grammars[0] = (Grammar)currModel.getGrammar()) != null) {
        grammarPool.cacheGrammars(grammars[0].getGrammarDescription().getGrammarType(), grammars);
    }
    Vector modelStore = currModel.getInternalASModels();
    for (int i = 0; i < modelStore.size(); i++) {
        initGrammarPool((ASModelImpl)modelStore.elementAt(i), grammarPool);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:13,代码来源:DOMASBuilderImpl.java

示例11: createDOMParser

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/** Creates a new DOM parser. */
public DOMParser createDOMParser() {
    SymbolTable symbolTable = fShadowSymbolTable
                            ? new ShadowedSymbolTable(fSynchronizedSymbolTable)
                            : fSynchronizedSymbolTable;
    XMLGrammarPool grammarPool = fShadowGrammarPool
                            ? new ShadowedGrammarPool(fSynchronizedGrammarPool)
                            : fSynchronizedGrammarPool;
    return new DOMParser(symbolTable, grammarPool);
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:11,代码来源:CachingParserPool.java

示例12: createSAXParser

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/** Creates a new SAX parser. */
public SAXParser createSAXParser() {
    SymbolTable symbolTable = fShadowSymbolTable
                            ? new ShadowedSymbolTable(fSynchronizedSymbolTable)
                            : fSynchronizedSymbolTable;
    XMLGrammarPool grammarPool = fShadowGrammarPool
                            ? new ShadowedGrammarPool(fSynchronizedGrammarPool)
                            : fSynchronizedGrammarPool;
    return new SAXParser(symbolTable, grammarPool);
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:11,代码来源:CachingParserPool.java

示例13: setGrammarPool

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Sets the grammar pool.
 *
 * @param grammarPool The new grammar pool.
 */
public void setGrammarPool(XMLGrammarPool grammarPool) {
    if (fGrammarPool != grammarPool) {
        // Overflow. We actually need to reset the 
        // modCount on every XMLGrammarLoaderContainer.
        if (++fModCount < 0) {
            clearModCounts();
        }
        fGrammarPool = grammarPool;
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:16,代码来源:XMLGrammarPreparser.java

示例14: XIncludeParserConfiguration

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XIncludeParserConfiguration(
    SymbolTable symbolTable,
    XMLGrammarPool grammarPool,
    XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);

    fXIncludeHandler = new XIncludeHandler();
    addCommonComponent(fXIncludeHandler);
    
    final String[] recognizedFeatures = {
        ALLOW_UE_AND_NOTATION_EVENTS,
        XINCLUDE_FIXUP_BASE_URIS,
        XINCLUDE_FIXUP_LANGUAGE
    };
    addRecognizedFeatures(recognizedFeatures);

    // add default recognized properties
    final String[] recognizedProperties =
        { XINCLUDE_HANDLER, NAMESPACE_CONTEXT };
    addRecognizedProperties(recognizedProperties);
    
    setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true);
    setFeature(XINCLUDE_FIXUP_BASE_URIS, true);
    setFeature(XINCLUDE_FIXUP_LANGUAGE, true);
    
    setProperty(XINCLUDE_HANDLER, fXIncludeHandler);
    setProperty(NAMESPACE_CONTEXT, new XIncludeNamespaceSupport());
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:38,代码来源:XIncludeParserConfiguration.java

示例15: XIncludeAwareParserConfiguration

import org.apache.xerces.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Constructs a parser configuration using the specified symbol table,
 * grammar pool, and parent settings.
 * <p>
 *
 * @param symbolTable    The symbol table to use.
 * @param grammarPool    The grammar pool to use.
 * @param parentSettings The parent settings.
 */
public XIncludeAwareParserConfiguration(
        SymbolTable symbolTable,
        XMLGrammarPool grammarPool,
        XMLComponentManager parentSettings) {
    super(symbolTable, grammarPool, parentSettings);
    
    final String[] recognizedFeatures = {
            ALLOW_UE_AND_NOTATION_EVENTS,
            XINCLUDE_FIXUP_BASE_URIS,
            XINCLUDE_FIXUP_LANGUAGE
    };
    addRecognizedFeatures(recognizedFeatures);
    
    // add default recognized properties
    final String[] recognizedProperties =
    { XINCLUDE_HANDLER, NAMESPACE_CONTEXT };
    addRecognizedProperties(recognizedProperties);
    
    setFeature(ALLOW_UE_AND_NOTATION_EVENTS, true);
    setFeature(XINCLUDE_FIXUP_BASE_URIS, true);
    setFeature(XINCLUDE_FIXUP_LANGUAGE, true);
    
    fNonXIncludeNSContext = new NamespaceSupport();
    fCurrentNSContext = fNonXIncludeNSContext;
    setProperty(NAMESPACE_CONTEXT, fNonXIncludeNSContext);
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:36,代码来源:XIncludeAwareParserConfiguration.java


注:本文中的org.apache.xerces.xni.grammars.XMLGrammarPool类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。