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

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

?? stringlocaleconverter.java

?? 這是一個有關common beanutils 的源碼
?? JAVA
字號:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.beanutils.locale.converters;

import org.apache.commons.beanutils.locale.BaseLocaleConverter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;


/**
 * <p>Standard {@link org.apache.commons.beanutils.locale.LocaleConverter}
 * implementation that converts an incoming
 * locale-sensitive object into a <code>java.lang.String</code> object,
 * optionally using a default value or throwing a
 * {@link org.apache.commons.beanutils.ConversionException}
 * if a conversion error occurs.</p>
 *
 * @author Yauheny Mikulski
 */

public class StringLocaleConverter extends BaseLocaleConverter {

    // ----------------------------------------------------- Instance Variables

    /** All logging goes through this logger */
    private Log log = LogFactory.getLog(StringLocaleConverter.class);     //msz fix


    // ----------------------------------------------------------- Constructors

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will throw a {@link org.apache.commons.beanutils.ConversionException}
     * if a conversion error occurs. The locale is the default locale for
     * this instance of the Java Virtual Machine and an unlocalized pattern is used
     * for the convertion.
     *
     */
    public StringLocaleConverter() {

        this(false);
    }

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will throw a {@link org.apache.commons.beanutils.ConversionException}
     * if a conversion error occurs. The locale is the default locale for
     * this instance of the Java Virtual Machine.
     *
     * @param locPattern    Indicate whether the pattern is localized or not
     */
    public StringLocaleConverter(boolean locPattern) {

        this(Locale.getDefault(), locPattern);
    }

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will throw a {@link org.apache.commons.beanutils.ConversionException}
     * if a conversion error occurs. An unlocalized pattern is used for the convertion.
     *
     * @param locale        The locale
     */
    public StringLocaleConverter(Locale locale) {

        this(locale, false);
    }

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will throw a {@link org.apache.commons.beanutils.ConversionException}
     * if a conversion error occurs.
     *
     * @param locale        The locale
     * @param locPattern    Indicate whether the pattern is localized or not
     */
    public StringLocaleConverter(Locale locale, boolean locPattern) {

        this(locale, (String) null, locPattern);
    }

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will throw a {@link org.apache.commons.beanutils.ConversionException}
     * if a conversion error occurs. An unlocalized pattern is used for the convertion.
     *
     * @param locale        The locale
     * @param pattern       The convertion pattern
     */
    public StringLocaleConverter(Locale locale, String pattern) {

        this(locale, pattern, false);
    }

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will throw a {@link org.apache.commons.beanutils.ConversionException}
     * if a conversion error occurs.
     *
     * @param locale        The locale
     * @param pattern       The convertion pattern
     * @param locPattern    Indicate whether the pattern is localized or not
     */
    public StringLocaleConverter(Locale locale, String pattern, boolean locPattern) {

        super(locale, pattern, locPattern);
    }

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will return the specified default value
     * if a conversion error occurs. The locale is the default locale for
     * this instance of the Java Virtual Machine and an unlocalized pattern is used
     * for the convertion.
     *
     * @param defaultValue  The default value to be returned
     */
    public StringLocaleConverter(Object defaultValue) {

        this(defaultValue, false);
    }

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will return the specified default value
     * if a conversion error occurs. The locale is the default locale for
     * this instance of the Java Virtual Machine.
     *
     * @param defaultValue  The default value to be returned
     * @param locPattern    Indicate whether the pattern is localized or not
     */
    public StringLocaleConverter(Object defaultValue, boolean locPattern) {

        this(defaultValue, Locale.getDefault(), locPattern);
    }

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will return the specified default value
     * if a conversion error occurs. An unlocalized pattern is used for the convertion.
     *
     * @param defaultValue  The default value to be returned
     * @param locale        The locale
     */
    public StringLocaleConverter(Object defaultValue, Locale locale) {

        this(defaultValue, locale, false);
    }

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will return the specified default value
     * if a conversion error occurs.
     *
     * @param defaultValue  The default value to be returned
     * @param locale        The locale
     * @param locPattern    Indicate whether the pattern is localized or not
     */
    public StringLocaleConverter(Object defaultValue, Locale locale, boolean locPattern) {

        this(defaultValue, locale, null, locPattern);
    }

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will return the specified default value
     * if a conversion error occurs. An unlocalized pattern is used for the convertion.
     *
     * @param defaultValue  The default value to be returned
     * @param locale        The locale
     * @param pattern       The convertion pattern
     */
    public StringLocaleConverter(Object defaultValue, Locale locale, String pattern) {

        this(defaultValue, locale, pattern, false);
    }

