Search in sources :

Example 1 with NameValue

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");
    }
}
Also used : NameValue(gov.nist.core.NameValue)

Example 2 with NameValue

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);
}
Also used : NameValue(gov.nist.core.NameValue) Token(gov.nist.core.Token) ParseException(java.text.ParseException)

Example 3 with NameValue

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);
    }
}
Also used : NameValue(gov.nist.core.NameValue)

Example 4 with NameValue

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);
    }
}
Also used : NameValue(gov.nist.core.NameValue)

Example 5 with NameValue

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);
}
Also used : NameValue(gov.nist.core.NameValue)

Aggregations

NameValue (gov.nist.core.NameValue)18 Token (gov.nist.core.Token)3 Iterator (java.util.Iterator)3 ListIterator (java.util.ListIterator)3 ParseException (java.text.ParseException)2 LinkedList (java.util.LinkedList)2 Host (gov.nist.core.Host)1 HostNameParser (gov.nist.core.HostNameParser)1 HostPort (gov.nist.core.HostPort)1 NameValueList (gov.nist.core.NameValueList)1 SipUri (gov.nist.javax.sip.address.SipUri)1 PAccessNetworkInfo (gov.nist.javax.sip.header.ims.PAccessNetworkInfo)1