Package gov.nist.javax.sip.header

Examples of gov.nist.javax.sip.header.SIPHeaderList


 

  public SIPHeaderList parse(SecurityAgree header) throws ParseException
  {
 
    SIPHeaderList list;
   
    if (header.getClass().isInstance(new SecurityClient())) {
      list = new SecurityClientList();
    } else if (header.getClass().isInstance(new SecurityServer())) {
      list = new SecurityServerList();
    } else if (header.getClass().isInstance(new SecurityVerify())) {
      list = new SecurityVerifyList();
    }
    else
      return null;
   
     
    // the security-mechanism:
    this.lexer.SPorHT();
    lexer.match(TokenTypes.ID);
    Token type = lexer.getNextToken();
    header.setSecurityMechanism(type.getTokenValue());
    this.lexer.SPorHT();

    char la = lexer.lookAhead(0);
    if (la == '\n')
    {
      list.add(header);
      return list;
    }
    else if (la == ';')
      this.lexer.match(';');
   
    this.lexer.SPorHT();
   
    // The parameters:
    try {
      while (lexer.lookAhead(0) != '\n') {
       
        this.parseParameter(header);
        this.lexer.SPorHT();
        char laInLoop = lexer.lookAhead(0);
        if (laInLoop == '\n' || laInLoop == '\0')
          break;
        else if (laInLoop == ',')
        {
          list.add(header);
          if (header.getClass().isInstance(new SecurityClient())) {
            header = new SecurityClient();
          } else if (header.getClass().isInstance(new SecurityServer())) {
            header = new SecurityServer();
          } else if (header.getClass().isInstance(new SecurityVerify())) {
            header = new SecurityVerify();
          }

          this.lexer.match(',');
          // the security-mechanism:
          this.lexer.SPorHT();
          lexer.match(TokenTypes.ID);
          type = lexer.getNextToken();
          header.setSecurityMechanism(type.getTokenValue());

        }
        this.lexer.SPorHT();
       
        if (lexer.lookAhead(0) == ';')
          this.lexer.match(';');
       
        this.lexer.SPorHT();
       
      }
      list.add(header);
     
      return list;
     
    } catch (ParseException ex) {
      throw ex;
View Full Code Here



    public SIPHeaderList parse(SecurityAgree header) throws ParseException
    {

        SIPHeaderList list;

        if (header.getClass().isInstance(new SecurityClient())) {
            list = new SecurityClientList();
        } else if (header.getClass().isInstance(new SecurityServer())) {
            list = new SecurityServerList();
        } else if (header.getClass().isInstance(new SecurityVerify())) {
            list = new SecurityVerifyList();
        }
        else
            return null;


        // the security-mechanism:
        this.lexer.SPorHT();
        lexer.match(TokenTypes.ID);
        Token type = lexer.getNextToken();
        header.setSecurityMechanism(type.getTokenValue());
        this.lexer.SPorHT();

        char la = lexer.lookAhead(0);
        if (la == '\n')
        {
            list.add(header);
            return list;
        }
        else if (la == ';')
            this.lexer.match(';');

        this.lexer.SPorHT();

        // The parameters:
        try {
            while (lexer.lookAhead(0) != '\n') {

                this.parseParameter(header);
                this.lexer.SPorHT();
                char laInLoop = lexer.lookAhead(0);
                if (laInLoop == '\n' || laInLoop == '\0')
                    break;
                else if (laInLoop == ',')
                {
                    list.add(header);
                    if (header.getClass().isInstance(new SecurityClient())) {
                        header = new SecurityClient();
                    } else if (header.getClass().isInstance(new SecurityServer())) {
                        header = new SecurityServer();
                    } else if (header.getClass().isInstance(new SecurityVerify())) {
                        header = new SecurityVerify();
                    }

                    this.lexer.match(',');
                    // the security-mechanism:
                    this.lexer.SPorHT();
                    lexer.match(TokenTypes.ID);
                    type = lexer.getNextToken();
                    header.setSecurityMechanism(type.getTokenValue());

                }
                this.lexer.SPorHT();

                if (lexer.lookAhead(0) == ';')
                    this.lexer.match(';');

                this.lexer.SPorHT();

            }
            list.add(header);

            return list;

        } catch (ParseException ex) {
            throw ex;
View Full Code Here

TOP

Related Classes of gov.nist.javax.sip.header.SIPHeaderList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.