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

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

?? wildcardhelper.java

?? struts的源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * $Id: WildcardHelper.java 54929 2004-10-16 16:38:42Z germuska $ 
 *
 * Copyright 2003-2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 
package org.apache.struts.util;

import java.util.Map;

/**
 * This class is an utility class that perform wilcard-patterns matching and
 * isolation taken from Apache Cocoon.
 *
 * @since Struts 1.2
 * @version $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
 */
public class WildcardHelper {

    /** The int representing '*' in the pattern <code>int []</code>. */
    protected static final int MATCH_FILE = -1;
    
    /** The int representing '**' in the pattern <code>int []</code>. */
    protected static final int MATCH_PATH = -2;
    
    /** The int representing begin in the pattern <code>int []</code>. */
    protected static final int MATCH_BEGIN = -4;
    
    /** The int representing end in pattern <code>int []</code>. */
    protected static final int MATCH_THEEND = -5;
    
    /** The int value that terminates the pattern <code>int []</code>. */
    protected static final int MATCH_END = -3;


    /**
     * Translate the given <code>String</code> into a <code>int []</code>
     * representing the pattern matchable by this class.
     * <br>
     * This function translates a <code>String</code> into an int array
     * converting the special '*' and '\' characters.
     * <br>
     * Here is how the conversion algorithm works:
     * <ul>
     *   <li>The '*' character is converted to MATCH_FILE, meaning that zero
     *        or more characters (excluding the path separator '/') are to
     *        be matched.</li>
     *   <li>The '**' sequence is converted to MATCH_PATH, meaning that zero
     *       or more characters (including the path separator '/') are to
     *        be matched.</li>
     *   <li>The '\' character is used as an escape sequence ('\*' is
     *       translated in '*', not in MATCH_FILE). If an exact '\' character
     *       is to be matched the source string must contain a '\\'.
     *       sequence.</li>
     * </ul>
     * When more than two '*' characters, not separated by another character,
     * are found their value is considered as '**' (MATCH_PATH).
     * <br>
     * The array is always terminated by a special value (MATCH_END).
     * <br>
     * All MATCH* values are less than zero, while normal characters are equal
     * or greater.
     *
     * @param data The string to translate.
     * @return The encoded string as an int array, terminated by the MATCH_END
     *         value (don't consider the array length).
     * @exception NullPointerException If data is null.
     */
    public int[] compilePattern(String data) {

        // Prepare the arrays
        int expr[] = new int[data.length() + 2];
        char buff[] = data.toCharArray();

        // Prepare variables for the translation loop
        int y = 0;
        boolean slash = false;

        // Must start from beginning
        expr[y++] = MATCH_BEGIN;

        if (buff.length > 0) {
            if (buff[0] == '\\') {
                slash = true;
            } else if (buff[0] == '*') {
                expr[y++] = MATCH_FILE;
            }  else {
                expr[y++] = buff[0];
            }

            // Main translation loop
            for (int x = 1; x < buff.length; x++) {
                // If the previous char was '\' simply copy this char.
                if (slash) {
                    expr[y++] = buff[x];
                    slash = false;
                // If the previous char was not '\' we have to do a bunch of 
                // checks
                } else {
                    // If this char is '\' declare that and continue
                    if (buff[x] == '\\') {
                        slash = true;
                    // If this char is '*' check the previous one
                    } else if (buff[x] == '*') {
                        // If the previous character als was '*' match a path
                        if (expr[y - 1] <= MATCH_FILE) {
                            expr[y - 1] = MATCH_PATH;
                        } else {
                            expr[y++] = MATCH_FILE;
                        }
                    } else {
                        expr[y++] = buff[x];
                    }
                }
            }
        }

        // Must match end at the end
        expr[y] = MATCH_THEEND;
        return expr;
    }

