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


Java DOMUtil.getAttribute方法代码示例

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


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

示例1: processWsdl

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
private void processWsdl(Path filePath, File workDir, File outDir) throws MojoExecutionException, MojoFailureException {
	Document dom = DOMUtil.parseFile(filePath.toFile());
	
	if (translateSchemaLocation) {
		Element rootElement = DOMUtil.getFirstChildElement(dom);
		List<Element> importElements = DOMUtil.getChildElements(rootElement, DOMUtil.WSDL_IMPORT_ELEMENT);
		for(Element importElement: importElements) {
			String namespace = DOMUtil.getAttribute(importElement, DOMUtil.WSDL_ATTR_NAMESPACE);
			String schemaLocation;
			try {
				schemaLocation = resolveSchemaLocation(namespace, filePath, workDir);
			} catch (IOException e) {
				throw new MojoExecutionException("Error resolving namespace "+namespace+" in file "+filePath+": "+ e.getMessage(), e);
			}
			importElement.setAttribute(DOMUtil.WSDL_ATTR_LOCATION.getLocalPart(),
					schemaLocation);
		}
		
		List<Element> typesElements = DOMUtil.getChildElements(rootElement, DOMUtil.WSDL_TYPES_ELEMENT);
		for(Element typesElement: typesElements) {
			processXsdElement(DOMUtil.getFirstChildElement(typesElement),filePath,workDir,outDir);
		}
	}
	
	serializeXml(dom, filePath, workDir, outDir);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:27,代码来源:SchemaDistMojo.java

示例2: fetchBasicInfoFromSchema

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
private void fetchBasicInfoFromSchema() throws SchemaException {
	Element rootElement = getDomElement();
	if (DOMUtil.XSD_SCHEMA_ELEMENT.equals(DOMUtil.getQName(rootElement))) {
		String targetNamespace = DOMUtil.getAttribute(rootElement,DOMUtil.XSD_ATTR_TARGET_NAMESPACE);
		if (targetNamespace != null) {
			this.namespace = targetNamespace;
		} else {
			throw new SchemaException("Schema "+sourceDescription+" does not have targetNamespace attribute");
		}
	} else {
		throw new SchemaException("Schema "+sourceDescription+" does not start with xsd:schema element");
	}
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:14,代码来源:SchemaDescription.java

示例3: initSchema

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
private void initSchema(Element xsdSchema) throws SchemaException {
	String targetNamespace = DOMUtil.getAttribute(xsdSchema, DOMUtil.XSD_ATTR_TARGET_NAMESPACE);
	if (StringUtils.isEmpty(targetNamespace)) {
		throw new SchemaException("Schema does not have targetNamespace specification");
	}
	schema.setNamespace(targetNamespace);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:8,代码来源:DomToSchemaProcessor.java


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