use of org.dom4j.Attribute in project pentaho-platform by pentaho.
the class BiPlatformRepositoryClientNavigationService method getName.
private String getName(Element element) {
// $NON-NLS-1$
String name = "";
// $NON-NLS-1$
Attribute attr = element.attribute("name");
if (attr != null) {
name = attr.getText();
}
return name;
}
use of org.dom4j.Attribute in project pentaho-platform by pentaho.
the class BiPlatformRepositoryClientNavigationService method getExtension.
private String getExtension(Element element) {
// $NON-NLS-1$
String name = "";
// $NON-NLS-1$
Attribute attr = element.attribute("name");
if (attr != null) {
name = attr.getText();
}
int idx = name.indexOf('.');
// $NON-NLS-1$
String extension = "";
if (idx != -1) {
extension = name.substring(idx + 1);
}
return extension;
}
use of org.dom4j.Attribute in project free-framework by a601942905git.
the class XmlUtil method getAttribute.
/**
* @方法功能描述: 得到指定节点的指定属性
* @方法名:getAttribute
* @param element 指定的元素
* @param attrName 属性名称
* @return Attribute
* @返回类型:Attribute
* @时间:2011-4-14下午01:45:27
*/
public static Attribute getAttribute(Element element, String attrName) {
attrName = attrName.trim();
if (element == null)
return null;
if (attrName == null || attrName.equals(""))
return null;
Attribute attribute = element.attribute(attrName);
return attribute;
}
use of org.dom4j.Attribute in project free-framework by a601942905git.
the class XmlUtil method getNodeAttrMap.
/**
* @方法功能描述:得到指定节点的所有属性及属性值
* @方法名:getNodeAttrMap
* @return 属性集合
* @返回类型:Map<String,String>
* @时间:2011-4-15上午10:00:26
*/
public static Map<String, String> getNodeAttrMap(Element e) {
Map<String, String> attrMap = new HashMap<String, String>();
if (e == null) {
return null;
}
List<Attribute> attributes = getAttributeList(e);
if (attributes == null) {
return null;
}
for (Attribute attribute : attributes) {
String attrValueString = attrValue(e, attribute.getName());
attrMap.put(attribute.getName(), attrValueString);
}
return attrMap;
}
use of org.dom4j.Attribute in project free-framework by a601942905git.
the class XmlUtil method getAttributeList.
/**
* @方法功能描述:遍历指定节点的所有属性
* @方法名:getAttributeList
* @param e
* @return 节点属性的list集合
* @返回类型:List<Attribute>
* @时间:2011-4-14下午01:41:38
*/
public static List<Attribute> getAttributeList(Element e) {
if (e == null)
return null;
List<Attribute> attributeList = new ArrayList<Attribute>();
Iterator<Attribute> atrIterator = getAttrIterator(e);
if (atrIterator == null)
return null;
while (atrIterator.hasNext()) {
Attribute attribute = atrIterator.next();
attributeList.add(attribute);
}
return attributeList;
}
Aggregations