本文整理了Java中org.dom4j.Attribute.setValue()
方法的一些代码示例,展示了Attribute.setValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attribute.setValue()
方法的具体详情如下:
包路径:org.dom4j.Attribute
类名称:Attribute
方法名:setValue
[英]Sets the value of this attribute or this method will throw an UnsupportedOperationException
if it is read-only.
[中]设置此属性的值,或者如果此属性为只读,则此方法将抛出UnsupportedOperationException
。
代码示例来源:origin: hibernate/hibernate-orm
private static void addOrModifyAttribute(Element parent, String name, String value) {
final Attribute attribute = parent.attribute( name );
if ( attribute == null ) {
parent.addAttribute( name, value );
}
else {
attribute.setValue( value );
}
}
代码示例来源:origin: hibernate/hibernate-orm
foreignKey.setValue( "none" );
代码示例来源:origin: igniterealtime/Openfire
attr.setValue( "plugins/" + canonicalName + "/" + attr.getValue() );
代码示例来源:origin: igniterealtime/Openfire
for ( int i = 0; i < elements.size(); i++ )
elements.get( i ).attribute( "order" ).setValue( Integer.toString( i ) );
代码示例来源:origin: org.dom4j/dom4j
public Element addAttribute(String name, String value) {
Attribute attribute = attribute(name);
if (attribute != null) {
attribute.setValue(value);
}
return this;
}
代码示例来源:origin: org.dom4j/dom4j
public Element addAttribute(QName qName, String value) {
Attribute attribute = attribute(qName);
if (attribute != null) {
attribute.setValue(value);
}
return this;
}
代码示例来源:origin: org.dom4j/dom4j
public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr)
throws DOMException {
Attribute attribute = attribute(newAttr.getNamespaceURI(), newAttr
.getLocalName());
if (attribute != null) {
attribute.setValue(newAttr.getValue());
} else {
attribute = createAttribute(newAttr);
add(attribute);
}
return DOMNodeHelper.asDOMAttr(attribute);
}
代码示例来源:origin: org.dom4j/dom4j
public void setAttributeNS(String namespaceURI, String qualifiedName,
String value) throws DOMException {
Attribute attribute = attribute(namespaceURI, qualifiedName);
if (attribute != null) {
attribute.setValue(value);
} else {
QName qname = getQName(namespaceURI, qualifiedName);
addAttribute(qname, value);
}
}
代码示例来源:origin: org.dom4j/dom4j
public Element addAttribute(String name, String value) {
// adding a null value is equivalent to removing the attribute
Attribute attribute = attribute(name);
if (value != null) {
if (attribute == null) {
add(getDocumentFactory().createAttribute(this, name, value));
} else if (attribute.isReadOnly()) {
remove(attribute);
add(getDocumentFactory().createAttribute(this, name, value));
} else {
attribute.setValue(value);
}
} else if (attribute != null) {
remove(attribute);
}
return this;
}
代码示例来源:origin: org.dom4j/dom4j
public Element addAttribute(QName qName, String value) {
// adding a null value is equivalent to removing the attribute
Attribute attribute = attribute(qName);
if (value != null) {
if (attribute == null) {
add(getDocumentFactory().createAttribute(this, qName, value));
} else if (attribute.isReadOnly()) {
remove(attribute);
add(getDocumentFactory().createAttribute(this, qName, value));
} else {
attribute.setValue(value);
}
} else if (attribute != null) {
remove(attribute);
}
return this;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j
public Element addAttribute(QName qName, String value) {
Attribute attribute = attribute(qName);
if (attribute != null) {
attribute.setValue(value);
}
return this;
}
代码示例来源:origin: dom4j/dom4j
public Element addAttribute(String name, String value) {
Attribute attribute = attribute(name);
if (attribute != null) {
attribute.setValue(value);
}
return this;
}
代码示例来源:origin: org.dom4j/com.springsource.org.dom4j
public Element addAttribute(String name, String value) {
Attribute attribute = attribute(name);
if (attribute != null) {
attribute.setValue(value);
}
return this;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j
public Element addAttribute(String name, String value) {
Attribute attribute = attribute(name);
if (attribute != null) {
attribute.setValue(value);
}
return this;
}
代码示例来源:origin: dom4j/dom4j
public Element addAttribute(QName qName, String value) {
Attribute attribute = attribute(qName);
if (attribute != null) {
attribute.setValue(value);
}
return this;
}
代码示例来源:origin: org.dom4j/com.springsource.org.dom4j
public Element addAttribute(QName qName, String value) {
Attribute attribute = attribute(qName);
if (attribute != null) {
attribute.setValue(value);
}
return this;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j
public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr)
throws DOMException {
Attribute attribute = attribute(newAttr.getNamespaceURI(), newAttr
.getLocalName());
if (attribute != null) {
attribute.setValue(newAttr.getValue());
} else {
attribute = createAttribute(newAttr);
add(attribute);
}
return DOMNodeHelper.asDOMAttr(attribute);
}
代码示例来源:origin: dom4j/dom4j
public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr)
throws DOMException {
Attribute attribute = attribute(newAttr.getNamespaceURI(), newAttr
.getLocalName());
if (attribute != null) {
attribute.setValue(newAttr.getValue());
} else {
attribute = createAttribute(newAttr);
add(attribute);
}
return DOMNodeHelper.asDOMAttr(attribute);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j
public void setAttributeNS(String namespaceURI, String qualifiedName,
String value) throws DOMException {
Attribute attribute = attribute(namespaceURI, qualifiedName);
if (attribute != null) {
attribute.setValue(value);
} else {
QName qname = getQName(namespaceURI, qualifiedName);
addAttribute(qname, value);
}
}
代码示例来源:origin: dom4j/dom4j
public void setAttributeNS(String namespaceURI, String qualifiedName,
String value) throws DOMException {
Attribute attribute = attribute(namespaceURI, qualifiedName);
if (attribute != null) {
attribute.setValue(value);
} else {
QName qname = getQName(namespaceURI, qualifiedName);
addAttribute(qname, value);
}
}
内容来源于网络,如有侵权,请联系作者删除!