    /**
     * Create a {@link org.apache.commons.beanutils.locale.LocaleConverter}
     * that will return the specified default value
     * if a conversion error occurs.
     *
     * @param defaultValue  The default value to be returned
     * @param locale        The locale
     * @param pattern       The convertion pattern
     * @param locPattern    Indicate whether the pattern is localized or not
     */
    public StringLocaleConverter(Object defaultValue, Locale locale, String pattern, boolean locPattern) {

        super(defaultValue, locale, pattern, locPattern);
    }

    // --------------------------------------------------------- Methods

    /**
     * Convert the specified locale-sensitive input object into an output object of the
     * specified type.
     *
     * @param value The input object to be converted
     * @param pattern The pattern is used for the convertion
     * @return The converted value
     *
     * @exception org.apache.commons.beanutils.ConversionException if conversion
     * cannot be performed successfully
     * @throws ParseException if an error occurs
     */
    protected Object parse(Object value, String pattern) throws ParseException {

        String result = null;

        if ((value instanceof Integer) ||
                (value instanceof Long) ||
                (value instanceof BigInteger) ||
                (value instanceof Byte) ||
                (value instanceof Short)) {

            result = getDecimalFormat(locale, pattern).format(((Number) value).longValue());
        }
        else if ((value instanceof Double) ||
                (value instanceof BigDecimal) ||
                (value instanceof Float)) {

            result = getDecimalFormat(locale, pattern).format(((Number) value).doubleValue());
        }
        else if (value instanceof Date) { // java.util.Date, java.sql.Date, java.sql.Time, java.sql.Timestamp

            SimpleDateFormat dateFormat =
                    new SimpleDateFormat(pattern, locale);

            result = dateFormat.format(value);
        }
        else {
            result = value.toString();
        }

        return result;
    }

