本文整理了Java中org.jdom.Attribute.setValue()
方法的一些代码示例,展示了Attribute.setValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attribute.setValue()
方法的具体详情如下:
包路径:org.jdom.Attribute
类名称:Attribute
方法名:setValue
[英]This will set the value of the Attribute
.
[中]这将设置Attribute
的值。
代码示例来源:origin: apache/cxf
public void writeValue(Object value) {
att.setValue(value.toString());
}
代码示例来源:origin: org.apache.cxf/cxf-rt-databinding-aegis
public void writeValue(Object value) {
att.setValue(value.toString());
}
代码示例来源:origin: org.codehaus.cargo/cargo-core-api-module
/**
* Set the system property value.
*
* @param value to be set
*/
public void setValue(String value)
{
((Attribute) getAttributes().get(0)).setValue(value);
}
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Set the system property value.
*
* @param value to be set
*/
public void setValue(String value)
{
((Attribute) getAttributes().get(0)).setValue(value);
}
}
代码示例来源:origin: commons-jxpath/commons-jxpath
public void setValue(Object value) {
attr.setValue((String) TypeUtils.convert(value, String.class));
}
代码示例来源:origin: apache/oozie
private static String resolveAttribute(String attrName, Element elem, ELEvaluator eval) throws CoordinatorJobException {
Attribute attr = elem.getAttribute(attrName);
String val = null;
if (attr != null) {
try {
val = CoordELFunctions.evalAndWrap(eval, attr.getValue().trim());
}
catch (Exception e) {
throw new CoordinatorJobException(ErrorCode.E1004, e.getMessage(), e);
}
attr.setValue(val);
}
return val;
}
代码示例来源:origin: org.apache.oozie/oozie-core
private static String resolveAttribute(String attrName, Element elem, ELEvaluator eval) throws CoordinatorJobException {
Attribute attr = elem.getAttribute(attrName);
String val = null;
if (attr != null) {
try {
val = CoordELFunctions.evalAndWrap(eval, attr.getValue().trim());
}
catch (Exception e) {
throw new CoordinatorJobException(ErrorCode.E1004, e.getMessage(), e);
}
attr.setValue(val);
}
return val;
}
代码示例来源:origin: apache/oozie
/**
* Resolve an attribute value.
*
* @param attrName : Attribute name.
* @param elem : XML Element where attribute is defiend
* @param eval : ELEvaluator used to resolve
* @return Resolved attribute value
* @throws CoordinatorJobException thrown if failed to resolve an attribute value
*/
private String resolveAttribute(String attrName, Element elem, ELEvaluator eval) throws CoordinatorJobException {
Attribute attr = elem.getAttribute(attrName);
String val = null;
if (attr != null) {
try {
val = CoordELFunctions.evalAndWrap(eval, attr.getValue().trim());
}
catch (Exception e) {
throw new CoordinatorJobException(ErrorCode.E1004, e.getMessage(), e);
}
attr.setValue(val);
}
return val;
}
代码示例来源:origin: org.apache.oozie/oozie-core
/**
* Resolve an attribute value.
*
* @param attrName : Attribute name.
* @param elem : XML Element where attribute is defiend
* @param eval : ELEvaluator used to resolve
* @return Resolved attribute value
* @throws CoordinatorJobException thrown if failed to resolve an attribute value
*/
private String resolveAttribute(String attrName, Element elem, ELEvaluator eval) throws CoordinatorJobException {
Attribute attr = elem.getAttribute(attrName);
String val = null;
if (attr != null) {
try {
val = CoordELFunctions.evalAndWrap(eval, attr.getValue().trim());
}
catch (Exception e) {
throw new CoordinatorJobException(ErrorCode.E1004, e.getMessage(), e);
}
attr.setValue(val);
}
return val;
}
代码示例来源:origin: geosolutions-it/geoserver-manager
public void setName(String name) {
final Attribute _name = this.getRoot().getAttribute(GSAboutResource.NAME);
if (name!=null)
_name.setValue(name);
else
this.getRoot().setAttribute(GSAboutResource.NAME, name);
}
代码示例来源:origin: org.jdom/jdom-legacy
/**
* This will create a new <code>Attribute</code> with the
* specified (local) name, value, and type, and in the provided
* <code>{@link Namespace}</code>.
*
* @param name <code>String</code> name of <code>Attribute</code>.
* @param value <code>String</code> value for new attribute.
* @param type <code>int</code> type for new attribute.
* @param namespace <code>Namespace</code> namespace for new attribute.
* @throws IllegalNameException if the given name is illegal as an
* attribute name or if if the new namespace is the default
* namespace. Attributes cannot be in a default namespace.
* @throws IllegalDataException if the given attribute value is
* illegal character data (as determined by
* {@link org.jdom.Verifier#checkCharacterData}) or
* if the given attribute type is not one of the
* supported types.
*/
public Attribute(final String name, final String value, final int type, final Namespace namespace) {
setName(name);
setValue(value);
setAttributeType(type);
setNamespace(namespace);
}
代码示例来源:origin: org.jdom/jdom-legacy
/**
* <p>
* This sets an attribute value for this element. Any existing attribute
* with the same name and namespace URI is removed.
* </p>
*
* @param name name of the attribute to set
* @param value value of the attribute to set
* @return this element modified
* @throws IllegalNameException if the given name is illegal as an
* attribute name.
* @throws IllegalDataException if the given attribute value is
* illegal character data (as determined by
* {@link org.jdom.Verifier#checkCharacterData}).
*/
public Element setAttribute(final String name, final String value) {
final Attribute attribute = getAttribute(name);
if (attribute == null) {
final Attribute newAttribute = new Attribute(name, value);
setAttribute(newAttribute);
} else {
attribute.setValue(value);
}
return this;
}
代码示例来源:origin: org.jdom/jdom-legacy
/**
* <p>
* This sets an attribute value for this element. Any existing attribute
* with the same name and namespace URI is removed.
* </p>
*
* @param name name of the attribute to set
* @param value value of the attribute to set
* @param ns namespace of the attribute to set
* @return this element modified
* @throws IllegalNameException if the given name is illegal as an
* attribute name, or if the namespace is an unprefixed default
* namespace
* @throws IllegalDataException if the given attribute value is
* illegal character data (as determined by
* {@link org.jdom.Verifier#checkCharacterData}).
* @throws IllegalAddException if the attribute namespace prefix
* collides with another namespace prefix on the element.
*/
public Element setAttribute(final String name, final String value, final Namespace ns) {
final Attribute attribute = getAttribute(name, ns);
if (attribute == null) {
final Attribute newAttribute = new Attribute(name, value, ns);
setAttribute(newAttribute);
} else {
attribute.setValue(value);
}
return this;
}
代码示例来源:origin: com.ebmwebsourcing.easybpel/easybpel.xpath.exp.impl
left.getAttribute("type").setValue("xsd:string");
left.setText(left.getText() + " or " + right.getValue());
} else if (left.getText().equals("true") || right.getText().equals("true")) {
res.getAttribute("type").setValue("xsd:string");
res.setText(left.getText());
代码示例来源:origin: com.ebmwebsourcing.easybpel/easybpel.xpath.exp.impl
left.getAttribute("type").setValue("xsd:string");
left.setText(left.getText() + " and " + right.getValue());
} else if (left.getText().equals("true") && right.getText().equals("true")) {
res.getAttribute("type").setValue("xsd:string");
res.setText(left.getText());
代码示例来源:origin: info.magnolia/magnolia-module-mail
att.setValue(CID + (this.cid));
String url = getUrl(pageUrl, value);
att.setValue(url);
url = pageUrl;
att.setValue(url);
代码示例来源:origin: org.sakaiproject.metaobj/sakai-metaobj-impl
public ValidatedNode validateAndNormalize(Attribute node) {
ValidatedNodeImpl validatedNode =
new ValidatedNodeImpl(parentNode, null);
String value = node.getValue();
try {
value = getSchemaNormalizedValue(value);
node.setValue(value);
validatedNode.setNormalizedValue(getActualNormalizedValue(value));
if (value == null || value.length() == 0) {
return null;
}
}
catch (NormalizationException exp) {
validatedNode.getErrors().add(new ValidationError(validatedNode, exp.getErrorCode(), exp.getErrorInfo()));
}
return validatedNode;
}
代码示例来源:origin: org.jdom/jdom-contrib
public Attribute setValue(String value) {
String oldValue = this.getValue();
super.setValue(value);
if (this.getAttributeType() == Attribute.ID_TYPE) {
// Udpate the owning document's lookup table.
Document doc = this.getDocument();
if (doc instanceof IdDocument) {
((IdDocument)doc).removeId(oldValue);
((IdDocument)doc).addId(this.getValue(), this.getParent());
}
}
return this;
}
代码示例来源:origin: dragome/dragome-sdk
parent.getAttribute("register-size").setValue(newRegSize + "");
代码示例来源:origin: DSpace/DSpace
((Element) what).setText(checkedString(value));
} else if (what instanceof Attribute) {
((Attribute) what).setValue(checkedString(value));
} else if (what instanceof Text) {
((Text) what).setText(checkedString(value));
内容来源于网络,如有侵权,请联系作者删除!