Package gov.nist.core

Examples of gov.nist.core.Token


        String b = null;
        try {
            b = local_number();
            tn.setPhoneNumber(b);
            if (lexer.hasMoreChars()) {
                Token tok = this.lexer.peekNextToken();
                switch (tok.getTokenType()) {
                    case SEMICOLON:
                        {
                          if (inBrackets) {
                            this.lexer.consume(1);
                            nv = tel_parameters();
View Full Code Here


        Object value;
        if (la=='+') {// global-number-digits
            lexer.consume(1);// skip '+'
            value = "+" + base_phone_number();
        } else if ( Lexer.isAlphaDigit(la) ) {
            Token t = lexer.match( Lexer.ID );// more broad than allowed
            value = t.getTokenValue();
        } else {
            throw new ParseException( "Invalid phone-context:" + la , -1 );
        }
        return new NameValue( "phone-context", value, false );
    }
View Full Code Here

    public SipUri sipURL( boolean inBrackets ) throws ParseException {
        if (debug)
            dbg_enter("sipURL");
        SipUri retval = new SipUri();
        // pmusgrave - handle sips case
        Token nextToken = lexer.peekNextToken();
        int sipOrSips = TokenTypes.SIP;
        String scheme = TokenNames.SIP;
        if ( nextToken.getTokenType() == TokenTypes.SIPS)
        {
            sipOrSips = TokenTypes.SIPS;
            scheme = TokenNames.SIPS;
        }
View Full Code Here


        // 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) == ';')
View Full Code Here

  public GenericURI uriReference() throws ParseException {
    if (debug)
      dbg_enter("uriReference");
    GenericURI retval = null;
    Token[] tokens = lexer.peekNextToken(2);
    Token t1 = (Token) tokens[0];
    Token t2 = (Token) tokens[1];
    try {

      if (t1.getTokenType() == TokenTypes.SIP ||
          t1.getTokenType() == TokenTypes.SIPS  ) {
        if (t2.getTokenType() == ':')
          retval = sipURL();
        else
          throw createParseException("Expecting \':\'");
      } else if (t1.getTokenType() == TokenTypes.TEL) {
        if (t2.getTokenType() == ':') {
          retval = telURL();
        } else
          throw createParseException("Expecting \':\'");
      } else {
        String urlString = uricString();
View Full Code Here

    String b = null;
    try {
      b = local_number();
      tn.setPhoneNumber(b);
      if (lexer.hasMoreChars()) {
        Token tok = this.lexer.peekNextToken();
        switch (tok.getTokenType()) {
          case SEMICOLON :
            {
              this.lexer.consume(1);
              nv = tel_parameters();
              tn.setParameters(nv);
View Full Code Here

    Object value;
    if (la=='+') {  // global-number-digits
      lexer.consume(1)// skip '+'
      value = "+" + base_phone_number();     
    } else if ( Lexer.isAlphaDigit(la) ) {
      Token t = lexer.match( Lexer.ID )// more broad than allowed
      value = t.getTokenValue();
    } else {
      throw new ParseException( "Invalid phone-context:" + la , -1 );
    }
    return new NameValue( "phone-context", value, false );
  }
View Full Code Here

  public SipUri sipURL() throws ParseException {
    if (debug)
      dbg_enter("sipURL");
    SipUri retval = new SipUri();
    // pmusgrave - handle sips case
    Token nextToken = lexer.peekNextToken();
    int sipOrSips = TokenTypes.SIP;
    String scheme = TokenNames.SIP;
    if ( nextToken.getTokenType() == TokenTypes.SIPS)
    {
      sipOrSips = TokenTypes.SIPS;
      scheme = TokenNames.SIPS;
    }
View Full Code Here

    protected void parseToken(PVisitedNetworkID visitedNetworkID) throws ParseException
    {
        // issued by Miguel Freitas

        lexer.match(TokenTypes.ID);
        Token token = lexer.getNextToken();
        //String value = token.getTokenValue();
        visitedNetworkID.setVisitedNetworkID(token);
        super.parse(visitedNetworkID);

    }
View Full Code Here

    public GenericURI uriReference( boolean inBrackets ) throws ParseException {
        if (debug)
            dbg_enter("uriReference");
        GenericURI retval = null;
        Token[] tokens = lexer.peekNextToken(2);
        Token t1 = (Token) tokens[0];
        Token t2 = (Token) tokens[1];
        try {

            if (t1.getTokenType() == TokenTypes.SIP ||
                    t1.getTokenType() == TokenTypes.SIPS) {
                if (t2.getTokenType() == ':')
                    retval = sipURL( inBrackets );
                else
                    throw createParseException("Expecting \':\'");
            } else if (t1.getTokenType() == TokenTypes.TEL) {
                if (t2.getTokenType() == ':') {
                    retval = telURL( inBrackets );
                } else
                    throw createParseException("Expecting \':\'");
            } else {
                String urlString = uricString();
View Full Code Here

TOP

Related Classes of gov.nist.core.Token

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.