    /**
     * Match a pattern agains a string and isolates wildcard replacement into a
     * <code>Stack</code>.
     *
     * @param map  The map to store matched values
     * @param data The string to match
     * @param expr The compiled wildcard expression
     * @return True if a match
     * @throws NullPointerException If any parameters are null
     */
    public boolean match(Map map, String data, int[] expr) {
        if (map == null) {
            throw new NullPointerException ("No map provided");
        }    
        if (data == null) {
            throw new NullPointerException ("No data provided");
        }    
        if (expr == null) {
            throw new NullPointerException ("No pattern expression provided");
        }    


        char buff[] = data.toCharArray();
        // Allocate the result buffer
        char rslt[] = new char[expr.length + buff.length];


        // The previous and current position of the expression character
        // (MATCH_*)
        int charpos = 0;

        // The position in the expression, input, translation and result arrays
        int exprpos = 0;
        int buffpos = 0;
        int rsltpos = 0;
        int offset = -1;

        // The matching count
        int mcount = 0;

        // We want the complete data be in {0}
        map.put(Integer.toString(mcount), data);

        // First check for MATCH_BEGIN
        boolean matchBegin = false;
        if (expr[charpos] == MATCH_BEGIN) {
            matchBegin = true;
            exprpos = ++charpos;
        }

        // Search the fist expression character (except MATCH_BEGIN - already 
        // skipped)
        while (expr[charpos] >= 0) {
            charpos++;
        }    

        // The expression charater (MATCH_*)
        int exprchr = expr[charpos];

        while (true) {
            // Check if the data in the expression array before the current
            // expression character matches the data in the input buffer
            if (matchBegin) {
                if (!matchArray(expr, exprpos, charpos, buff, buffpos)) {
                    return (false);
                }    
                matchBegin = false;
            } else {
                offset = indexOfArray (expr, exprpos, charpos, buff,
                        buffpos);
                if (offset < 0) {
                    return (false);
                }    
            }

            // Check for MATCH_BEGIN
            if (matchBegin) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天性综合| 日本一区二区三区电影| 26uuu亚洲综合色| 亚洲视频一区二区在线观看| 石原莉奈一区二区三区在线观看| 久久精品国产一区二区| 成人免费毛片aaaaa**| 欧美日韩五月天| 国产女主播一区| 日韩成人午夜精品| 99久久精品国产精品久久| 这里是久久伊人| 久久久五月婷婷| 日韩和欧美的一区| 99re这里只有精品6| 日韩免费性生活视频播放| 日韩理论片中文av| 国产成人福利片| 精品国产三级a在线观看| 亚洲成人av福利| 91视频国产观看| www.在线成人| 91在线观看高清| 久久久久久久久久久久久女国产乱 | 在线亚洲+欧美+日本专区| 蜜臀99久久精品久久久久久软件 | 中文字幕av一区二区三区| 日本亚洲三级在线| 欧美区视频在线观看| 亚洲视频中文字幕| 色狠狠av一区二区三区| 国产精品狼人久久影院观看方式| 国模一区二区三区白浆| 精品国产一区久久| 国内精品嫩模私拍在线| 2021国产精品久久精品| 狠狠色综合色综合网络| 亚洲精品一区二区三区香蕉| 国内精品伊人久久久久av一坑| 日韩午夜激情av| 极品美女销魂一区二区三区免费| 26uuu亚洲综合色欧美| 国产露脸91国语对白| 久久九九影视网| 欧美一区二区日韩一区二区| 久久久国产一区二区三区四区小说| 久久机这里只有精品| 26uuu亚洲婷婷狠狠天堂| 国产成人精品一区二| 中文字幕在线不卡视频| 一本色道亚洲精品aⅴ| 亚洲一区二区不卡免费| 欧美人体做爰大胆视频| 久久99国产精品久久99果冻传媒| 欧美xxxxx牲另类人与| 国产精品 日产精品 欧美精品| 国产精品视频一二三| 91黄色小视频| 免费高清在线一区| 中文字幕av免费专区久久| 91久久精品网| 久久精品理论片| 综合av第一页| 欧美一区二区三区日韩| 国产精品主播直播| 一区二区三区日本| 91精品国产一区二区人妖| 国产传媒欧美日韩成人| 一区二区三区免费网站| 日韩三级视频在线看| 国产91丝袜在线播放九色| 一区二区三区中文在线观看| 中文字幕一区二区视频| 亚洲精品日韩专区silk| 日韩一级片在线观看| 成人av在线播放网站| 五月天丁香久久| 欧美高清在线精品一区| 欧美二区乱c少妇| 盗摄精品av一区二区三区| 亚洲在线观看免费视频| 国产清纯白嫩初高生在线观看91 | 2017欧美狠狠色| 色偷偷成人一区二区三区91| 精品一区免费av| 亚洲成av人片观看| 日韩一区日韩二区| 久久欧美中文字幕| 91麻豆精品国产91久久久久| 91在线观看地址| 国产精品 日产精品 欧美精品| 天天色图综合网| 欧美国产一区二区| 欧美一区二区三区视频在线 | 久久九九久久九九| 欧美色窝79yyyycom| 处破女av一区二区| 国精品**一区二区三区在线蜜桃| 亚洲成人免费观看| ...av二区三区久久精品| 国产午夜亚洲精品羞羞网站| 日韩一级免费观看| 欧美日韩国产首页| 在线观看三级视频欧美| 97久久人人超碰| 成人在线一区二区三区| 久久精品久久综合| 奇米亚洲午夜久久精品| 亚洲777理论| 亚洲激情图片qvod| 亚洲欧美综合另类在线卡通| 中文字幕不卡在线| 欧美韩国日本不卡| 国产视频在线观看一区二区三区| 欧美一区永久视频免费观看| 欧美喷潮久久久xxxxx| 欧美日韩精品系列| 色狠狠综合天天综合综合| 91亚洲男人天堂| 成人福利视频网站| 99久久综合色| 日本久久一区二区三区| 91免费看`日韩一区二区| 91女厕偷拍女厕偷拍高清| 欧美mv日韩mv国产网站app| 午夜婷婷国产麻豆精品| 午夜精品福利一区二区蜜股av | 成人app网站| 国产成人精品免费在线| 国产东北露脸精品视频| 国产成人高清视频| 成人网男人的天堂| 欧美日韩国产综合一区二区| 奇米影视一区二区三区小说| 亚洲综合免费观看高清完整版 | 一区二区三区日韩精品视频| 国产aⅴ综合色| 7777女厕盗摄久久久| 中文字幕一区二区三区精华液| 亚洲午夜激情网页| 成人app在线| 中文字幕日韩一区| 国产福利一区二区| 久久精品人人做| 久久精品国产秦先生| 欧美少妇性性性| 亚洲亚洲精品在线观看| 成人在线视频一区二区| 日韩欧美一级二级| 视频一区视频二区中文字幕| 777亚洲妇女| 三级影片在线观看欧美日韩一区二区| 色激情天天射综合网| 亚洲激情欧美激情| 欧美日韩一区不卡| 久久精品久久久精品美女| 日韩精品一区二区三区在线观看| 久久精品久久99精品久久| 精品国产99国产精品| 日韩欧美黄色影院| 亚洲已满18点击进入久久| 色素色在线综合| 视频一区二区欧美| 中文字幕一区二区三区四区| 成人精品视频一区二区三区尤物| 一区二区三区四区不卡视频| 欧美tickling挠脚心丨vk| 成人av一区二区三区| 国产精品中文字幕欧美| 国产盗摄一区二区| 成人美女视频在线看| 国产精品国产成人国产三级 | 亚洲成av人片在线| 欧美日韩精品久久久| 国产精品久线在线观看| 91蝌蚪porny| 捆绑调教一区二区三区| 欧美肥妇free| 麻豆专区一区二区三区四区五区| 99久久99久久久精品齐齐| 色老头久久综合| 中文一区二区在线观看| 国产一区二区三区免费在线观看| 欧美猛男男办公室激情| 狠狠色狠狠色综合| 欧美激情一区二区三区蜜桃视频| 色婷婷一区二区| 国产精品网站导航| 欧美午夜在线观看| 91浏览器入口在线观看| 精品对白一区国产伦| 亚洲va国产天堂va久久en| 91老师国产黑色丝袜在线| 欧美高清在线一区| 国产精品亚洲专一区二区三区 | 欧美高清在线视频| 蜜桃精品视频在线| 4438x成人网最大色成网站| 一区二区三区中文字幕电影| 色综合夜色一区|