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


Java Nodes.hasAny方法代码示例

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


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

示例1: Note

import nu.xom.Nodes; //导入方法依赖的package包/类
public Note(Nodes title, Nodes content, Nodes tags) {
	super();
	if (title.isEmpty()) {
		throw new IllegalArgumentException();
	}
	this.title = extractString(title);
	if (content.isEmpty()) {
		this.content = "";
	} else {
		this.content = extractContent(content);
	}
	for (Node tag : tags) {
		Nodes tagValue = tag.query("./text()");
		if (!tagValue.hasAny()) {
			continue;
		}
		String tagString = extractContent(tagValue);
		this.tags.add(tagString);
	}
}
 
开发者ID:MathiasRenner,项目名称:evernote_to_markdown,代码行数:21,代码来源:Note.java

示例2: findXsdType

import nu.xom.Nodes; //导入方法依赖的package包/类
private Node findXsdType(String typeQName, Node variable) {
	String variableTypeNamespaceURI = variable.getDocument()
			.getRootElement()
			.getNamespaceURI(PrefixHelper.getPrefix(typeQName));
	String xsdTypeName = PrefixHelper.removePrefix(typeQName);
	Node xsdType = null;

	for (Node node : fileHandler.getSchemas()) {
		if (new NodeHelper(node)
				.hasTargetNamespace(variableTypeNamespaceURI)) {
			Nodes xsdTypes = node.getDocument().query(
					"//*[@name='" + xsdTypeName + "']", CONTEXT);
			if (xsdTypes.hasAny()) {
				xsdType = xsdTypes.get(0);
				break;
			}
		}
	}
	return xsdType;
}
 
开发者ID:sjas,项目名称:isabel,代码行数:21,代码来源:SA00048Validator.java

示例3: getAttributeNode

import nu.xom.Nodes; //导入方法依赖的package包/类
public Attribute getAttributeNode(String name) {
	Nodes attributes = node.query("@" + name);

	if (attributes.hasAny()) {
		return (Attribute) attributes.get(0);
	}
	return null;
}
 
开发者ID:sjas,项目名称:isabel,代码行数:9,代码来源:NodeHelper.java

示例4: validate

import nu.xom.Nodes; //导入方法依赖的package包/类
@Override
public void validate() {

	Nodes variables = fileHandler.getBpel().getDocument()
			.query("//bpel:variable", CONTEXT);

	for (Node variable : variables) {

		Nodes messageTypeSet = variable.query("@messageType", CONTEXT);
		Nodes typeSet = variable.query("@type", CONTEXT);
		Nodes elementSet = variable.query("@element", CONTEXT);

		if (messageTypeSet.isEmpty() && typeSet.isEmpty() && elementSet.isEmpty()) {
			addViolation(variable, MESSAGE_TYPE_OR_TYPE_OR_ELEMENT_MISSING);
		} else if (messageTypeSet.hasAny() && typeSet.hasAny()) {
			addViolation(variable, MESSAGE_TYPE_AND_TYPE);
		} else if (messageTypeSet.hasAny() && elementSet.hasAny()) {
			addViolation(variable, MESSAGE_TYPE_AND_ELEMENT);
		} else if (typeSet.hasAny() && elementSet.hasAny()) {
			addViolation(variable, TYPE_AND_ELEMENT);
		} else if (messageTypeSet.hasAny() && typeSet.hasAny() && elementSet.hasAny()) {
			addViolation(variable, MESSAGE_TYPE_AND_TYPE_AND_ELEMENT);
		}
	}
}
 
开发者ID:sjas,项目名称:isabel,代码行数:26,代码来源:SA00025Validator.java

示例5: hasToPartCorrespondingMessagePart

import nu.xom.Nodes; //导入方法依赖的package包/类
private boolean hasToPartCorrespondingMessagePart(Node toPart, Node message) {
	Nodes messageParts = message.query("wsdl:part", CONTEXT);

	if (messageParts.hasAny()) {
		String partAttribute = new NodeHelper(toPart).getAttribute("part");

		for (Node part : messageParts) {
			String partName = new NodeHelper(part).getAttribute("name");

			if (partName.equals(partAttribute)) {
				return true;
			}

		}
	}

	return false;
}
 
开发者ID:sjas,项目名称:isabel,代码行数:19,代码来源:SA00054Validator.java

示例6: hasFromPartCorrespondingMessagePart

import nu.xom.Nodes; //导入方法依赖的package包/类
private boolean hasFromPartCorrespondingMessagePart(Node fromPart,
                                                    Node message) {
	Nodes messageParts = message.query("wsdl:part", CONTEXT);

	if (messageParts.hasAny()) {
		String partAttribute = new NodeHelper(fromPart).getAttribute("part");

		for (Node part : messageParts) {
			String partName = new NodeHelper(part).getAttribute("name");

			if (partName.equals(partAttribute)) {
				return true;
			}

		}
	}
	return false;
}
 
开发者ID:sjas,项目名称:isabel,代码行数:19,代码来源:SA00053Validator.java

示例7: correspondingVariable

import nu.xom.Nodes; //导入方法依赖的package包/类
private Node correspondingVariable(Node invokeActivity, String variableName) {
	Nodes variable = invokeActivity.query(
			"(ancestor::*/bpel:variables/bpel:variable[@name='"
					+ variableName + "'])[last()]", CONTEXT);

	if (variable.hasAny())
		return variable.get(0);
	else
		return null;
}
 
开发者ID:sjas,项目名称:isabel,代码行数:11,代码来源:SA00048Validator.java

