Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package gov.nist.javax.sip.parser.extensions;
 
 
ReferredBy Header parser. This code is in the public domain. Based on JAIN ReferToParser
public class ReferredByParser extends AddressParametersParser {

    
Creates new ToParser

Parameters:
referBy String to set
    public ReferredByParser(String referBy) {
        super(referBy);
    }
    protected ReferredByParser(Lexer lexer) {
        super(lexer);
    }
    public SIPHeader parse() throws ParseException {
        ReferredBy referBy = new ReferredBy();
        super.parse(referBy);
        this..match('\n');
        return referBy;
    }
    public static void main(String args[]) throws ParseException {
        String to[] =
            {   "Referred-By: <sip:dave@denver.example.org?" +
                    "Replaces=12345%40192.168.118.3%3Bto-tag%3D12345%3Bfrom-tag%3D5FFE-3994>\n",
                "Referred-By: <sip:+1-650-555-2222@ss1.wcom.com;user=phone>;tag=5617\n",
                "Referred-By: T. A. Watson <sip:watson@bell-telephone.com>\n",
                "Referred-By: LittleGuy <sip:UserB@there.com>\n",
                "Referred-By: sip:mranga@120.6.55.9\n",
                "Referred-By: sip:mranga@129.6.55.9 ; tag=696928473514.129.6.55.9\n" };
        for (int i = 0; i < to.lengthi++) {
            ReferredByParser tp = new ReferredByParser(to[i]);
            ReferredBy t = (ReferredBytp.parse();
            ..println("encoded = " + t.encode());
        }
    }
/*
 * $Log:
 *
 */


New to GrepCode? Check out our FAQ X