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


Java DOMUtil.parse方法代码示例

本文整理汇总了Java中com.evolveum.midpoint.util.DOMUtil.parse方法的典型用法代码示例。如果您正苦于以下问题:Java DOMUtil.parse方法的具体用法?Java DOMUtil.parse怎么用?Java DOMUtil.parse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.evolveum.midpoint.util.DOMUtil的用法示例。


在下文中一共展示了DOMUtil.parse方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: read

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
@NotNull
@Override
public RootXNode read(@NotNull ParserSource source, @NotNull ParsingContext parsingContext) throws SchemaException, IOException {
	if (source instanceof ParserElementSource) {
		return read(((ParserElementSource) source).getElement());
	}

	InputStream is = source.getInputStream();
	try {
		Document document = DOMUtil.parse(is);
		return read(document);
	} finally {
		if (source.closeStreamAfterParsing()) {
			IOUtils.closeQuietly(is);
		}
	}
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:18,代码来源:DomLexicalProcessor.java

示例2: readObjects

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
@NotNull
@Override
public List<RootXNode> readObjects(@NotNull ParserSource source, @NotNull ParsingContext parsingContext) throws SchemaException, IOException {
	InputStream is = source.getInputStream();
	try {
		Document document = DOMUtil.parse(is);
		return readObjects(document);
	} finally {
		if (source.closeStreamAfterParsing()) {
			IOUtils.closeQuietly(is);
		}
	}
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:14,代码来源:DomLexicalProcessor.java

示例3: parseWsdlResource

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
public static List<SchemaDescription> parseWsdlResource(final String resourcePath) throws SchemaException {
    List<SchemaDescription> schemaDescriptions = new ArrayList<>();

    InputStream inputStream = SchemaRegistry.class.getClassLoader().getResourceAsStream(resourcePath);
    if (inputStream == null) {
        throw new IllegalStateException("Cannot fetch system resource for schema " + resourcePath);
    }
    Node node;
    try {
        node = DOMUtil.parse(inputStream);
    } catch (IOException e) {
        throw new SchemaException("Cannot parse schema from system resource " + resourcePath, e);
    }
    Element rootElement = node instanceof Element ? (Element)node : DOMUtil.getFirstChildElement(node);
    QName rootElementQName = DOMUtil.getQName(rootElement);
    if (WSDLConstants.QNAME_DEFINITIONS.equals(rootElementQName)) {
        Element types = DOMUtil.getChildElement(rootElement, WSDLConstants.QNAME_TYPES);
        if (types == null) {
            LOGGER.warn("No <types> section in WSDL document in system resource " + resourcePath);
            return schemaDescriptions;
        }
        List<Element> schemaElements = DOMUtil.getChildElements(types, DOMUtil.XSD_SCHEMA_ELEMENT);
        if (schemaElements.isEmpty()) {
            LOGGER.warn("No schemas in <types> section in WSDL document in system resource " + resourcePath);
            return schemaDescriptions;
        }
        int number = 1;
        for (Element schemaElement : schemaElements) {
            SchemaDescription desc = new SchemaDescription("schema #" + (number++) + " in system resource " + resourcePath);
            desc.node = schemaElement;
            desc.fetchBasicInfoFromSchema();
            schemaDescriptions.add(desc);
            LOGGER.trace("Schema registered from {}", desc.getSourceDescription());
        }
        return schemaDescriptions;
    } else {
        throw new SchemaException("WSDL system resource "+resourcePath+" does not start with wsdl:definitions element");
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:40,代码来源:SchemaDescription.java

示例4: parseFromInputStream

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
private void parseFromInputStream() throws SchemaException {
	InputStream inputStream = streamable.openInputStream();
	try {
		node = DOMUtil.parse(inputStream);
	} catch (IOException e) {
		throw new SchemaException("Cannot parse schema from " + sourceDescription, e);
	}
	fetchBasicInfoFromSchema();
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:10,代码来源:SchemaDescription.java


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