亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? selector.java

?? 一個java方面的消息訂閱發(fā)送的源碼
?? JAVA
字號:
/**
 * Redistribution and use of this software and associated documentation
 * ("Software"), with or without modification, are permitted provided
 * that the following conditions are met:
 *
 * 1. Redistributions of source code must retain copyright
 *    statements and notices.  Redistributions must also contain a
 *    copy of this document.
 *
 * 2. Redistributions in binary form must reproduce the
 *    above copyright notice, this list of conditions and the
 *    following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. The name "Exolab" must not be used to endorse or promote
 *    products derived from this Software without prior written
 *    permission of Exoffice Technologies.  For written permission,
 *    please contact info@exolab.org.
 *
 * 4. Products derived from this Software may not be called "Exolab"
 *    nor may "Exolab" appear in their names without prior written
 *    permission of Exoffice Technologies. Exolab is a registered
 *    trademark of Exoffice Technologies.
 *
 * 5. Due credit should be given to the Exolab Project
 *    (http://www.exolab.org/).
 *
 * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
 * EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Copyright 2000-2001,2003 (C) Exoffice Technologies Inc. All Rights Reserved.
 */

package org.exolab.jms.selector;

import java.io.StringReader;

import javax.jms.InvalidSelectorException;
import javax.jms.Message;

import org.exolab.jms.selector.parser.SelectorLexer;
import org.exolab.jms.selector.parser.SelectorParser;
import org.exolab.jms.selector.parser.SelectorTreeParser;


