本文整理匯總了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;
}