use of gov.nist.core.NameValue in project XobotOS by xamarin.
the class PChargingVectorParser method parseParameter.
protected void parseParameter(PChargingVector chargingVector) throws ParseException {
if (debug)
dbg_enter("parseParameter");
try {
NameValue nv = this.nameValue('=');
chargingVector.setParameter(nv);
} finally {
if (debug)
dbg_leave("parseParameter");
}
}
use of gov.nist.core.NameValue in project XobotOS by xamarin.
the class URLParser method phone_context.
/**
* Parses the 'phone-context' parameter in tel: URLs
* @throws ParseException
*/
private NameValue phone_context() throws ParseException {
lexer.match('=');
char la = lexer.lookAhead(0);
Object value;
if (la == '+') {
// global-number-digits
// skip '+'
lexer.consume(1);
value = "+" + base_phone_number();
} else if (Lexer.isAlphaDigit(la)) {
// more broad than allowed
Token t = lexer.match(Lexer.ID);
value = t.getTokenValue();
} else {
throw new ParseException("Invalid phone-context:" + la, -1);
}
return new NameValue("phone-context", value, false);
}
use of gov.nist.core.NameValue in project XobotOS by xamarin.
the class Contact method setParameter.
/** 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);
}
}
use of gov.nist.core.NameValue in project XobotOS by xamarin.
the class ParametersHeader method setQuotedParameter.
/**
* 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);
}
}
use of gov.nist.core.NameValue in project XobotOS by xamarin.
the class ParametersHeader method setMultiParameter.
//-------------------------
/**
* Introduced specifically for the P-Charging-Function-Addresses Header and
* all other headers that may have multiple header parameters of the same name, but
* with multiple possible values.
*
* Example: P-Charging-Function-Addresses: ccf=[5555::b99:c88:d77:e66]; ccf=[5555::a55:b44:c33:d22];
* ecf=[5555::1ff:2ee:3dd:4cc]; ecf=[5555::6aa:7bb:8cc:9dd]
* @param name of the parameter
* @param value of the parameter
*/
public void setMultiParameter(String name, String value) {
NameValue nv = new NameValue();
nv.setName(name);
nv.setValue(value);
duplicates.set(nv);
}
Aggregations