Package javax.jms

Examples of javax.jms.InvalidSelectorException


    }
   
    private SelectorNode parsePatternExpression() throws InvalidSelectorException
    {
        if (isEndOfExpression())
          throw new InvalidSelectorException("Expected pattern operand after LIKE operator");

        SelectorNode patternNode = parseBaseExpression();
        if (!(patternNode instanceof StringLiteral))
          throw new InvalidSelectorException("pattern operand of LIKE operator should be a string literal");

        return patternNode;
    }
View Full Code Here


        if (!isEndOfExpression() && currentToken.equalsIgnoreCase("escape"))
        {
            readNextToken(); // skip escape
            SelectorNode escapeNode = parseBaseExpression();
            if (!(escapeNode instanceof StringLiteral))
              throw new InvalidSelectorException("escape operand of LIKE operator should be a string literal");
            String value = (String)((StringLiteral)escapeNode).getValue();
            if (value.length() != 1)
              throw new InvalidSelectorException("escape operand of LIKE operator must contain one and only one character");
           
            return escapeNode;
        }
        return null;
    }
View Full Code Here

    }
   
    private SelectorNode parseUnaryExpression() throws InvalidSelectorException
    {
        if (isEndOfExpression())
            throw new InvalidSelectorException("Unexpected end of expression");

        if (currentToken.equals("-"))
        {
            readNextToken(); // skip '-'
            return new MinusOperator(parseBaseExpression());
View Full Code Here

    }
   
    private SelectorNode parseBaseExpression() throws InvalidSelectorException
    {
        if (isEndOfExpression())
            throw new InvalidSelectorException("Unexpected end of expression");

        if (currentToken.equals("("))
            return parseGroupExpression();
       
        if (isLiteral(currentToken))
        {
            if (currentToken.startsWith("'"))
                return parseStringConstant();
            else
                return parseNumericConstant();
        }
       
        // TRUE,FALSE and NULL keywords
        if (currentToken.equalsIgnoreCase("true"))
        {
            readNextToken(); // skip 'true'
            return new BooleanLiteral(Boolean.TRUE);
        }
        if (currentToken.equalsIgnoreCase("false"))
        {
            readNextToken(); // skip 'false'
            return new BooleanLiteral(Boolean.FALSE);
        }
        if (currentToken.equalsIgnoreCase("null"))
        {
            readNextToken(); // skip 'null'
            return new NullLiteral();
        }
        if (currentToken.equalsIgnoreCase("not true"))
        {
            readNextToken(); // skip 'not true'
            return new BooleanLiteral(Boolean.FALSE);
        }
        if (currentToken.equalsIgnoreCase("not false"))
        {
            readNextToken(); // skip 'not false'
            return new BooleanLiteral(Boolean.TRUE);
        }
       
        if (isIdentifier(currentToken))
            return parseIdentifier();

        throw new InvalidSelectorException("Unexpected token : "+currentToken);
    }
View Full Code Here

    {
        readNextToken(); // skip '('
        SelectorNode lExpression = parseExpression();
       
        if (isEndOfExpression())
            throw new InvalidSelectorException("Unexpected end of sub-expression");
        if (!currentToken.equals(")"))
            throw new InvalidSelectorException("Unexpected extra token at end of sub-expression : "+currentToken);
        readNextToken(); // skip ')'
       
        return lExpression;
    }
View Full Code Here

                lName.equals("JMSPriority") ||
                lName.equals("JMSMessageID") ||
                lName.equals("JMSTimestamp") ||
                lName.equals("JMSCorrelationID") ||
                lName.equals("JMSType")))
              throw new InvalidSelectorException("Header property "+lName+" cannot be used in a message selector");
          }
        }
       
        readNextToken();
        return new Identifier(lName);
View Full Code Here

                        pos++;
                    }
            }
        }
        if (inQuotes)
            throw new InvalidSelectorException("Expression contains an unclosed quote");
        if (buf.length() > 0)
        {           
            addAndCompress(buf.toString(),tokens);
            buf.setLength(0);
        }
View Full Code Here

                token.equalsIgnoreCase("not"))
          {
            tokensList.set(tokensList.size()-1, "is "+token);
          }
          else
            throw new InvalidSelectorException("Unexpected token after 'is' operator : "+token);
        }
        else
      if (previous.equalsIgnoreCase("is not"))
        {
        if (token.equalsIgnoreCase("true") ||
                token.equalsIgnoreCase("false") ||
                token.equalsIgnoreCase("null"))
          {
            tokensList.set(tokensList.size()-1, "is not "+token);
          }
          else
            throw new InvalidSelectorException("Unexpected token after 'is not' operator : "+token);
        }
      else
      if (previous.equalsIgnoreCase("not"))
        {
        if (token.equalsIgnoreCase("in") ||
View Full Code Here

                _messageSelectorFilter = new JMSSelectorFilter(messageSelector);
            }
        }
        catch (final AMQInternalException ie)
        {
            InvalidSelectorException ise = new InvalidSelectorException("cannot create consumer because of selector issue");
            ise.setLinkedException(ie);
            throw ise;
        }

        // Force queue browsers not to use acknowledge modes.
        if (_browseOnly)
View Full Code Here

        {
            new JMSSelectorFilter(messageSelector);
        }
        catch (AMQInternalException e)
        {
            throw new InvalidSelectorException(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of javax.jms.InvalidSelectorException

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.