public void writeValue(Object value) { att.setValue(value.toString()); }
public void writeValue(Object value) { att.setValue(value.toString()); }
/** * Set the system property value. * * @param value to be set */ public void setValue(String value) { ((Attribute) getAttributes().get(0)).setValue(value); } }
/** * Set the system property value. * * @param value to be set */ public void setValue(String value) { ((Attribute) getAttributes().get(0)).setValue(value); } }
public void setValue(Object value) { attr.setValue((String) TypeUtils.convert(value, String.class)); }
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; }
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; }
/** * 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; }
/** * 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; }
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); }
/** * 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); }
/** * <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; }
/** * <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; }
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; }
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; }
parent.getAttribute("register-size").setValue(newRegSize + "");
((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));