本文整理汇总了Java中org.dom4j.Attribute.getQualifiedName方法的典型用法代码示例。如果您正苦于以下问题:Java Attribute.getQualifiedName方法的具体用法?Java Attribute.getQualifiedName怎么用?Java Attribute.getQualifiedName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dom4j.Attribute
的用法示例。
在下文中一共展示了Attribute.getQualifiedName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPath
import org.dom4j.Attribute; //导入方法依赖的package包/类
/**
* Gets the path attribute of the StructureWalker object
*
* @param a Description of the Parameter
* @return The path value
*/
public String getPath(Attribute a) {
prtln("getPath: attribute: " + a.asXML(), 1);
prtln(" ... attributeName: " + a.getName(), 1);
prtln(" ... qualifiedName: " + a.getQualifiedName(), 1);
Element parent = a.getParent();
if (parent == null) {
prtln(" ... parent is null!", 1);
}
// return getPath((Node) a);
return getPath(parent) + "/@" + a.getQualifiedName();
}
示例2: getAttributePath
import org.dom4j.Attribute; //导入方法依赖的package包/类
/**
* Gets the attributePath attribute of the DocumentPruner class
*
* @param a NOT YET DOCUMENTED
* @return The attributePath value
*/
private static String getAttributePath(Attribute a) {
Element parent = a.getParent();
if (parent == null) {
prtln(" ... parent is null!");
}
return parent.getPath() + "/@" + a.getQualifiedName();
}
示例3: getNodeExistsWithRequiredAttribute
import org.dom4j.Attribute; //导入方法依赖的package包/类
/**
* Return true if the node specified by key exists in the instance document
* and it has a required attribute in the instance document.
*
* @param key a jsp-encoded xpath
* @return The nodeExistsWithRequiredAttribute value
*/
public String getNodeExistsWithRequiredAttribute(String key) {
String xpath = XPathUtils.decodeXPath(key);
Node node = docMap.selectSingleNode(xpath);
if (node == null) {
return FALSE;
}
if (node.getNodeType() != Node.ELEMENT_NODE) {
return FALSE;
}
Element element = (Element) node;
if (element.attributes().isEmpty()) {
return FALSE;
}
/* check attributes for a required one */
for (Iterator i = element.attributeIterator(); i.hasNext(); ) {
Attribute attribute = (Attribute) i.next();
String attPath = xpath + "/@" + attribute.getQualifiedName();
SchemaNode schemaNode = this.schemaHelper.getSchemaNode(attPath);
if (schemaNode == null) {
// prtln ("schemaNode not found for attribute (" + attPath + ")");
continue;
}
if (schemaNode.isRequired())
return TRUE;
}
return FALSE;
}