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

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

?? parameterparser.java

?? < JavaME核心技術最佳實踐>>的全部源代碼
?? JAVA
字號:
/* * Copyright 2001-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.commons.fileupload;import java.util.HashMap;import java.util.Map;/** * A simple parser intended to parse sequences of name/value pairs. * Parameter values are exptected to be enclosed in quotes if they * contain unsafe characters, such as '=' characters or separators. * Parameter values are optional and can be omitted. * * <p> *  <code>param1 = value; param2 = "anything goes; really"; param3</code> * </p> * * @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a> */public class ParameterParser {    /**     * String to be parsed.     */    private char[] chars = null;    /**     * Current position in the string.     */    private int pos = 0;    /**     * Maximum position in the string.     */    private int len = 0;    /**     * Start of a token.     */    private int i1 = 0;    /**     * End of a token.     */    private int i2 = 0;    /**     * Whether names stored in the map should be converted to lower case.     */    private boolean lowerCaseNames = false;    /**     * Default ParameterParser constructor.     */    public ParameterParser() {        super();    }    /**     * Are there any characters left to parse?     *     * @return <tt>true</tt> if there are unparsed characters,     *         <tt>false</tt> otherwise.     */    private boolean hasChar() {        return this.pos < this.len;    }    /**     * A helper method to process the parsed token. This method removes     * leading and trailing blanks as well as enclosing quotation marks,     * when necessary.     *     * @param quoted <tt>true</tt> if quotation marks are expected,     *               <tt>false</tt> otherwise.     * @return the token     */    private String getToken(boolean quoted) {        // Trim leading white spaces        while ((i1 < i2) && (Character.isWhitespace(chars[i1]))) {            i1++;        }        // Trim trailing white spaces        while ((i2 > i1) && (Character.isWhitespace(chars[i2 - 1]))) {            i2--;        }        // Strip away quotation marks if necessary        if (quoted) {            if (((i2 - i1) >= 2)                && (chars[i1] == '"')                && (chars[i2 - 1] == '"')) {                i1++;                i2--;            }        }        String result = null;        if (i2 > i1) {            result = new String(chars, i1, i2 - i1);        }        return result;    }    /**     * Tests if the given character is present in the array of characters.     *     * @param ch the character to test for presense in the array of characters     * @param charray the array of characters to test against     *     * @return <tt>true</tt> if the character is present in the array of     *   characters, <tt>false</tt> otherwise.     */    private boolean isOneOf(char ch, final char[] charray) {        boolean result = false;        for (int i = 0; i < charray.length; i++) {            if (ch == charray[i]) {                result = true;                break;            }        }        return result;    }    /**     * Parses out a token until any of the given terminators     * is encountered.     *     * @param terminators the array of terminating characters. Any of these     * characters when encountered signify the end of the token     *     * @return the token     */    private String parseToken(final char[] terminators) {        char ch;        i1 = pos;        i2 = pos;        while (hasChar()) {            ch = chars[pos];            if (isOneOf(ch, terminators)) {                break;            }            i2++;            pos++;        }        return getToken(false);    }    /**     * Parses out a token until any of the given terminators     * is encountered outside the quotation marks.     *     * @param terminators the array of terminating characters. Any of these     * characters when encountered outside the quotation marks signify the end     * of the token     *     * @return the token     */    private String parseQuotedToken(final char[] terminators) {        char ch;        i1 = pos;        i2 = pos;        boolean quoted = false;        boolean charEscaped = false;        while (hasChar()) {            ch = chars[pos];            if (!quoted && isOneOf(ch, terminators)) {                break;            }            if (!charEscaped && ch == '"') {                quoted = !quoted;            }            charEscaped = (!charEscaped && ch == '\\');            i2++;            pos++;        }        return getToken(true);    }    /**     * Returns <tt>true</tt> if parameter names are to be converted to lower     * case when name/value pairs are parsed.     *     * @return <tt>true</tt> if parameter names are to be     * converted to lower case when name/value pairs are parsed.     * Otherwise returns <tt>false</tt>     */    public boolean isLowerCaseNames() {        return this.lowerCaseNames;    }    /**     * Sets the flag if parameter names are to be converted to lower case when     * name/value pairs are parsed.     *     * @param b <tt>true</tt> if parameter names are to be     * converted to lower case when name/value pairs are parsed.     * <tt>false</tt> otherwise.     */    public void setLowerCaseNames(boolean b) {        this.lowerCaseNames = b;    }    /**     * Extracts a map of name/value pairs from the given string. Names are     * expected to be unique.     *     * @param str the string that contains a sequence of name/value pairs     * @param separator the name/value pairs separator     *     * @return a map of name/value pairs     */    public Map parse(final String str, char separator) {        if (str == null) {            return new HashMap();        }        return parse(str.toCharArray(), separator);    }    /**     * Extracts a map of name/value pairs from the given array of     * characters. Names are expected to be unique.     *     * @param chars the array of characters that contains a sequence of     * name/value pairs     * @param separator the name/value pairs separator     *     * @return a map of name/value pairs     */    public Map parse(final char[] chars, char separator) {        if (chars == null) {            return new HashMap();        }        return parse(chars, 0, chars.length, separator);    }    /**     * Extracts a map of name/value pairs from the given array of     * characters. Names are expected to be unique.     *     * @param chars the array of characters that contains a sequence of     * name/value pairs     * @param offset - the initial offset.     * @param length - the length.     * @param separator the name/value pairs separator     *     * @return a map of name/value pairs     */    public Map parse(        final char[] chars,        int offset,        int length,        char separator) {        if (chars == null) {            return new HashMap();        }        HashMap params = new HashMap();        this.chars = chars;        this.pos = offset;        this.len = length;        String paramName = null;        String paramValue = null;        while (hasChar()) {            paramName = parseToken(new char[] {                    '=', separator });            paramValue = null;            if (hasChar() && (chars[pos] == '=')) {                pos++; // skip '='                paramValue = parseQuotedToken(new char[] {                        separator });            }            if (hasChar() && (chars[pos] == separator)) {                pos++; // skip separator            }            if ((paramName != null) && (paramName.length() > 0)) {                if (this.lowerCaseNames) {                    paramName = paramName.toLowerCase();                }                params.put(paramName, paramValue);            }        }        return params;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩激情视频在线观看| 成av人片一区二区| 99久久99久久精品免费看蜜桃| 色婷婷激情一区二区三区| 欧美一区二区视频在线观看 | 精品一区二区三区免费观看| 成人免费av在线| 欧美一级欧美一级在线播放| 中文字幕一区二区视频| 卡一卡二国产精品| 欧美四级电影网| 1000部国产精品成人观看| 激情综合网最新| 欧美一区二区三区免费大片 | 亚洲黄色av一区| 国产成人精品午夜视频免费| 欧美一级国产精品| 亚洲夂夂婷婷色拍ww47| av成人免费在线观看| 久久免费电影网| 久久福利资源站| 777a∨成人精品桃花网| 一区二区在线观看免费 | 日本欧美大码aⅴ在线播放| 91麻豆国产福利在线观看| 国产欧美精品一区二区三区四区| 日本成人在线网站| 国产欧美日韩另类视频免费观看| 午夜精品久久久久影视| 欧美日韩一级片在线观看| 亚洲啪啪综合av一区二区三区| 国产成人精品在线看| 久久久久亚洲蜜桃| 国产永久精品大片wwwapp | 色哟哟精品一区| 中文字幕亚洲区| av网站免费线看精品| 中文字幕免费一区| 大胆亚洲人体视频| 国产清纯在线一区二区www| 国产精品一区二区不卡| 久久伊99综合婷婷久久伊| 狠狠网亚洲精品| 久久久久久久精| 国产精品一区一区| 国产精品乱码一区二三区小蝌蚪| 国产成人av电影在线| 国产精品麻豆久久久| 92国产精品观看| 亚洲黄网站在线观看| 91福利区一区二区三区| 一区二区三区成人| 欧美三级乱人伦电影| 午夜亚洲福利老司机| 欧美一区三区四区| 国产成人av电影在线| 亚洲欧洲精品一区二区精品久久久 | 精品国产精品一区二区夜夜嗨| 精品一区二区在线播放| 亚洲国产高清aⅴ视频| 99久久精品国产观看| 一区二区三区不卡视频| 911精品国产一区二区在线| 麻豆91在线看| 欧美激情一区二区三区全黄| 一本大道久久a久久精品综合| 亚洲一区二区在线观看视频| 日韩一区二区三| 成人黄页毛片网站| 亚洲超碰精品一区二区| 综合中文字幕亚洲| 欧洲亚洲国产日韩| 另类欧美日韩国产在线| 日本一区二区不卡视频| 欧美亚洲精品一区| 国产一区二区三区日韩| 亚洲欧美日本在线| 日韩写真欧美这视频| 成人激情动漫在线观看| 午夜精品福利一区二区三区av| 欧美videossexotv100| 99精品视频一区| 日韩在线一二三区| 国产精品乱人伦| 6080yy午夜一二三区久久| 国产精品自在欧美一区| 一区二区三区在线视频免费| 欧美变态tickling挠脚心| 不卡一二三区首页| 全部av―极品视觉盛宴亚洲| 国产欧美va欧美不卡在线| 在线观看免费视频综合| 九色综合国产一区二区三区| 一区二区三区欧美视频| 久久久av毛片精品| 欧美日韩免费一区二区三区 | 国产精品一二三区| 亚洲777理论| 国产色产综合产在线视频| 欧美中文字幕一区二区三区| 久久99精品久久久久久| 一区二区三区四区亚洲| 亚洲精品一区在线观看| 色综合欧美在线视频区| 国产一区二区电影| 亚洲成人综合视频| 国产精品美女www爽爽爽| 日韩你懂的在线播放| 日本精品视频一区二区三区| 久久99国产精品免费| 亚洲一区在线观看免费| 国产精品水嫩水嫩| 精品国产三级a在线观看| 欧美日韩国产一级| 99久久99久久精品免费看蜜桃| 国产麻豆一精品一av一免费| 日韩中文字幕不卡| 亚洲国产毛片aaaaa无费看| 中文久久乱码一区二区| 中文在线一区二区| 麻豆精品新av中文字幕| 欧美一区二区精美| 亚洲福利视频三区| 亚洲国产精品99久久久久久久久| 3d成人动漫网站| 欧美亚洲国产一区二区三区va| 国产精品 日产精品 欧美精品| 日本不卡视频在线| 午夜电影一区二区三区| 一区二区三区日韩| 樱桃视频在线观看一区| 国产精品成人免费精品自在线观看| 欧美mv日韩mv亚洲| 欧美一级免费大片| 欧美一区二区久久| 日韩欧美亚洲另类制服综合在线| 欧美日韩国产电影| 欧美日韩国产经典色站一区二区三区| 色哟哟一区二区| 色婷婷综合久色| 91久久线看在观草草青青| 一本久道久久综合中文字幕| 99久久精品国产导航| 色久优优欧美色久优优| 91精品91久久久中77777| 在线视频综合导航| 欧美三级三级三级爽爽爽| 欧美日韩国产高清一区二区| 91精品视频网| 久久午夜色播影院免费高清| 欧美va亚洲va香蕉在线| 亚洲国产精品黑人久久久| 国产欧美日本一区二区三区| 亚洲视频免费在线观看| 亚洲图片一区二区| 国产高清不卡二三区| 福利电影一区二区| 色欧美88888久久久久久影院| 欧美色图在线观看| 日韩一区二区在线播放| 国产亚洲欧美在线| 国产精品国产自产拍高清av王其| 亚洲老妇xxxxxx| 天涯成人国产亚洲精品一区av| 日韩电影在线一区| 国产一区999| 一本一道波多野结衣一区二区| 欧美无砖砖区免费| 久久嫩草精品久久久久| 亚洲人xxxx| 麻豆久久久久久| 99re成人精品视频| 91麻豆精品国产91久久久久| 国产视频一区二区三区在线观看| 亚洲三级电影网站| 久久av资源站| 色香蕉久久蜜桃| 欧美不卡视频一区| 成人免费在线视频| 麻豆久久一区二区| 色综合久久88色综合天天6| 欧美一区日本一区韩国一区| 国产精品国产馆在线真实露脸| 亚洲bt欧美bt精品| 成人国产精品免费观看动漫| 欧美日本免费一区二区三区| 国产色产综合产在线视频| 午夜精彩视频在线观看不卡| 国产精品69毛片高清亚洲| 欧美日韩视频一区二区| 久久久精品综合| 免费成人你懂的| 色噜噜狠狠成人网p站| 久久综合久久鬼色中文字| 午夜国产不卡在线观看视频| 99久久精品国产毛片| 26uuu国产在线精品一区二区| 亚洲已满18点击进入久久| 国产精选一区二区三区| 日韩精品一区二区三区视频在线观看 |