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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? typechecker.java

?? 一個java方面的消息訂閱發送的源碼
?? 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.parser;

import org.exolab.jms.selector.Identifiers;
import org.exolab.jms.selector.Type;
import org.exolab.jms.selector.TypeMismatchException;


/**
 * Utility class for performing type checking
 *
 * @version     $Revision: 1.1 $ $Date: 2004/11/26 01:50:45 $
 * @author      <a href="mailto:tma@netspace.net.au">Tim Anderson</a>
 * @see         SelectorAST
 * @see         SelectorTreeParser
 * @see         Type
 * @see         TypeMismatchException
 */
final class TypeChecker {

    /**
     * Private constructor
     */
    private TypeChecker() {
    }

    /**
     * Checks the return type of an expression against the expected type
     *
     * @param node the expression node
     * @param expected the expected type of the expression
     * @throws TypeMismatchException if the return type doesn't match that
     * expected
     */
    public static void check(final SelectorAST node, final Type expected)
        throws TypeMismatchException {

        Type type = node.getReturnType();
        if (type != expected && type != Type.UNDEFINED) {
            String msg = "expecting a " + expected + " expression, found a "
                + type;
            throw new TypeMismatchException(node.getContext(), msg);
        }
    }

    /**
     * Checks the return type of an expression against the expected type
     *
     * @param operator the expression operator
     * @param node the expression node
     * @param expected the expected type of the expression
     * @throws TypeMismatchException if the return type doesn't match that
     * expected
     */
    public static void check(final String operator, final SelectorAST node,
                             final Type expected)
        throws TypeMismatchException {

        Type type = node.getReturnType();
        if (type != expected && type != Type.UNDEFINED) {
            String msg = "expecting a " + expected
                + " expression for operator " + operator + ", found a " + type;
            throw new TypeMismatchException(node.getContext(), msg);
        }
    }

    /**
     * Checks the types of left and right hand sides of an expression against
     * the expected type
     *
     * @param operator the expression operator
     * @param left the left hand side of the expression
     * @param right the right hand side of the expression
     * @param expected the expected type of the expression
     * @throws TypeMismatchException if a type doesn't match that expected
     */
    public static void check(final String operator, final SelectorAST left,
                             final SelectorAST right, final Type expected)
        throws TypeMismatchException {

        check(operator, left, expected);
        check(operator, right, expected);
    }

    /**
     * Verifies if two expressions can be compared
     *
     * @param operator the comparison operator
     * @param left the left hand side of the expression
     * @param right the right hand side of the expression
     * @throws TypeMismatchException if the expressions can't be compared
     */
    public static void checkComparison(final String operator,
                                       final SelectorAST left,
                                       final SelectorAST right)
        throws TypeMismatchException {

        Type lhs = left.getReturnType();
        Type rhs = right.getReturnType();

        if (lhs == Type.UNDEFINED || rhs == Type.UNDEFINED) {
            // can't evaluate this at parse time.
        } else if (lhs == Type.STRING && rhs == Type.STRING) {
            checkStringComparison(operator, left, right);
        } else if ((lhs == Type.STRING && rhs != Type.STRING)
                   || (lhs == Type.BOOLEAN && rhs != Type.BOOLEAN)
                   || (lhs == Type.NUMERIC && rhs != Type.NUMERIC)) {
            String msg = "expecting a " + lhs + " expression for operator "
                + operator + ", found a " + rhs;
            throw new TypeMismatchException(right.getContext(), msg);
        }
    }

    /**
     * Verifies if two string expressions can be compared
     *
     * @param operator the comparison operator
     * @param left the left hand side of the expression
     * @param right the right hand side of the expression
     * @throws TypeMismatchException if the expressions can't be compared
     */
    public static void checkStringComparison(final String operator,
                                             final SelectorAST left,
                                             final SelectorAST right)
        throws TypeMismatchException {
        if (left.getType() == SelectorTokenTypes.IDENT
            && right.getType() == SelectorTokenTypes.STRING_LITERAL) {
            checkIdentifierComparison(left, right);
        } else if (left.getType() == SelectorTokenTypes.STRING_LITERAL
                   && right.getType() == SelectorTokenTypes.IDENT) {
            checkIdentifierComparison(right, left);
        }
    }

