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


Java XMLParser类代码示例

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


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

示例1: ParserContext

import com.sun.xml.internal.xsom.parser.XMLParser; //导入依赖的package包/类
public ParserContext( XSOMParser owner, XMLParser parser ) {
    this.owner = owner;
    this.parser = parser;

    try {
        parse(new InputSource(ParserContext.class.getResource("datatypes.xsd").toExternalForm()));

        SchemaImpl xs = (SchemaImpl)
            schemaSet.getSchema("http://www.w3.org/2001/XMLSchema");
        xs.addSimpleType(schemaSet.anySimpleType,true);
        xs.addComplexType(schemaSet.anyType,true);
    } catch( SAXException e ) {
        // this must be a bug of XSOM
        if(e.getException()!=null)
            e.getException().printStackTrace();
        else
            e.printStackTrace();
        throw new InternalError();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:ParserContext.java

示例2: ParserContext

import com.sun.xml.internal.xsom.parser.XMLParser; //导入依赖的package包/类
public ParserContext( XSOMParser owner, XMLParser parser ) {
    this.owner = owner;
    this.parser = parser;

    try (InputStream is = ParserContext.class.getResourceAsStream("datatypes.xsd")) {
        InputSource source = new InputSource(is);
        source.setSystemId("datatypes.xsd");
        parse(source);

        SchemaImpl xs = (SchemaImpl)
                schemaSet.getSchema("http://www.w3.org/2001/XMLSchema");
        xs.addSimpleType(schemaSet.anySimpleType,true);
        xs.addComplexType(schemaSet.anyType,true);
    } catch( SAXException | IOException e ) {
        // this must be a bug of XSOM
        throw new InternalError(e.getMessage());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:ParserContext.java

示例3: createXSOMParser

import com.sun.xml.internal.xsom.parser.XMLParser; //导入依赖的package包/类
/**
 * Potentially problematic - make sure the parser instance passed is initialized
 * with proper security feature.
 *
 * @param parser
 * @return
 */
public XSOMParser createXSOMParser(XMLParser parser) {
    // set up other parameters to XSOMParser
    XSOMParser reader = new XSOMParser(new XMLSchemaParser(parser));
    reader.setAnnotationParser(new AnnotationParserFactoryImpl(opt));
    reader.setErrorHandler(errorReceiver);
    reader.setEntityResolver(opt.entityResolver);
    return reader;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:ModelLoader.java

示例4: createXSOMParser

import com.sun.xml.internal.xsom.parser.XMLParser; //导入依赖的package包/类
public XSOMParser createXSOMParser(XMLParser parser) {
    // set up other parameters to XSOMParser
    XSOMParser reader = new XSOMParser(new XMLSchemaParser(parser));
    reader.setAnnotationParser(new AnnotationParserFactoryImpl(opt));
    reader.setErrorHandler(errorReceiver);
    reader.setEntityResolver(opt.entityResolver);
    return reader;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:9,代码来源:ModelLoader.java

示例5: SAXParserFactoryAdaptor

import com.sun.xml.internal.xsom.parser.XMLParser; //导入依赖的package包/类
public SAXParserFactoryAdaptor( XMLParser _parser ) {
    this.parser = _parser;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:SAXParserFactoryAdaptor.java

示例6: DOMForestParser

import com.sun.xml.internal.xsom.parser.XMLParser; //导入依赖的package包/类
/**
 * @param fallbackParser This parser will be used when DOMForestParser needs to parse
 *                       documents that are not in the forest.
 */
public DOMForestParser(DOMForest forest, XMLParser fallbackParser) {
    this.forest = forest;
    this.scanner = new DOMForestScanner(forest);
    this.fallbackParser = fallbackParser;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:DOMForestParser.java

示例7: DOMForestParser

import com.sun.xml.internal.xsom.parser.XMLParser; //导入依赖的package包/类
/**
 * @param fallbackParser
 *      This parser will be used when DOMForestParser needs to parse
 *      documents that are not in the forest.
 */
DOMForestParser( DOMForest forest, XMLParser fallbackParser ) {
    this.forest = forest;
    this.scanner = new DOMForestScanner(forest);
    this.fallbackParser = fallbackParser;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:DOMForestParser.java

示例8: XMLSchemaParser

import com.sun.xml.internal.xsom.parser.XMLParser; //导入依赖的package包/类
private XMLSchemaParser(XMLParser baseParser) {
    this.baseParser = baseParser;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:ModelLoader.java


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