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

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

?? propertiesparser.java

?? Java中非常實用流控制工具
?? JAVA
字號:
/* 
 * Copyright 2004-2005 OpenSymphony 
 * 
 * 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.
 * 
 */

/*
 * Previously Copyright (c) 2001-2004 James House
 */
package org.quartz.utils;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Properties;
import java.util.StringTokenizer;

/**
 * <p>
 * This is an utility calss used to parse the properties.
 * </p>
 * 
 * @author James House
 */
public class PropertiesParser {

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * 
     * Data members.
     * 
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    Properties props = null;

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * 
     * Constructors.
     * 
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    public PropertiesParser(Properties props) {
        this.props = props;
    }

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * 
     * Interface.
     * 
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    public Properties getUnderlyingProperties() {
        return props;
    }

    /**
     * Get the trimmed String value of the property with the given 
     * <code>name</code>.  If the value the empty String (after
     * trimming), then it returns null.
     */
    public String getStringProperty(String name) {
        return getStringProperty(name, null);
    }

    /**
     * Get the trimmed String value of the property with the given 
     * <code>name</code> or the given default value if the value is 
     * null or empty after trimming.
     */
    public String getStringProperty(String name, String def) {
        String val = props.getProperty(name, def);
        if (val == null) {
            return def;
        }
        
        val = val.trim();
        
        return (val.length() == 0) ? def : val;
    }

    public String[] getStringArrayProperty(String name) {
        return getStringArrayProperty(name, null);
    }

    public String[] getStringArrayProperty(String name, String[] def) {
        String vals = getStringProperty(name);
        if (vals == null) {
            return def;
        }

        StringTokenizer stok = new StringTokenizer(vals, ",");
        ArrayList strs = new ArrayList();
        try {
            while (stok.hasMoreTokens()) {
                strs.add(stok.nextToken().trim());
            }
            
            return (String[])strs.toArray(new String[strs.size()]);
        } catch (Exception e) {
            return def;
        }
    }

    public boolean getBooleanProperty(String name) {
        return getBooleanProperty(name, false);
    }

    public boolean getBooleanProperty(String name, boolean def) {
        String val = getStringProperty(name);
        
        return (val == null) ? def : Boolean.valueOf(val).booleanValue();
    }