/**
 * This class enables messages to be filtered using a message selector.
 * This is a String whose syntax is based on a subset of the SQL92
 * conditional expression syntax.
 *
 * A selector can contain:
 * <ul>
 * <li>Literals:</li>
 * <ul>
 *   <li>A string literal is enclosed in single quotes with an included
 *       single quote represented by doubled single quote such as 'literal'
 *       and 'literal''s'; like Java <i>String</i> literals these use the
 *       unicode character encoding.
 *   </li>
 *   <li>An exact numeric literal is a numeric value without a decimal point
 *       such as 57, -957, +62; numbers in the range of Java <i>long</i> are
 *       supported. Exact numeric literals use the Java integer literal syntax.
 *   </li>
 *   <li>An approximate numeric literal is a numeric value in scientific
 *       notation such as 7E3, -57.9E2 or a numeric value with a decimal such
 *       as 7., -95.7, +6.2; numbers in the range of Java <i>double</i>
 *       are supported. Approximate literals use the Java floating point
 *       literal syntax.
 *   </li>
 *   <li>The boolean literals <i>TRUE </i>and <i>FALSE</i>.</li>
 * </ul>
 * <li>Identifiers:</li>
 * <ul>
 *   <li>Identifiers use the Java identifier syntax. They are case sensitive.
 *   </li>
 *   <li>Identifiers cannot be the names <i>NULL</i>, <i>TRUE</i>, or
 *       <i>FALSE</i>.
 *   </li>
 *   <li>Identifiers cannot be <i>NOT, AND, OR, BETWEEN, LIKE, IN</i>, and
 *       <i>IS</i>.
 *   </li>
 *   <li>Identifiers are either header field references or property references.
 *   </li>
 *   <br>Message header field references are restricted to
 *       <i>JMSDeliveryMode</i>, <i>JMSPriority</i>, <i>JMSMessageID</i>,
 *       <i>JMSTimestamp</i>, <i>JMSCorrelationID</i>, and <i>JMSType</i>.
 *       <i>JMSMessageID</i>, <i>JMSCorrelationID</i>, and <i>JMSType</i>
 *       values may be <i>null</i> and if so are treated as a NULL value.
 *   <li>Any name beginning with 'JMSX' is a JMS defined property name.</li>
 *   <li>Any name beginning with 'JMS_' is a provider-specific property name.
 *   </li>
 *   <li>Any name that does not begin with 'JMS' is an application-specific
 *       property name. If a property is referenced that does not exist in a
 *       message its value is NULL. If it does exist, its value is the
 *       corresponding property value.
 *   </li>
 * </ul>
 * <li>Expressions:</li>
 * <ul>
 *   <li>A selector is a conditional expression; a selector that evaluates to
 *       true matches; a selector that evaluates to false or unknown does not
 *       match.
 *   </li>
 *   <li>Arithmetic expressions are composed of themselves, arithmetic
 *       operations, identifiers with numeric values and numeric literals.
 *   </li>
 *   <li>Conditional expressions are composed of themselves, comparison
 *       operations, logical operations, identifiers with boolean values and
 *       boolean literals.
 *   </li>
 *   <li>Standard bracketing () for ordering expression evaluation is
 *       supported.
 *   </li>
 *   <li>Logical operators in precedence order: NOT, AND, OR.</li>
 *   <li>Comparison operators: =, >, >=, &lt;, &lt;=, &lt;> (not equal).
 *   </li>
 *   <li>Only <i>like </i>type values can be compared. One exception is that it
 *       is valid to compare exact numeric values and approximate numeric
 *       values (the type conversion required is defined by the rules of Java
 *       numeric promotion). If the comparison of non-like type values is
 *       attempted, the selector is always false.
 *   </li>
 *   <li><i>String</i> and <i>Boolean</i> comparison is restricted to = and
 *       &lt;>. Two strings are equal if and only if they contain the same
 *       sequence of characters.
 *   </li>
 * </ul>
 * <li>Arithmetic operators in precedence order:</li>
 * <ul>
 *   <li>+, - unary</li>
 *   <li>*, / multiplication and division</li>
 *   <li>+, - addition and subtraction</li>
 *   <li>Arithmetic operations use Java numeric promotion.</li>
 * </ul>
 *
 * <li><i>arithmetic-expr1 </i>[NOT] BETWEEN <i>arithmetic-expr2 </i>AND<i>
 *     arithmetic-expr3</i> comparison operator
 * </li>
 *   <ul>
 *     <li>age BETWEEN 15 and 19 is equivalent to age >= 15 AND age &lt;= 19
 *     </li>
 *     <li>age NOT BETWEEN 15 and 19 is equivalent to age &lt; 15 OR age > 19
 *     </li>
 *   </ul>
 *   <li><i>identifier </i>[NOT] IN (<i>string-literal1, string-literal2,...
 *       </i>)
 *   </li>
 *   <br>comparison operator where identifier has a <i>String</i> or NULL
 *       value.
 *   <ul>
 *     <li>Country IN ('UK', 'US', 'France') is true for 'UK' and false for
 *         'Peru'. It is equivalent to the expression (Country = ' UK') OR
 *         (Country = ' US') OR (Country = ' France')
 *     </li>
 *     <li>Country NOT IN (' UK', 'US', 'France') is false for 'UK' and true
 *         for 'Peru'. It is equivalent to the expression NOT ((Country = 'UK')
 *         OR (Country = 'US') OR (Country = 'France'))
 *     </li>
 *     <li>If <i>identifier </i>of an IN or NOT IN operation is NULL the value
 *         of the operation is unknown.
 *     </li>
 *   </ul>
 *   <li><i>identifier </i>[NOT] LIKE <i>pattern-value</i> [ESCAPE
 *       <i>escape-character</i>]
 *   </li>
 *   <br>comparison operator, where <i>identifier</i> has a <i>String</i>
 *       value; <i>pattern-value</i> is a string literal where '_' stands for
 *       any single character; '%' stands for any sequence of characters
 *       (including the empty sequence); and all other characters stand for
 *       themselves. The optional <i>escape-character</i> is a single character
 *       string literal whose character is used to escape the special meaning
 *       of the '_' and '%' in <i>pattern-value</i>.
 *   <ul>
 *     <li><i>phone LIKE '12%3'</i> is true for '123', '12993' and false for
 *         '1234'
 *     </li>
 *     <li><i>word LIKE 'l_se'</i> is true for 'lose' and false for 'loose'
 *     </li>
 *     <li><i>underscored LIKE '\_%' ESCAPE '\'</i> is true for '_foo' and
 *         false for 'bar'
 *     </li>
 *     <li><i>phone NOT LIKE '12%3'</i> is false for '123' and '12993' and
 *         true for '1234'
 *     </li>
 *     <li>If <i>identifier</i> of a LIKE or NOT LIKE operation is NULL the
 *         value of the operation is unknown.
 *     </li>
 *   </ul>
 *   <li><i>identifier</i> IS NULL</li>
 *   <br>comparison operator tests for a null header field value, or a
 *       missing property value.
 *   <ul>
 *     <li><i>prop_name</i> IS NULL</li>
 *     <li><i>identifier</i> IS NOT NULL comparison operator tests for the
 *         existence of a non null header field value or property value.
 *     </li>
 *     <li><i>prop_name</i> IS NOT NULL</li>
 *   </ul>
 * </ul></ul>
 *
 * @version     $Revision: 1.1 $ $Date: 2004/11/26 01:50:44 $
 * @author      <a href="mailto:tma@netspace.net.au">Tim Anderson</a>
 */