    /**
     * Verifies that an identifier may be compared to a string literal
     *
     * @param identifier the identifier
     * @param literal the string literal
     * @throws TypeMismatchException if the expressions can't be compared
     */
    public static void checkIdentifierComparison(final SelectorAST identifier,
                                                 final SelectorAST literal)
        throws TypeMismatchException {
        if (identifier.getText().equals(Identifiers.JMS_DELIVERY_MODE)) {
            String value = literal.getText();
            if (!value.equals(Identifiers.PERSISTENT)
                && !value.equals(Identifiers.NON_PERSISTENT)) {
                String msg = "Cannot compare JMSDeliveryMode with '"
                    + value + "'";
                throw new TypeMismatchException(identifier.getContext(), msg);
            }
        }
    }

} //-- TypeChecker

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
高清国产一区二区| 国产成人免费在线观看| 欧美日韩一卡二卡三卡| 视频在线观看91| 欧美电影免费观看高清完整版在线| 日韩av在线免费观看不卡| 日韩欧美中文一区二区| 狠狠色丁香婷婷综合| 国产精品超碰97尤物18| 91久久免费观看| 视频一区二区国产| 26uuu国产电影一区二区| 波多野结衣视频一区| 一区二区在线观看免费| 日韩一级大片在线观看| 成人永久免费视频| 亚洲一区二区三区四区中文字幕| 欧美日韩精品一区二区三区蜜桃| 久久不见久久见免费视频7| 国产精品色噜噜| 欧美日本一区二区三区| 高清国产一区二区| 亚洲国产乱码最新视频 | 欧美视频在线播放| 毛片av一区二区| 中文一区在线播放| 欧美另类一区二区三区| 高清国产一区二区| 日韩av一区二区在线影视| 中文字幕精品一区二区精品绿巨人| 欧美亚洲自拍偷拍| 国产一区二区三区在线看麻豆 | 亚洲综合一二区| 亚洲精品在线网站| 欧洲亚洲国产日韩| 粉嫩一区二区三区性色av| 亚洲高清视频中文字幕| 国产精品无圣光一区二区| 欧美理论在线播放| 91网站最新地址| 国产精品综合一区二区| 亚洲va欧美va天堂v国产综合| 国产欧美日韩卡一| 欧美一区二区久久久| 色综合天天综合网国产成人综合天| 久久精品国产精品亚洲综合| 一区二区三区欧美亚洲| 欧美国产精品一区| 欧美成人激情免费网| 欧美日精品一区视频| av高清不卡在线| 国产一区91精品张津瑜| 日韩黄色片在线观看| 有坂深雪av一区二区精品| 国产精品美女一区二区在线观看| 精品日韩一区二区| 91麻豆精品国产自产在线观看一区| 99久久婷婷国产综合精品| 国产98色在线|日韩| 精品在线播放午夜| 蜜臀av亚洲一区中文字幕| 爽好久久久欧美精品| 亚洲成人免费影院| 亚洲一区二区三区四区在线观看 | 国产99久久精品| 精品一二三四在线| 久久精品国产一区二区| 麻豆精品视频在线观看视频| 午夜久久电影网| 天天综合日日夜夜精品| 午夜亚洲国产au精品一区二区| 亚洲在线成人精品| 亚洲一区中文日韩| 亚洲欧美另类综合偷拍| 亚洲乱码国产乱码精品精可以看 | 亚洲成a人片在线观看中文| 亚洲精品国产成人久久av盗摄| 亚洲欧洲99久久| 国产精品国产三级国产aⅴ原创 | 91影院在线观看| 91亚洲精品一区二区乱码| 91蝌蚪porny九色| 99r精品视频| 91久久精品网| 7777精品伊人久久久大香线蕉最新版| 欧美日韩一二区| 91精品国产色综合久久不卡蜜臀| 欧美一区二区三区四区高清 | 国产99精品国产| 成人avav在线| 91国产免费观看| 91麻豆精品国产自产在线| 精品国产青草久久久久福利| 国产亚洲欧美在线| 亚洲乱码国产乱码精品精的特点| 一区二区不卡在线播放 | 亚洲午夜免费电影| 毛片av一区二区三区| 国产精品99久久久久久似苏梦涵 | 粉嫩蜜臀av国产精品网站| 99久久99久久精品免费看蜜桃| 色婷婷综合在线| 91精品国模一区二区三区| 久久久综合九色合综国产精品| 国产精品毛片高清在线完整版| 一区二区高清免费观看影视大全 | 亚洲专区一二三| 老司机免费视频一区二区三区| 国产精品 欧美精品| 91国模大尺度私拍在线视频| 欧美一区二区在线播放| 国产拍欧美日韩视频二区| 亚洲精品国产成人久久av盗摄| 日本sm残虐另类| 91小视频免费看| 精品免费国产一区二区三区四区| 自拍av一区二区三区| 美日韩一区二区| 91麻豆蜜桃一区二区三区| 日韩精品一区二区在线| 亚洲欧美另类小说视频| 国产一区二区三区电影在线观看 | 久久国内精品自在自线400部| 成人国产电影网| 欧美电视剧在线看免费| 亚洲激情六月丁香| 国产一区三区三区| 欧美日韩久久久| 亚洲私人黄色宅男| 国产呦萝稀缺另类资源| 欧美精品久久天天躁| 亚洲女人****多毛耸耸8| 久久99国内精品| 欧美日韩精品欧美日韩精品一| 国产精品初高中害羞小美女文| 久久精品国产精品亚洲红杏| 在线影视一区二区三区| 国产精品色一区二区三区| 久久99久久久久久久久久久| 日本高清不卡在线观看| 国产欧美精品区一区二区三区| 日韩国产欧美在线观看| 在线观看区一区二| 国产精品不卡在线| 国产成人av电影在线观看| 日韩亚洲国产中文字幕欧美| 亚洲午夜久久久| 色综合久久综合| 亚洲欧美一区二区三区久本道91| 国产精品影视在线| 欧美变态tickle挠乳网站| 日韩电影在线一区| 欧美日韩1234| 亚洲v日本v欧美v久久精品| 91传媒视频在线播放| 亚洲免费在线观看| 色综合一区二区| 亚洲欧美日韩电影| 一本一道久久a久久精品综合蜜臀| 中文字幕欧美国产| 东方aⅴ免费观看久久av| 国产日韩av一区| 成人精品国产福利| 国产精品久久久久久亚洲伦| 不卡一区在线观看| 亚洲欧美日韩系列| 在线观看三级视频欧美| 亚洲成人一区在线| 91麻豆精品国产91久久久 | 久久久亚洲综合| 国产成人av影院| 国产精品久久久久四虎| 91丝袜国产在线播放| 一区二区三区欧美视频| 欧美另类一区二区三区| 蜜桃视频免费观看一区| 久久嫩草精品久久久久| 懂色av噜噜一区二区三区av| 日韩美女啊v在线免费观看| 91女厕偷拍女厕偷拍高清| 一区二区三区在线观看欧美| 色综合天天狠狠| 日日夜夜精品免费视频| 欧美mv日韩mv国产| 成人免费视频视频在线观看免费| 国产精品国产三级国产三级人妇 | 成人av小说网| 亚洲综合色视频| 制服丝袜av成人在线看| 国产一区二区三区蝌蚪| 亚洲桃色在线一区| 欧美人与z0zoxxxx视频| 国内精品伊人久久久久av一坑| 国产日韩欧美a| 欧美色精品天天在线观看视频| 卡一卡二国产精品 | 亚洲美女一区二区三区| 91精品国产入口| 国产高清成人在线| 亚洲香肠在线观看|