本文整理匯總了Java中org.dom4j.Element.getStringValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Element.getStringValue方法的具體用法?Java Element.getStringValue怎麽用?Java Element.getStringValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.dom4j.Element
的用法示例。
在下文中一共展示了Element.getStringValue方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: parse
import org.dom4j.Element; //導入方法依賴的package包/類
@Override
public StateLike parse(Element elem) {
super.parse(elem);
List<Element> intervalElement = elem.selectNodes(TIME_TAG);
// 拿 孩子節點
for (Element intervalNode : intervalElement) {
this.time = intervalNode.getStringValue();
}
return this;
}
示例2: getMatchingNodes
import org.dom4j.Element; //導入方法依賴的package包/類
List<Element> getMatchingNodes( String snapshot, XmlNode xmlNode ) {
// cycle all nodes that come for this XPath
List<Element> matchedNodes = new ArrayList<>();
List foundNodeObjects = xmlNode.getnode().selectNodes(this.xpath);
if (foundNodeObjects != null) {
for (Object foundNodeObject : foundNodeObjects) {
Element node = (Element) foundNodeObject;
String message = null;
String nodeValue = node.getStringValue();
if (matchType == MATCH_TYPE.TEXT && nodeValue.equalsIgnoreCase(value)) {
// equals text
message = "equals ignoring case '" + value + "'";
} else if (matchType == MATCH_TYPE.CONTAINS_TEXT
&& nodeValue.toLowerCase().contains(this.value.toLowerCase())) {
// contains text
message = "contains ignoring case '" + value + "'";
} else if (nodeValue.matches(value)) {
// matches regex
message = "matches the '" + value + "' regular expression";
}
if (message != null) {
if (log.isDebugEnabled()) {
log.debug("[" + snapshot + "] File " + filePath + ": Removing XML node "
+ new XmlNode(xmlNode, node).getSignature("") + " as its value '"
+ nodeValue + "' " + message);
}
matchedNodes.add(node);
}
}
}
return matchedNodes;
}
示例3: buildConnection
import org.dom4j.Element; //導入方法依賴的package包/類
private Connection buildConnection(Element element){
Connection conn=new Connection();
conn.setName(element.attributeValue("name"));
conn.setToName(element.attributeValue("to"));
conn.setG(element.attributeValue("g"));
String script=element.getStringValue();
if(StringUtils.isNotEmpty(script)){
conn.setScript(script);
}
return conn;
}
示例4: parse
import org.dom4j.Element; //導入方法依賴的package包/類
@Override
public ScriptNode parse(Element element) {
ScriptNode node =new ScriptNode();
node.setName(element.attributeValue("name"));
node.setEventBean(element.attributeValue("event-bean"));
node.setX(element.attributeValue("x"));
node.setY(element.attributeValue("y"));
node.setWidth(element.attributeValue("width"));
node.setHeight(element.attributeValue("height"));
node.setConnections(parseConnections(element));
String script=element.getStringValue();
node.setScript(script);
return node;
}
示例5: parseDecisionItem
import org.dom4j.Element; //導入方法依賴的package包/類
private DecisionItem parseDecisionItem(Element element){
DecisionItem item=new DecisionItem();
item.setTo(element.attributeValue("connection"));
String script=element.getStringValue();
item.setScript(script);
String percent=element.attributeValue("percent");
if(StringUtils.isNotEmpty(percent)){
item.setPercent(Integer.valueOf(percent));
}
return item;
}