• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java XMLGrammarPool类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SAXParser

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Constructs a SAX parser using the specified symbol table and
 * grammar pool.
 */
public SAXParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
    super(new 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:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:SAXParser.java


示例2: DOMParser

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

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

    fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES);

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DOMParser.java


示例3: XMLGrammarCachingConfiguration

import com.sun.org.apache.xerces.internal.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:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:XMLGrammarCachingConfiguration.java


示例4: XPointerParserConfiguration

import com.sun.org.apache.xerces.internal.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:SunburstApps,项目名称:OpenJSharp,代码行数:44,代码来源:XPointerParserConfiguration.java


示例5: createDOMParser

import com.sun.org.apache.xerces.internal.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:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:CachingParserPool.java


示例6: createSAXParser

import com.sun.org.apache.xerces.internal.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:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:CachingParserPool.java


示例7: XIncludeParserConfiguration

import com.sun.org.apache.xerces.internal.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:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:XIncludeParserConfiguration.java


示例8: XIncludeAwareParserConfiguration

import com.sun.org.apache.xerces.internal.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:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:XIncludeAwareParserConfiguration.java


示例9: DOMParserImpl

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Constructs a DOM Builder using the specified symbol table and
 * grammar pool.
 */
public DOMParserImpl (SymbolTable symbolTable, XMLGrammarPool grammarPool) {
    this (new XIncludeAwareParserConfiguration());
    fConfiguration.setProperty (
    Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY,
    symbolTable);
    fConfiguration.setProperty (
    Constants.XERCES_PROPERTY_PREFIX
    + Constants.XMLGRAMMAR_POOL_PROPERTY,
    grammarPool);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:DOMParserImpl.java


示例10: XMLDocumentParser

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Constructs a document parser using the specified symbol table and
 * grammar pool.
 */
public XMLDocumentParser(SymbolTable symbolTable,
                         XMLGrammarPool grammarPool) {
    super(new XIncludeAwareParserConfiguration());
    fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.SYMBOL_TABLE_PROPERTY, symbolTable);
    fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.XMLGRAMMAR_POOL_PROPERTY, grammarPool);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:XMLDocumentParser.java


示例11: IntegratedParserConfiguration

import com.sun.org.apache.xerces.internal.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 IntegratedParserConfiguration(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:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:IntegratedParserConfiguration.java


示例12: setProperty

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Sets the value of a property. This method is called by the component
 * manager any time after reset when a property changes value.
 * <p>
 * <strong>Note:</strong> Components should silently ignore properties
 * that do not affect the operation of the component.
 *
 * @param propertyId The property identifier.
 * @param value      The value of the property.
 *
 * @throws SAXNotRecognizedException The component should not throw
 *                                   this exception.
 * @throws SAXNotSupportedException The component should not throw
 *                                  this exception.
 */
public void setProperty(String propertyId, Object value)
        throws XMLConfigurationException {
    if (propertyId.equals(SYMBOL_TABLE)) {
        fSymbolTable = (SymbolTable)value;
        fDTDScanner.setProperty(propertyId, value);
        fEntityManager.setProperty(propertyId, value);
    }
    else if(propertyId.equals(ERROR_REPORTER)) {
        fErrorReporter = (XMLErrorReporter)value;
        // Add XML message formatter if there isn't one.
        if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
            XMLMessageFormatter xmft = new XMLMessageFormatter();
            fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
            fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
        }
        fDTDScanner.setProperty(propertyId, value);
        fEntityManager.setProperty(propertyId, value);
    }
    else if (propertyId.equals(ERROR_HANDLER)) {
        fErrorReporter.setProperty(propertyId, value);
    }
    else if (propertyId.equals(ENTITY_RESOLVER)) {
        fEntityResolver = (XMLEntityResolver)value;
        fEntityManager.setProperty(propertyId, value);
    }
    else if (propertyId.equals(LOCALE)) {
        setLocale((Locale) value);
    }
    else if(propertyId.equals(GRAMMAR_POOL)) {
        fGrammarPool = (XMLGrammarPool)value;
    }
    else {
        throw new XMLConfigurationException(Status.NOT_RECOGNIZED, propertyId);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:51,代码来源:XMLDTDLoader.java


示例13: setProperty

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
/**
 * Sets the state of a property.
 *
 * @param propertyId The property identifier.
 * @param state     The state of the property.
 *
 * @throws XMLConfigurationException Thrown when a property is not
 *                  recognized or cannot be set.
 */
public void setProperty(String propertyId,
        Object state) throws XMLConfigurationException {
    fSettingsChanged = true;
    fLoaderConfig.setProperty(propertyId, state);
    if (propertyId.equals(JAXP_SCHEMA_SOURCE)) {
        fJAXPSource = state;
        fJAXPProcessed = false;
    }
    else if (propertyId.equals(XMLGRAMMAR_POOL)) {
        fGrammarPool = (XMLGrammarPool)state;
    }
    else if (propertyId.equals(SCHEMA_LOCATION)) {
        fExternalSchemas = (String)state;
    }
    else if (propertyId.equals(SCHEMA_NONS_LOCATION)) {
        fExternalNoNSSchema = (String) state;
    }
    else if (propertyId.equals(LOCALE)) {
        setLocale((Locale) state);
    }
    else if (propertyId.equals(ENTITY_RESOLVER)) {
        fEntityManager.setProperty(ENTITY_RESOLVER, state);
    }
    else if (propertyId.equals(ERROR_REPORTER)) {
        fErrorReporter = (XMLErrorReporter)state;
        if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
            fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter());
        }
    }
    else if (propertyId.equals(XML_SECURITY_PROPERTY_MANAGER)) {
        XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)state;
        faccessExternalSchema = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:44,代码来源:XMLSchemaLoader.java


示例14: newSchema

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; //导入依赖的package包/类
public Schema newSchema(XMLGrammarPool pool) throws SAXException {
    // If the "use-grammar-pool-only" feature is set to true
    // prevent the application's grammar pool from being mutated
    // by wrapping it in a ReadOnlyGrammarPool.
    final AbstractXMLSchema schema = (fUseGrammarPoolOnly) ?
        new XMLSchema(new ReadOnlyGrammarPool(pool)) :
        new XMLSchema(pool, false);
    propagateFeatures(schema);
    return schema;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:XMLSchemaFactory.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BasicGraphUI类代码示例发布时间:2022-05-23
下一篇:
Java SEIInvokerTube类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap