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

Java XMLGrammarLoader类代码示例

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

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



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

示例1: registerPreparser

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
public boolean registerPreparser(String grammarType, XMLGrammarLoader loader) {
    if(loader == null) { // none specified!
        if(KNOWN_LOADERS.containsKey(grammarType)) {
            // got one; just instantiate it...
            String loaderName = (String)KNOWN_LOADERS.get(grammarType);
            try {
                XMLGrammarLoader gl = (XMLGrammarLoader)(ObjectFactory.newInstance(loaderName, true));
                fLoaders.put(grammarType, gl);
            } catch (Exception e) {
                return false;
            }
            return true;
        }
        return false;
    }
    // were given one
    fLoaders.put(grammarType, loader);
    return true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:XMLGrammarPreparser.java


示例2: preparseGrammar

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
/**
 * Parse a grammar from a location identified by an
 * XMLInputSource.
 * This method also adds this grammar to the XMLGrammarPool
 *
 * @param type The type of the grammar to be constructed
 * @param is The XMLInputSource containing this grammar's
 * information
 * <strong>If a URI is included in the systemId field, the parser will not expand this URI or make it
 * available to the EntityResolver</strong>
 * @return The newly created <code>Grammar</code>.
 * @exception XNIException thrown on an error in grammar
 * construction
 * @exception IOException thrown if an error is encountered
 * in reading the file
 */
public Grammar preparseGrammar(String type, XMLInputSource
            is) throws XNIException, IOException {
    if(fLoaders.containsKey(type)) {
        XMLGrammarLoader gl = (XMLGrammarLoader)fLoaders.get(type);
        // make sure gl's been set up with all the "basic" properties:
        gl.setProperty(SYMBOL_TABLE, fSymbolTable);
        gl.setProperty(ENTITY_RESOLVER, fEntityResolver);
        gl.setProperty(ERROR_REPORTER, fErrorReporter);
        // potentially, not all will support this one...
        if(fGrammarPool != null) {
            try {
                gl.setProperty(GRAMMAR_POOL, fGrammarPool);
            } catch(Exception e) {
                // too bad...
            }
        }
        return gl.loadGrammar(is);
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:XMLGrammarPreparser.java


示例3: setFeature

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
public void setFeature(String featureId, boolean value) {
    Enumeration loaders = fLoaders.elements();
    while(loaders.hasMoreElements()){
        XMLGrammarLoader gl = (XMLGrammarLoader)loaders.nextElement();
        try {
            gl.setFeature(featureId, value);
        } catch(Exception e) {
            // eat it up...
        }
    }
    // since our error reporter is a property we set later,
    // make sure features it understands are also set.
    if(featureId.equals(CONTINUE_AFTER_FATAL_ERROR)) {
        fErrorReporter.setFeature(CONTINUE_AFTER_FATAL_ERROR, value);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:XMLGrammarPreparser.java


示例4: preparseGrammar

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
/**
 * Parse a grammar from a location identified by an
 * XMLInputSource.
 * This method also adds this grammar to the XMLGrammarPool
 *
 * @param type The type of the grammar to be constructed
 * @param is The XMLInputSource containing this grammar's
 * information
 * <strong>If a URI is included in the systemId field, the parser will not expand this URI or make it
 * available to the EntityResolver</strong>
 * @return The newly created <code>Grammar</code>.
 * @exception XNIException thrown on an error in grammar
 * construction
 * @exception IOException thrown if an error is encountered
 * in reading the file
 */
public Grammar preparseGrammar(String type, XMLInputSource
            is) throws XNIException, IOException {
    if(fLoaders.containsKey(type)) {
        XMLGrammarLoader gl = fLoaders.get(type);
        // make sure gl's been set up with all the "basic" properties:
        gl.setProperty(SYMBOL_TABLE, fSymbolTable);
        gl.setProperty(ENTITY_RESOLVER, fEntityResolver);
        gl.setProperty(ERROR_REPORTER, fErrorReporter);
        // potentially, not all will support this one...
        if(fGrammarPool != null) {
            try {
                gl.setProperty(GRAMMAR_POOL, fGrammarPool);
            } catch(Exception e) {
                // too bad...
            }
        }
        return gl.loadGrammar(is);
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:37,代码来源:XMLGrammarPreparser.java


示例5: setProperty

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
public void setProperty(String propId, Object value) {
    Enumeration loaders = fLoaders.elements();
    while(loaders.hasMoreElements()){
        XMLGrammarLoader gl = (XMLGrammarLoader)loaders.nextElement();
        try {
            gl.setProperty(propId, value);
        } catch(Exception e) {
            // eat it up...
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:XMLGrammarPreparser.java


示例6: setFeature

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
public void setFeature(String featureId, boolean value) {
    for (Map.Entry<String, XMLGrammarLoader> entry : fLoaders.entrySet()) {
        try {
            XMLGrammarLoader gl = entry.getValue();
            gl.setFeature(featureId, value);
        } catch(Exception e) {
            // eat it up...
        }
    }
    // since our error reporter is a property we set later,
    // make sure features it understands are also set.
    if(featureId.equals(CONTINUE_AFTER_FATAL_ERROR)) {
        fErrorReporter.setFeature(CONTINUE_AFTER_FATAL_ERROR, value);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:XMLGrammarPreparser.java


示例7: setProperty

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
public void setProperty(String propId, Object value) {
    for (Map.Entry<String, XMLGrammarLoader> entry : fLoaders.entrySet()) {
        try {
            XMLGrammarLoader gl = entry.getValue();
            gl.setProperty(propId, value);
        } catch(Exception e) {
            // eat it up...
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:XMLGrammarPreparser.java


示例8: getLoader

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
public XMLGrammarLoader getLoader(String type) {
    return (XMLGrammarLoader)fLoaders.get(type);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:XMLGrammarPreparser.java


示例9: getFeature

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
public boolean getFeature(String type, String featureId) {
    XMLGrammarLoader gl = (XMLGrammarLoader)fLoaders.get(type);
    return gl.getFeature(featureId);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:XMLGrammarPreparser.java


示例10: getProperty

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
public Object getProperty(String type, String propertyId) {
    XMLGrammarLoader gl = (XMLGrammarLoader)fLoaders.get(type);
    return gl.getProperty(propertyId);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:XMLGrammarPreparser.java


示例11: getLoader

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
public XMLGrammarLoader getLoader(String type) {
    return fLoaders.get(type);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:XMLGrammarPreparser.java


示例12: getFeature

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
public boolean getFeature(String type, String featureId) {
    XMLGrammarLoader gl = fLoaders.get(type);
    return gl.getFeature(featureId);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:XMLGrammarPreparser.java


示例13: getProperty

import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; //导入依赖的package包/类
public Object getProperty(String type, String propertyId) {
    XMLGrammarLoader gl = fLoaders.get(type);
    return gl.getProperty(propertyId);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:XMLGrammarPreparser.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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