示例8: validate

import nu.xom.Nodes; //导入方法依赖的package包/类
@Override
public void validate() {

	Nodes invokes = fileHandler.getBpel().getDocument()
			.query("//bpel:invoke", CONTEXT);

	for (Node invoke : invokes) {

		Nodes toPartsSet = invoke.query("bpel:toParts", CONTEXT);
		Nodes inputVariableSet = invoke.query("@inputVariable", CONTEXT);
		if (toPartsSet.hasAny() && inputVariableSet.hasAny()) {
			addViolation(invoke);
		}
	}
}
 
开发者ID:sjas,项目名称:isabel,代码行数:16,代码来源:SA00051Validator.java

示例9: hasToPartForEveryMessagePart

import nu.xom.Nodes; //导入方法依赖的package包/类
private void hasToPartForEveryMessagePart(String xPathOutgoingOperation) {
	Nodes outgoingOperations = fileHandler.getBpel().getDocument()
			.query(xPathOutgoingOperation, CONTEXT);

	for (Node outgoingOperation : outgoingOperations) {
		try {
			Nodes toParts = outgoingOperation.query(
					"bpel:toParts/bpel:toPart", CONTEXT);

			Node message;
			if ("invoke".equals(PrefixHelper
					.removePrefix(xPathOutgoingOperation))) {
				message = navigator
						.getCorrespondingIncomingMessage(outgoingOperation);
			} else {
				message = navigator
						.getCorrespondingOutgoingMessage(outgoingOperation);
			}
			Nodes messageParts = message.query("wsdl:part", CONTEXT);

			if (toParts.hasAny()) {
				for (Node part : messageParts) {

					if (!hasMessagePartCorrespondingToPart(part, toParts)) {
						addViolation(outgoingOperation);
					}
				}
			}
		} catch (NavigationException e) {
			// message does not exist, outgoingOperation is not validatable
			// => valid
		}

	}
}
 
开发者ID:sjas,项目名称:isabel,代码行数:36,代码来源:SA00050Validator.java

示例10: hasPartForEveryFromPart

import nu.xom.Nodes; //导入方法依赖的package包/类
private void hasPartForEveryFromPart(String xPathOutgoingOperation) {
	Nodes incomingOperations = fileHandler.getBpel().getDocument()
			.query(xPathOutgoingOperation, CONTEXT);

	for (Node incomingOperation : incomingOperations) {
		try {
			Node message;
			if ("invoke".equals(PrefixHelper
					.removePrefix(xPathOutgoingOperation))) {
				message = navigator
						.getCorrespondingOutgoingMessage(incomingOperation);
			} else {
				message = navigator
						.getCorrespondingIncomingMessage(incomingOperation);
			}

			Nodes fromParts = incomingOperation.query(
					"bpel:fromParts/bpel:fromPart", CONTEXT);

			if (fromParts.hasAny()) {
				for (Node fromPart : fromParts) {

					if (!hasFromPartCorrespondingMessagePart(fromPart, message)) {
						addViolation(fromPart);
					}
				}
			}
		} catch (NavigationException e) {
			// message does not exist, outgoingOperation is not validatable
			// => valid
		}

	}
}
 
开发者ID:sjas,项目名称:isabel,代码行数:35,代码来源:SA00053Validator.java

示例11: getMessagePartAttributeElement

import nu.xom.Nodes; //导入方法依赖的package包/类
private Node getMessagePartAttributeElement(Node operationMessage) {
	Nodes partElement = operationMessage.query(
			"child::wsdl:part[position()=1]/@element", CONTEXT);
	return (partElement.hasAny()) ? partElement.get(0) : null;
}
 
开发者ID:sjas,项目名称:isabel,代码行数:6,代码来源:SA00048Validator.java

示例12: validate

import nu.xom.Nodes; //导入方法依赖的package包/类
@Override
public void validate() {
	Nodes invokeNodes = fileHandler.getBpel().getDocument()
			.query("//bpel:invoke", CONTEXT);

	for (Node invoke : invokeNodes) {
		Nodes fromParts = invoke.query("bpel:fromParts", CONTEXT);
		String outputVariable = new NodeHelper(invoke)
				.getAttribute("outputVariable");

		if (!outputVariable.isEmpty() && fromParts.hasAny()) {
			addViolation(invoke);
		}
	}
}
 
开发者ID:sjas,项目名称:isabel,代码行数:16,代码来源:SA00052Validator.java

示例13: hasToPart

import nu.xom.Nodes; //导入方法依赖的package包/类
private boolean hasToPart(Node messageActivity) {
	Nodes toPart = messageActivity.query("child::bpel:toParts", CONTEXT);
	return toPart.hasAny();
}
 
开发者ID:sjas,项目名称:isabel,代码行数:5,代码来源:SA00047Validator.java

示例14: hasFromPart

import nu.xom.Nodes; //导入方法依赖的package包/类
private boolean hasFromPart(Node msgActivity) {
	Nodes fromPart = msgActivity.query("child::bpel:fromParts", CONTEXT);
	return fromPart.hasAny();
}
 
开发者ID:sjas,项目名称:isabel,代码行数:5,代码来源:SA00047Validator.java

示例15: hasVariable

import nu.xom.Nodes; //导入方法依赖的package包/类
private boolean hasVariable(Node msgActivity) {
	Nodes variable = msgActivity.query("attribute::variable", CONTEXT);
	return variable.hasAny();
}
 
开发者ID:sjas,项目名称:isabel,代码行数:5,代码来源:SA00047Validator.java


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