    public byte getByteProperty(String name) throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            throw new NumberFormatException(" null string");
        }

        try {
            return Byte.parseByte(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public byte getByteProperty(String name, byte def)
        throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            return def;
        }

        try {
            return Byte.parseByte(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public char getCharProperty(String name) {
        return getCharProperty(name, '\0');
    }

    public char getCharProperty(String name, char def) {
        String param = getStringProperty(name);
        return  (param == null) ? def : param.charAt(0);
    }

    public double getDoubleProperty(String name) throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            throw new NumberFormatException(" null string");
        }

        try {
            return Double.parseDouble(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public double getDoubleProperty(String name, double def)
        throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            return def;
        }

        try {
            return Double.parseDouble(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public float getFloatProperty(String name) throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            throw new NumberFormatException(" null string");
        }

        try {
            return Float.parseFloat(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public float getFloatProperty(String name, float def)
        throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            return def;
        }

        try {
            return Float.parseFloat(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public int getIntProperty(String name) throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            throw new NumberFormatException(" null string");
        }

        try {
            return Integer.parseInt(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public int getIntProperty(String name, int def)
        throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            return def;
        }

        try {
            return Integer.parseInt(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public int[] getIntArrayProperty(String name) throws NumberFormatException {
        return getIntArrayProperty(name, null);
    }

    public int[] getIntArrayProperty(String name, int[] def)
        throws NumberFormatException {
        String vals = getStringProperty(name);
        if (vals == null) {
            return def;
        }

        StringTokenizer stok = new StringTokenizer(vals, ",");
        ArrayList ints = new ArrayList();
        try {
            while (stok.hasMoreTokens()) {
                try {
                    ints.add(new Integer(stok.nextToken().trim()));
                } catch (NumberFormatException nfe) {
                    throw new NumberFormatException(" '" + vals + "'");
                }
            }
                        
            int[] outInts = new int[ints.size()];
            for (int i = 0; i < ints.size(); i++) {
                outInts[i] = ((Integer)ints.get(i)).intValue();
            }
            return outInts;
        } catch (Exception e) {
            return def;
        }
    }

    public long getLongProperty(String name) throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            throw new NumberFormatException(" null string");
        }

        try {
            return Long.parseLong(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public long getLongProperty(String name, long def)
        throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            return def;
        }

        try {
            return Long.parseLong(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public short getShortProperty(String name) throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            throw new NumberFormatException(" null string");
        }

        try {
            return Short.parseShort(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public short getShortProperty(String name, short def)
        throws NumberFormatException {
        String val = getStringProperty(name);
        if (val == null) {
            return def;
        }

        try {
            return Short.parseShort(val);
        } catch (NumberFormatException nfe) {
            throw new NumberFormatException(" '" + val + "'");
        }
    }

    public String[] getPropertyGroups(String prefix) {
        Enumeration keys = props.propertyNames();
        HashSet groups = new HashSet(10);

        if (!prefix.endsWith(".")) {
            prefix += ".";
        }

        while (keys.hasMoreElements()) {
            String key = (String) keys.nextElement();
            if (key.startsWith(prefix)) {
                String groupName = key.substring(prefix.length(), key.indexOf(
                        '.', prefix.length()));
                groups.add(groupName);
            }
        }

        return (String[]) groups.toArray(new String[groups.size()]);
    }

    public Properties getPropertyGroup(String prefix) {
        return getPropertyGroup(prefix, false, null);
    }

    public Properties getPropertyGroup(String prefix, boolean stripPrefix) {
        return getPropertyGroup(prefix, stripPrefix, null);
    }

    /**
     * Get all properties that start with the given prefix.  
     * 
     * @param prefix The prefix for which to search.  If it does not end in 
     *      a "." then one will be added to it for search purposes.
     * @param stripPrefix Whether to strip off the given <code>prefix</code>
     *      in the result's keys.
     * @param excludedPrefixes Optional array of fully qualified prefixes to
     *      exclude.  For example if <code>prefix</code> is "a.b.c", then 
     *      <code>excludedPrefixes</code> might be "a.b.c.ignore".
     *      
     * @return Group of <code>Properties</code> that start with the given prefix, 
     *      optionally have that prefix removed, and do not include properties 
     *      that start with one of the given excluded prefixes.
     */
    public Properties getPropertyGroup(String prefix, boolean stripPrefix, String[] excludedPrefixes) {
        Enumeration keys = props.propertyNames();
        Properties group = new Properties();

        if (!prefix.endsWith(".")) {
            prefix += ".";
        }

        while (keys.hasMoreElements()) {
            String key = (String) keys.nextElement();
            if (key.startsWith(prefix)) {
                
                boolean exclude = false;
                if (excludedPrefixes != null) {
                    for (int i = 0; (i < excludedPrefixes.length) && (exclude == false); i++) {
                        exclude = key.startsWith(excludedPrefixes[i]);
                    }
                }

                if (exclude == false) {
                    String value = getStringProperty(key, "");
                    
                    if (stripPrefix) { 
                        group.put(key.substring(prefix.length()), value);
                    } else {
                        group.put(key, value);
                    }
                }
            }
        }

        return group;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频在线永久播放| 99久久精品免费| 日韩免费高清av| 国产一区二区三区在线观看免费 | 日本91福利区| 在线不卡中文字幕播放| 精品一区二区三区不卡| 久久久久免费观看| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 欧美视频一二三区| 奇米色一区二区| 中文幕一区二区三区久久蜜桃| 成人免费观看视频| 亚洲高清一区二区三区| 欧美xfplay| 91麻豆高清视频| 午夜精品一区在线观看| 久久综合狠狠综合| 91片黄在线观看| 蜜臀av一区二区在线免费观看 | 久久99精品国产| 亚洲免费三区一区二区| 欧美乱熟臀69xxxxxx| 国产盗摄一区二区| 亚洲高清三级视频| 久久久午夜精品| 欧美三级中文字| 懂色av一区二区三区免费观看| 洋洋av久久久久久久一区| 日韩欧美中文一区二区| 97精品国产露脸对白| 免费久久99精品国产| 1024成人网色www| 精品国产一二三| 欧美日韩在线播放一区| 国产精品一区在线观看乱码| 亚洲1区2区3区4区| 国产精品乱码久久久久久| 日韩一区二区视频在线观看| 色中色一区二区| 国产福利精品导航| 国产精品一区二区黑丝| 亚洲bt欧美bt精品777| 国产嫩草影院久久久久| 欧美一区二区黄| 精品1区2区3区| 99精品久久免费看蜜臀剧情介绍| 麻豆精品国产91久久久久久| 亚洲精品久久嫩草网站秘色| 日本一区二区三区dvd视频在线| 欧美人与z0zoxxxx视频| av午夜精品一区二区三区| 激情小说亚洲一区| 天天av天天翘天天综合网色鬼国产 | 久久国产生活片100| 亚洲成国产人片在线观看| 亚洲天堂福利av| 中文字幕精品一区| 久久精品人人做人人综合| 欧美不卡在线视频| 56国语精品自产拍在线观看| 色婷婷久久久久swag精品| av一二三不卡影片| 成人v精品蜜桃久久一区| 国产91综合网| 成人免费视频一区二区| 国产自产高清不卡| 国产精品一区二区不卡| 国产传媒一区在线| 国产老肥熟一区二区三区| 国内一区二区视频| 国产黄色精品网站| 懂色av一区二区三区免费看| 成人免费视频免费观看| 成人动漫一区二区| av一二三不卡影片| 日本丰满少妇一区二区三区| 91福利国产精品| 欧美日韩免费电影| 在线欧美日韩精品| 51精品秘密在线观看| 91精品国模一区二区三区| 日韩色视频在线观看| 欧美变态凌虐bdsm| 久久久高清一区二区三区| 中文在线资源观看网站视频免费不卡| 欧美国产97人人爽人人喊| 亚洲欧洲精品一区二区三区| 亚洲精品欧美综合四区| 亚洲福利视频一区二区| 美女视频黄 久久| 国产久卡久卡久卡久卡视频精品| 成人网男人的天堂| 色婷婷久久久亚洲一区二区三区| 欧美三级日韩三级| 亚洲视频在线观看一区| 亚洲一区二区三区四区五区中文 | 亚洲成人久久影院| 另类欧美日韩国产在线| 懂色av一区二区三区蜜臀| 99精品欧美一区二区三区小说| 欧洲精品在线观看| 日韩女优制服丝袜电影| 国产精品久久久久久福利一牛影视 | 国产精品久久毛片av大全日韩| 中文字幕中文在线不卡住| 亚洲一区二区视频| 国产传媒久久文化传媒| 亚洲五月六月丁香激情| 欧美一区二区三区系列电影| 亚洲午夜精品在线| 菠萝蜜视频在线观看一区| 一本大道av伊人久久综合| 中文字幕免费不卡| 日本高清成人免费播放| 舔着乳尖日韩一区| 欧美一区二区三区白人| 欧美日本在线视频| 欧美高清视频在线高清观看mv色露露十八 | 国产69精品久久久久毛片| 91极品美女在线| 日韩三级精品电影久久久| 亚洲人一二三区| 另类中文字幕网| 色美美综合视频| 久久蜜桃香蕉精品一区二区三区| 一区二区三区在线观看欧美| 国精品**一区二区三区在线蜜桃| 欧美综合一区二区| 国产精品人妖ts系列视频| 日韩成人一区二区三区在线观看| 成人动漫精品一区二区| 精品国产乱码久久久久久蜜臀| 有坂深雪av一区二区精品| 精品亚洲国内自在自线福利| 欧美三级视频在线| 亚洲视频在线一区观看| 极品少妇一区二区三区精品视频| 欧美伊人久久久久久久久影院| 国产精品美女www爽爽爽| 国产一区二区三区| 91精品国产综合久久久久久久| 亚洲视频在线一区| 成人激情文学综合网| 久久久综合九色合综国产精品| 首页国产丝袜综合| 精品视频在线看| 亚洲免费在线看| 波多野结衣在线aⅴ中文字幕不卡| 欧美v日韩v国产v| 奇米精品一区二区三区四区| 欧美日本一区二区在线观看| 亚洲色图制服诱惑| 91日韩一区二区三区| 国产精品的网站| 豆国产96在线|亚洲| 久久女同精品一区二区| 国内精品久久久久影院色| 日韩欧美一级特黄在线播放| 亚洲成人黄色影院| 欧美精品乱码久久久久久| 亚洲一区二区三区四区的| 欧美体内she精高潮| 亚洲国产成人av网| 337p亚洲精品色噜噜噜| 人禽交欧美网站| 日韩欧美亚洲国产另类| 久久超碰97中文字幕| 亚洲女同一区二区| 色综合欧美在线视频区| 一区二区三区久久久| 欧美三级中文字幕在线观看| 午夜精品久久久久久久久久久| 欧美日韩国产首页| 男女性色大片免费观看一区二区| 91精品国产91热久久久做人人| 奇米色一区二区| 久久久精品国产99久久精品芒果| 国产成人免费视| 亚洲手机成人高清视频| 欧美性欧美巨大黑白大战| 秋霞av亚洲一区二区三| 26uuu欧美日本| 成人少妇影院yyyy| 亚洲国产一区二区三区| 欧美电视剧在线看免费| 国产成都精品91一区二区三| 亚洲欧美日韩在线| 在线综合亚洲欧美在线视频| 久久99久久久久久久久久久| 国产日韩高清在线| 91亚洲精品久久久蜜桃| 日韩精品一级中文字幕精品视频免费观看 | 欧美精品乱码久久久久久| 久久99精品国产麻豆不卡| 一区在线中文字幕| 欧美日韩免费电影| 国产激情视频一区二区三区欧美 | 夜色激情一区二区| 日韩欧美中文一区二区|