public void setParameter(String name, String value) throws ParseException { if (value == null) throw new NullPointerException("null value"); NameValue nv = super.parameters.getNameValue(name.toLowerCase()); if (nv == null) { nv = new NameValue(name, value); // quoted values if (name.equalsIgnoreCase(ParameterNamesIms.D_VER)) { nv.setQuotedValue(); if (value.startsWith(Separators.DOUBLE_QUOTE)) throw new ParseException(value + " : Unexpected DOUBLE_QUOTE", 0); } super.setParameter(nv); } else { nv.setValueAsObject(value); } }
/** Set a parameter. */ public void setParameter(String name, String value) throws ParseException { NameValue nv = parameters.getNameValue(name); if (nv != null) { nv.setValueAsObject(value); } else { nv = new NameValue(name, value); if (name.equalsIgnoreCase("methods")) nv.setQuotedValue(); this.parameters.set(nv); } }
/** * Allow for null value when setting the value. * * @param value -- can be null. */ public void setValueAllowNull(String value) { NameValue nameValue = getAttribute(); if (nameValue == null) nameValue = new NameValue(); nameValue.setValueAsObject(value); setAttribute(nameValue); }
/** * <p>Get all the Charging Collection Function (CCF) Addresses set in this header</p> * * @return ListIterator that constains all CCF addresses of this header */ public ListIterator getChargingCollectionFunctionAddresses() { Iterator li = this.parameters.iterator(); LinkedList ccfLIST = new LinkedList(); NameValue nv; while (li.hasNext()) { nv = (NameValue) li.next(); if (nv.getName().equalsIgnoreCase(ParameterNamesIms.CCF)) { NameValue ccfNV = new NameValue(); ccfNV.setName(nv.getName()); ccfNV.setValueAsObject(nv.getValueAsObject()); ccfLIST.add(ccfNV); } } return ccfLIST.listIterator(); }
/** * <p>Get all the Event Charging Function (ECF) Addresses set in this header</p> * * @return ListIterator that constains all CCF addresses of this header */ public ListIterator<NameValue> getEventChargingFunctionAddresses() { LinkedList<NameValue> listw = new LinkedList<NameValue>(); Iterator li = this.parameters.iterator(); ListIterator<NameValue> ecfLIST = listw.listIterator(); NameValue nv; boolean removed = false; while (li.hasNext()) { nv = (NameValue) li.next(); if (nv.getName().equalsIgnoreCase(ParameterNamesIms.ECF)) { NameValue ecfNV = new NameValue(); ecfNV.setName(nv.getName()); ecfNV.setValueAsObject(nv.getValueAsObject()); ecfLIST.add(ecfNV); } } return ecfLIST; }
/** * Sets the value of the specified parameter. If the parameter already had * * a value it will be overwritten. * * @param name - a String specifying the parameter name * * @param value - a boolean specifying the parameter value * * @throws ParseException which signals that an error has been reached * * unexpectedly while parsing the parameter name or value. * */ protected void setParameter(String name, float value) { Float val = Float.valueOf(value); NameValue nv = parameters.getNameValue(name); if (nv != null) { nv.setValueAsObject(val); } else { nv = new NameValue(name, val); this.parameters.set(nv); } }
/** Sets the value of this attribute. * @param value the - attribute value * @throws SdpException if the value is null. */ public void setValue(String value) throws SdpException { if (value == null) throw new SdpException("The value is null"); else { NameValue nameValue = getAttribute(); if (nameValue == null) nameValue = new NameValue(); nameValue.setValueAsObject(value); setAttribute(nameValue); } }
if (af.getAttribute().getName().equals(name)) { NameValue nv = af.getAttribute(); nv.setValueAsObject(value); break;
/** * Sets the value of the specified parameter. If the parameter already had * * a value it will be overwritten. A zero-length String indicates flag * * parameter. * * * * @param name - a String specifying the parameter name * * @param value - a String specifying the parameter value * * @throws ParseException which signals that an error has been reached * * unexpectedly while parsing the parameter name or value. * */ public void setParameter(String name, String value) throws ParseException { NameValue nv = parameters.getNameValue(name); if (nv != null) { nv.setValueAsObject(value); } else { nv = new NameValue(name, value); this.parameters.set(nv); } }
/** * Set the MADDR parameter . * @param mAddr Host Name to set */ public void setMAddr(String mAddr) { NameValue nameValue = uriParms.getNameValue(MADDR); Host host = new Host(); host.setAddress(mAddr); if (nameValue != null) nameValue.setValueAsObject(host); else { nameValue = new NameValue(MADDR, host); uriParms.set(nameValue); } }
/** * Sets the value of the specified parameter. If the parameter already had * * a value it will be overwritten. A zero-length String indicates flag * * parameter. * * * * @param name - a String specifying the parameter name * * @param value - a String specifying the parameter value * * @throws ParseException which signals that an error has been reached * * unexpectedly while parsing the parameter name or value. * */ public void setQuotedParameter(String name, String value) throws ParseException { NameValue nv = parameters.getNameValue(name); if (nv != null) { nv.setValueAsObject(value); nv.setQuotedValue(); } else { nv = new NameValue(name, value); nv.setQuotedValue(); this.parameters.set(nv); } }