本文整理汇总了Java中org.dom4j.tree.DefaultElement.attributeValue方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultElement.attributeValue方法的具体用法?Java DefaultElement.attributeValue怎么用?Java DefaultElement.attributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dom4j.tree.DefaultElement
的用法示例。
在下文中一共展示了DefaultElement.attributeValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMacrosNode
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
private void handleMacrosNode(Element xmlChannel) throws IOException {
for (Object attrObj : xmlChannel.elements()) {
DefaultElement e = (DefaultElement) attrObj;
StringWriter sw = new StringWriter();
XMLWriter writer = new XMLWriter(sw);
writer.write(e.elements());
if (this.tasker.getMacros().containsKey(e.attributeValue("name"))) {
throw new RuntimeException("Macro " + e.attributeValue("name") + " already exists in map.");
}
this.tasker.getMacros().put(e.attributeValue("name"), sw.toString());
this.tasker.getMacroAttrs().put(e.attributeValue("name"), e.attributes());
}
}
示例2: handleDefaultPropertiesNode
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
private void handleDefaultPropertiesNode(Element xmlChannel) {
for (Object attrObj : xmlChannel.elements()) {
DefaultElement e = (DefaultElement) attrObj;
String propertyValue = e.attributeValue("value");
for (String defaultAttr : this.tasker.getDefaultProperties().keySet()) {
propertyValue =
propertyValue.replace("{" + defaultAttr + "}",
this.tasker.getDefaultProperties().get(defaultAttr));
}
this.tasker.getDefaultProperties().put(e.attributeValue("name"), propertyValue);
}
}
示例3: CPResource
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
* this constructor is needed when building up the datamodel (parsing XML-manifest)
*
* @param me
*/
public CPResource(final DefaultElement me) {
super(me.getName());
files = new Vector<CPFile>();
dependencies = new Vector<CPDependency>();
// setAttributes(me.attributes());
setContent(me.content());
this.identifier = me.attributeValue(CPCore.IDENTIFIER);
this.type = me.attributeValue(CPCore.TYPE);
this.href = me.attributeValue(CPCore.HREF);
this.xmlbase = me.attributeValue(CPCore.BASE, "");
}
示例4: CPOrganization
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
* this constructor is used when the cp is built (parsing XML manifest file)
*
* @param me
*/
CPOrganization(final DefaultElement me) {
super(me.getName());
items = new Vector<CPItem>();
errors = new Vector<String>();
setAttributes(me.attributes());
setContent(me.content());
this.identifier = me.attributeValue(CPCore.IDENTIFIER);
this.structure = me.attributeValue(CPCore.STRUCTURE, "hierarchical");
// this.title = me.
}
示例5: CPItem
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
* constructor is needed while building the datamodel-tree (parsing XML)
*
* @param me
*/
public CPItem(final DefaultElement me, final DefaultElement parent) {
super(me.getName());
items = new Vector<CPItem>();
errors = new Vector<String>();
// setAttributes(me.attributes());
setContent(me.content());
this.parent = parent;
this.identifier = me.attributeValue(CPCore.IDENTIFIER);
this.identifierRef = me.attributeValue(CPCore.IDENTIFIERREF, "");
final String val = me.attributeValue(CPCore.ISVISIBLE, "true");
this.visible = (val != null && val.equals("true"));
}
示例6: CPFile
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
* Constructor, used when building up the cp (parsing XML-manifest)
*
* @param me
* @param xmlBase
* xmlBase-attribute of the parental resource-element
* @param packageFolder
* TODO
*/
public CPFile(final DefaultElement me, final String xmlBase, final VFSContainer rootDir) {
super(me.getName());
setContent(me.content());
this.href = me.attributeValue(CPCore.HREF);
if (xmlBase.equals("")) {
file = (VFSLeaf) rootDir.resolve(href);
} else {
file = (VFSLeaf) rootDir.resolve(xmlBase + "/" + href);
}
}
示例7: CPManifest
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
* this constructor is used when building up the cp (parsing XML)
*
* @param me
*/
public CPManifest(final CPCore cp, final DefaultElement me) {
super(me.getName());
errors = new Vector<String>();
this.identifier = me.attributeValue(CPCore.IDENTIFIER);
this.schemaLocation = me.attributeValue(CPCore.SCHEMALOCATION);
this.setNamespace(me.getNamespace());
this.cp = cp;
// FIXME: namespaces ! xmlns
setContent(me.content());
}
示例8: CPDependency
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
* this constructor is neeeded when building up the cp (parsing XML manifest file)
*
* @param me
*/
public CPDependency(final DefaultElement me) {
super(me.getName());
identifierRef = me.attributeValue(CPCore.IDENTIFIERREF);
if (identifierRef.equals(null)) {
throw new OLATRuntimeException(CPOrganizations.class, "Invalid IMS-Manifest ( <dependency> element without identifierref )", new Exception());
}
}