public class Selector {

    /**
     * The 'compiled' expression
     */
    private final Expression _evaluator;


    /**
     * Construct a message selector that selects messages based on the
     * supplied expression.
     *
     * @param       expression      the conditional expression
     * @throws      InvalidSelectorException if expression is invalid
     */
    public Selector(final String expression) throws InvalidSelectorException {
        try {
            if (expression == null || expression.length() == 0) {
                // always return true for null or empty expressions
                _evaluator = Literal.booleanLiteral(true);
            } else {
                SelectorLexer lexer = new SelectorLexer(
                    new StringReader(expression));
                lexer.initialise();

                SelectorParser parser = new SelectorParser(lexer);
                parser.initialise();
                parser.selector(); // start parsing at the selector rule

                SelectorTreeParser builder = new SelectorTreeParser();
                builder.initialise(new DefaultExpressionFactory());
                _evaluator = builder.selector(parser.getAST());
            }
        } catch (Exception exception) {
            throw new InvalidSelectorException(exception.toString());
        }
    }

    /**
     * Return if message is selected by the expression
     *
     * @param message the message
     * @return <code>true</code> if the message is selected, otherwise
     * <code>false</code>
     */
    public boolean selects(final Message message) {
        boolean result = false;
        try {
            SObject value = _evaluator.evaluate(message);
            if (value instanceof SBool) {
                result = ((SBool) value).value();
            }
        } catch (TypeMismatchException ignore) {
        }
        return result;
    }

} //-- Selector

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久精品99国产精品| 亚洲精品一区二区三区香蕉| 欧美一级黄色大片| 国产精品护士白丝一区av| 日日噜噜夜夜狠狠视频欧美人| 国产激情视频一区二区三区欧美 | 亚洲综合丝袜美腿| 久久99国内精品| 欧美亚洲国产一区二区三区| 久久九九99视频| 蜜臀av性久久久久蜜臀aⅴ流畅| 99在线精品观看| 久久久99精品免费观看不卡| 日韩中文字幕不卡| 色爱区综合激月婷婷| 久久精子c满五个校花| 久久99精品国产| 日韩视频123| 天堂va蜜桃一区二区三区漫画版| 91美女片黄在线观看91美女| 亚洲视频一区二区在线观看| 国产福利91精品一区| 精品电影一区二区| 久久国产婷婷国产香蕉| 91精品国产综合久久国产大片| 亚洲一区日韩精品中文字幕| 色偷偷88欧美精品久久久| 国产欧美日韩三级| 国产成人午夜片在线观看高清观看| 日韩欧美在线网站| 另类小说综合欧美亚洲| 51久久夜色精品国产麻豆| 亚洲尤物视频在线| 欧美性生活大片视频| 亚洲va韩国va欧美va精品| 欧美视频在线一区二区三区 | 国产精品国产三级国产普通话蜜臀 | 国产酒店精品激情| 久久色中文字幕| 国产成人免费视频网站高清观看视频| 久久综合狠狠综合久久综合88| 国产精品一区二区久激情瑜伽| 亚洲精品一区二区在线观看| 国产91精品在线观看| 国产亚洲欧洲997久久综合 | 中文字幕一区在线| 色综合视频在线观看| 亚洲综合一二三区| 6080亚洲精品一区二区| 久久国产婷婷国产香蕉| 欧美激情在线看| 91精彩视频在线观看| 午夜久久电影网| 精品国免费一区二区三区| 国产sm精品调教视频网站| 亚洲欧美影音先锋| 欧美精品18+| 国产精品一二三在| 亚洲精品成a人| 日韩欧美亚洲国产另类| 国产1区2区3区精品美女| 亚洲精品少妇30p| 日韩精品一区二区三区在线播放| 丁香一区二区三区| 亚洲午夜电影在线观看| 精品福利av导航| 一本大道久久a久久精品综合| 日本vs亚洲vs韩国一区三区二区| 久久伊人蜜桃av一区二区| 91免费在线播放| 精品制服美女久久| 一区二区国产视频| 久久久久久日产精品| 日本电影亚洲天堂一区| 久久精品噜噜噜成人av农村| 亚洲另类春色校园小说| 亚洲va国产va欧美va观看| 亚洲第一会所有码转帖| 欧美va亚洲va香蕉在线| 夜色激情一区二区| 顶级嫩模精品视频在线看| 免费成人美女在线观看.| 久久国产乱子精品免费女| 捆绑紧缚一区二区三区视频| 日本中文在线一区| 日韩激情一二三区| 日韩成人一级大片| 韩日精品视频一区| 福利一区二区在线观看| www.欧美日韩国产在线| 色系网站成人免费| 欧美美女bb生活片| 欧美一级免费大片| 久久婷婷成人综合色| 中文字幕亚洲区| 亚洲图片欧美视频| 九九九精品视频| 成人av网站大全| 欧美揉bbbbb揉bbbbb| 欧美一三区三区四区免费在线看| 精品第一国产综合精品aⅴ| 国产精品乱码一区二区三区软件| 亚洲黄色性网站| 美腿丝袜亚洲三区| 成人a区在线观看| 欧美日韩在线播| 久久久久88色偷偷免费| 亚洲婷婷综合色高清在线| 亚洲超丰满肉感bbw| 国产一区 二区 三区一级| 91天堂素人约啪| 日韩视频免费观看高清完整版在线观看 | 亚洲美女在线一区| 天天综合色天天综合色h| 国产一区二区免费看| 91麻豆精品秘密| 欧美成人高清电影在线| 中文字幕一区二区视频| 免费欧美在线视频| 色综合久久天天| wwwwxxxxx欧美| 亚洲午夜久久久久中文字幕久| 国产一区二区三区日韩 | 正在播放亚洲一区| 中文字幕国产精品一区二区| 婷婷综合久久一区二区三区| 成人在线综合网站| 欧美电影一区二区| 中文字幕制服丝袜一区二区三区| 人人狠狠综合久久亚洲| 99re这里只有精品首页| 久久亚洲精品小早川怜子| 无码av中文一区二区三区桃花岛| 不卡视频免费播放| 精品久久国产字幕高潮| 亚洲成人中文在线| 97se亚洲国产综合自在线观| 久久这里只有精品6| 日韩极品在线观看| 欧美视频一区二区三区四区 | 不卡视频一二三| 久久久久久久久久久电影| 日本中文字幕一区| 欧美日韩一区成人| 亚洲欧美日韩中文字幕一区二区三区 | 国产日韩欧美电影| 极品美女销魂一区二区三区免费| 欧美日韩亚洲综合| 最近中文字幕一区二区三区| 国产精品99久久久久久久女警| 日韩视频免费直播| 日韩精品一二区| 欧美剧情片在线观看| 亚洲午夜私人影院| 欧洲日韩一区二区三区| 亚洲精品你懂的| 一本大道久久精品懂色aⅴ| 日韩一区在线看| 色综合久久久久久久久久久| 亚洲欧美日韩在线播放| 99久久免费视频.com| 国产精品久久免费看| 成人精品视频.| 亚洲欧美在线视频| 色婷婷av一区二区三区gif| 亚洲美腿欧美偷拍| 在线看国产一区| 亚洲电影在线免费观看| 欧美日韩免费观看一区三区| 五月综合激情日本mⅴ| 欧美疯狂做受xxxx富婆| 日韩av中文在线观看| 日韩精品在线一区| 国产在线国偷精品免费看| 久久久久久夜精品精品免费| 高清日韩电视剧大全免费| 国产精品久久久久久久久动漫 | 久久66热re国产| 久久久久久久久久久99999| 国产高清久久久久| 国产精品久久久久久久久久免费看| av在线不卡网| 亚洲综合一区二区三区| 欧美日韩免费视频| 麻豆91精品视频| 久久一留热品黄| jvid福利写真一区二区三区| 亚洲欧美欧美一区二区三区| 在线不卡一区二区| 久久69国产一区二区蜜臀| 国产情人综合久久777777| 91天堂素人约啪| 日本不卡视频一二三区| 久久精品人人爽人人爽| 91色在线porny| 免费看欧美美女黄的网站| 国产亚洲精品bt天堂精选| 91黄色免费看| 韩国精品久久久| 亚洲久草在线视频|