    /**
     * Make an instance of DecimalFormat.
     *
     * @param locale The locale
     * @param pattern The pattern is used for the convertion
     * @return The format for the locale and pattern
     *
     * @exception ConversionException if conversion cannot be performed
     *  successfully
     * @throws ParseException if an error occurs parsing a String to a Number
     */
    private DecimalFormat getDecimalFormat(Locale locale, String pattern) {

        DecimalFormat numberFormat = (DecimalFormat) NumberFormat.getInstance(locale);

        // if some constructors default pattern to null, it makes only sense to handle null pattern gracefully
        if (pattern != null) {
            if (locPattern) {
                numberFormat.applyLocalizedPattern(pattern);
            } else {
                numberFormat.applyPattern(pattern);
            }
        } else {
            log.debug("No pattern provided, using default.");
        }

        return numberFormat;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩电影在线一区二区三区| 日韩三级伦理片妻子的秘密按摩| 日本免费在线视频不卡一不卡二| 一区二区三区自拍| 国产精品成人在线观看| 亚洲欧美日韩人成在线播放| 亚洲欧美中日韩| 一区二区三国产精华液| 洋洋av久久久久久久一区| 亚洲高清视频的网址| 午夜激情一区二区| 精品一区二区三区影院在线午夜| 国产真实乱对白精彩久久| 国产很黄免费观看久久| 99久久精品免费| 欧美丰满少妇xxxxx高潮对白| 欧美写真视频网站| 6080国产精品一区二区| 久久久九九九九| 亚洲欧美日韩在线| 日韩黄色片在线观看| 国产一区二区在线视频| 丁香六月综合激情| 91麻豆.com| 日韩欧美亚洲国产另类| 国产欧美日韩亚州综合| 午夜视频一区二区三区| 国产一区二区成人久久免费影院 | 欧美日韩一区在线观看| 91麻豆精品国产91久久久久久 | 欧美aa在线视频| 成人av在线播放网址| 欧美色精品在线视频| 精品久久一区二区三区| 亚洲精品欧美激情| 久久国内精品视频| 欧美午夜一区二区| 久久精品一区二区| 午夜一区二区三区在线观看| 国产精品综合网| 欧美色图天堂网| 欧美激情中文字幕一区二区| 香蕉加勒比综合久久| 成人动漫视频在线| 日韩美女一区二区三区| 亚洲综合免费观看高清完整版在线 | 国产精品一区一区| 7777精品伊人久久久大香线蕉的 | 精品久久久久久久久久久院品网| 亚洲欧美一区二区视频| 国产精品亚洲视频| 日韩午夜在线影院| 亚洲成人中文在线| 成人国产视频在线观看| 欧美一区二区国产| 伊人性伊人情综合网| 国产福利不卡视频| 欧美刺激脚交jootjob| 亚洲综合在线五月| 91农村精品一区二区在线| 国产天堂亚洲国产碰碰| 精品一二三四在线| 日韩一级精品视频在线观看| 亚洲高清一区二区三区| 欧美在线观看一区| 亚洲欧美电影院| 色琪琪一区二区三区亚洲区| 国产精品美女久久久久久久久久久 | 日韩一区国产二区欧美三区| 亚洲第一会所有码转帖| 色综合久久99| 亚洲精品欧美二区三区中文字幕| 波多野结衣视频一区| 椎名由奈av一区二区三区| av激情综合网| 亚洲综合色自拍一区| 欧美日韩在线播放三区| 日韩不卡一区二区| 精品日韩一区二区三区| 经典三级视频一区| 久久精品人人做人人综合| 国产成人在线视频网站| 中文字幕一区二区不卡| 91婷婷韩国欧美一区二区| 亚洲欧美激情插| 欧美精品777| 老司机午夜精品| 久久久精品欧美丰满| 成人a级免费电影| 亚洲一区二区三区爽爽爽爽爽| 欧美三级视频在线播放| 免费一级片91| 国产三级一区二区三区| 色偷偷久久一区二区三区| 亚洲国产综合在线| 精品日韩一区二区三区免费视频| 国产成人在线观看免费网站| 亚洲国产精品t66y| 欧美三级视频在线播放| 国产麻豆91精品| 亚洲欧美一区二区三区久本道91| 欧美丰满嫩嫩电影| 国产精品一卡二| 亚洲一区二区三区在线看| 欧美一级在线视频| www.亚洲色图.com| 午夜成人在线视频| 中文字幕av不卡| 在线不卡中文字幕播放| 高清beeg欧美| 日韩国产精品久久| 国产精品福利一区| 日韩免费看的电影| 91国内精品野花午夜精品| 韩国一区二区在线观看| 亚洲另类在线制服丝袜| 久久免费看少妇高潮| 欧美日韩视频专区在线播放| 国产99久久久久| 免费不卡在线视频| 亚洲最新视频在线观看| 欧美高清在线精品一区| 欧美肥胖老妇做爰| 欧美性猛交xxxx乱大交退制版 | 欧美亚洲精品一区| 懂色av一区二区三区免费看| 亚洲6080在线| 亚洲欧美综合网| 欧美激情中文字幕| 久久综合久色欧美综合狠狠| 欧美日韩国产色站一区二区三区| av一区二区三区黑人| 久88久久88久久久| 日韩电影免费在线观看网站| 一区二区三区影院| 综合色天天鬼久久鬼色| 欧美经典一区二区| 久久久综合视频| 欧美精品一区二区三区视频| 91精品国产色综合久久| 欧美日韩电影在线播放| 色婷婷精品久久二区二区蜜臂av | 亚洲444eee在线观看| 一区二区三区日韩精品| 亚洲欧洲日韩一区二区三区| 国产欧美日韩精品在线| 久久久三级国产网站| 欧美一区二区三区在线观看| 51久久夜色精品国产麻豆| 欧美福利视频导航| 日韩一区二区三区视频| 欧美一区二区三区免费在线看 | 日韩一区二区三区四区| 91精品国产综合久久久蜜臀图片| 91福利国产成人精品照片| 日本高清视频一区二区| 色婷婷精品大视频在线蜜桃视频| 99国产精品视频免费观看| 色综合中文字幕| 欧美在线观看视频一区二区 | 欧美一区二区三区喷汁尤物| 日韩视频免费观看高清完整版在线观看| 97精品电影院| 精品视频123区在线观看| 欧美久久久久中文字幕| 精品少妇一区二区三区在线播放| 久久综合狠狠综合| 国产欧美精品一区二区三区四区| 国产精品第一页第二页第三页| 中文字幕一区二| 亚洲h精品动漫在线观看| 狠狠v欧美v日韩v亚洲ⅴ| 成人久久18免费网站麻豆| 91久久久免费一区二区| 欧美一区二区三区免费视频| 欧美国产一区在线| 亚洲一区中文在线| 精品影视av免费| 99麻豆久久久国产精品免费| 欧美性xxxxxxxx| 久久伊人蜜桃av一区二区| 亚洲欧美日韩精品久久久久| 日韩不卡一区二区| 99在线精品一区二区三区| 欧美日韩成人一区| 中文字幕免费一区| 亚洲成人www| 国产91精品露脸国语对白| 欧美日韩在线一区二区| 久久久久久亚洲综合影院红桃| 综合色中文字幕| 激情综合网最新| 欧洲国内综合视频| 久久久99精品久久| 日韩av一区二区三区四区| 99视频一区二区| 久久久久久久久久久99999| 亚洲高清免费视频| 91日韩一区二区三区| 国产欧美综合在线观看第十页 |