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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? booleanarrayconverter.java

?? 這是一個有關(guān)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.converters;


import java.util.List;
import org.apache.commons.beanutils.ConversionException;


/**
 * <p>Standard {@link org.apache.commons.beanutils.Converter} implementation that converts an incoming
 * String into a primitive array of boolean.  On a conversion failure, returns
 * a specified default value or throws a {@link ConversionException} depending
 * on how this instance is constructed.</p>
 *
 * <p>By default, the values to be converted are expected to be those
 * recognised by a default instance of BooleanConverter. A customised
 * BooleanConverter can be provided in order to recognise alternative values
 * as true/false. </p>
 *
 * @author Craig R. McClanahan
 * @version $Revision: 556229 $ $Date: 2007-07-14 07:11:19 +0100 (Sat, 14 Jul 2007) $
 * @since 1.4
 * @deprecated Replaced by the new {@link ArrayConverter} implementation
 */

public final class BooleanArrayConverter extends AbstractArrayConverter {


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


    /**
     * Create a {@link org.apache.commons.beanutils.Converter} that will throw
     * a {@link ConversionException} if a conversion error occurs.
     *
     * <p>Conversion of strings to boolean values will be done via a default
     * instance of class BooleanConverter.</p>
     */
    public BooleanArrayConverter() {

        super();
        this.booleanConverter = DEFAULT_CONVERTER;

    }


    /**
     * Create a {@link org.apache.commons.beanutils.Converter} that will return
     * the specified default value if a conversion error occurs.
     *
     * <p>Conversion of strings to boolean values will be done via a default
     * instance of class BooleanConverter.</p>
     *
     * @param defaultValue The default value to be returned
     */
    public BooleanArrayConverter(Object defaultValue) {

        super(defaultValue);
        this.booleanConverter = DEFAULT_CONVERTER;

    }


    /**
     * Create a {@link org.apache.commons.beanutils.Converter} that will return
     * the specified default value if a conversion error occurs.
     *
     * <p>Conversion of strings to boolean values will be done via the
     * specified converter.</p>
     *
     * @param converter is the converter object that will be used to
     *  convert each input string-value into a boolean.
     *
     * @param defaultValue is the default value to be returned by method
     * convert if conversion fails; null is a valid default value. See the
     * documentation for method "convert" for more information.
     * The value BooleanArrayConverter.NO_DEFAULT may be passed here to
     * specify that an exception should be thrown on conversion failure.
     *  
     */
    public BooleanArrayConverter(BooleanConverter converter, Object defaultValue) {

        super(defaultValue);
        this.booleanConverter = converter;

    }

    // ------------------------------------------------------- Static Variables

    /**
     * Type which this class converts its input to. This value can be
     * used as a parameter to the ConvertUtils.register method.
     */
    public static final Class MODEL = new boolean[0].getClass();

    /**
     * The converter that all instances of this class will use to
     * do individual string->boolean conversions, unless overridden
     * in the constructor.
     */
    private static final BooleanConverter DEFAULT_CONVERTER
        = new BooleanConverter();

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

    /**
     * This object is used to perform the conversion of individual strings
     * into Boolean/boolean values.
     */
    protected final BooleanConverter booleanConverter;

    // --------------------------------------------------------- Public Methods


    /**
     * Convert the specified input object into an output object of type
     * array-of-boolean.
     * 
     * <p>If the input value is null, then the default value specified in the
     * constructor is returned. If no such value was provided, then a
     * ConversionException is thrown instead.</p>
     *
     * <p>If the input value is of type String[] then the returned array shall
     * be of the same size as this array, with a true or false value in each
     * array element depending on the result of applying method
     * BooleanConverter.convert to each string.</p>
     *
     * <p>For all other types of value, the object's toString method is
     * expected to return a string containing a comma-separated list of
     * values, eg "true, false, true". See the documentation for
     * {@link AbstractArrayConverter#parseElements} for more information on
     * the exact formats supported.</p>
     *
     * <p>If the result of value.toString() cannot be split into separate
     * words, then the default value is also returned (or an exception thrown).
     * </p>
     *
     * <p>If any of the elements in the value array (or the elements resulting
     * from splitting up value.toString) are not recognised by the
     * BooleanConverter associated with this object, then what happens depends
     * on whether that BooleanConverter has a default value or not: if it does, 
     * then that unrecognised element is converted into the BooleanConverter's
     * default value. If the BooleanConverter does <i>not</i> have a default
     * value, then the default value for this object is returned as the
     * <i>complete</i> conversion result (not just for the element), or an 
     * exception is thrown if this object has no default value defined.</p>
     *
     * @param type is the type to which this value should be converted. In the
     *  case of this BooleanArrayConverter class, this value is ignored.
     *
     * @param value is the input value to be converted.
     *
     * @return an object of type boolean[], or the default value if there was
     *  any sort of error during conversion and the constructor
     *  was provided with a default value.
     *
     * @exception ConversionException if conversion cannot be performed
     *  successfully and the constructor was not provided with a default
     *  value to return on conversion failure.
     *
     * @exception NullPointerException if value is an array, and any of the
     * array elements are null.
     */
    public Object convert(Class type, Object value) {

        // Deal with a null value
        if (value == null) {
            if (useDefault) {
                return (defaultValue);
            } else {
                throw new ConversionException("No value specified");
            }
        }

        // Deal with the no-conversion-needed case
        if (MODEL == value.getClass()) {
            return (value);
        }

        // Deal with input value as a String array
        //
        // TODO: use if (value.getClass().isArray() instead...
        //  this requires casting to Object[], then using values[i].toString()
        if (strings.getClass() == value.getClass()) {
            try {
                String[] values = (String[]) value;
                boolean[] results = new boolean[values.length];
                for (int i = 0; i < values.length; i++) {
                    String stringValue = values[i];
                    Object result = booleanConverter.convert(Boolean.class, stringValue);
                    results[i] = ((Boolean) result).booleanValue();
                }
                return (results);
            } catch (Exception e) {
                if (useDefault) {
                    return (defaultValue);
                } else {
                    throw new ConversionException(value.toString(), e);
                }
            }
        }

        // We only get here if the input value is not of type String[].
        // In this case, we assume value.toString() returns a comma-separated
        // sequence of values; see method AbstractArrayConverter.parseElements
        // for more information.
        try {
            List list = parseElements(value.toString());
            boolean[] results = new boolean[list.size()];
            for (int i = 0; i < results.length; i++) {
                String stringValue = (String) list.get(i);
                Object result = booleanConverter.convert(Boolean.class, stringValue);
                results[i] = ((Boolean) result).booleanValue();
            }
            return (results);
        } catch (Exception e) {
            if (useDefault) {
                return (defaultValue);
            } else {
                throw new ConversionException(value.toString(), e);
            }
        }

    }


}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产无套在线观| 欧美视频在线播放| 久久99久久久欧美国产| 最新日韩av在线| 亚洲欧洲日韩综合一区二区| 精品国一区二区三区| 国产成人综合自拍| 国产一区二区精品久久| 亚洲理论在线观看| 精品国产三级电影在线观看| 国产精品嫩草影院av蜜臀| 欧美日韩在线三级| 天堂av在线一区| 国产精品1024| 国产精品视频第一区| 1024成人网| 色综合久久久网| 亚洲不卡av一区二区三区| 成人毛片视频在线观看| 亚洲欧美偷拍卡通变态| 色综合久久久久| 日韩精品久久理论片| 26uuu久久综合| 99久久婷婷国产综合精品| 视频一区视频二区中文| 欧美日韩一区二区三区四区| 综合久久久久综合| 色综合激情久久| 欧美国产欧美综合| 91福利精品视频| 九九视频精品免费| 亚洲欧美日韩精品久久久久| 日韩一区国产二区欧美三区| 国产精品主播直播| 中国色在线观看另类| 丝袜a∨在线一区二区三区不卡| 日韩一区二区免费电影| av在线不卡电影| 久久精品免费观看| 亚洲在线中文字幕| 国产午夜亚洲精品羞羞网站| 欧美一级搡bbbb搡bbbb| 99v久久综合狠狠综合久久| 午夜精品aaa| 亚洲欧美日韩一区| 中文字幕欧美国产| 一区免费观看视频| 精品久久人人做人人爰| 欧美日韩在线观看一区二区| 不卡在线观看av| 高清不卡一二三区| 激情六月婷婷久久| 丝袜美腿成人在线| 免费高清视频精品| 捆绑紧缚一区二区三区视频| 视频在线观看一区| 日韩精彩视频在线观看| 亚洲成人资源在线| 五月婷婷激情综合网| 亚洲成av人片一区二区三区| 亚洲成人免费电影| 日本美女一区二区三区| 免费成人在线视频观看| 亚洲成a人片综合在线| 午夜亚洲国产au精品一区二区| 亚洲一区二区三区美女| 日韩电影一区二区三区| 麻豆91小视频| 成人性生交大合| 色天使色偷偷av一区二区| 欧美日韩精品是欧美日韩精品| 欧美精品久久一区| 欧美精品一区二区三区在线 | 国产精品久久久久久久久搜平片| 日韩精品一区二区三区视频播放 | 色综合久久66| 欧美区在线观看| 欧美日韩国产免费一区二区 | 精品一区二区av| 91亚洲永久精品| 欧美日韩aaaaaa| 亚洲国产高清不卡| 亚洲欧美日韩综合aⅴ视频| 亚洲制服欧美中文字幕中文字幕| 午夜日韩在线电影| 麻豆精品在线播放| 99精品视频在线观看| 欧美日韩在线免费视频| 日韩久久久精品| 亚洲一二三四在线观看| 国产成都精品91一区二区三| 欧美丰满高潮xxxx喷水动漫| 亚洲乱码国产乱码精品精的特点 | 午夜免费久久看| a美女胸又www黄视频久久| 7799精品视频| 亚洲一区二区三区四区在线观看| 成人的网站免费观看| 91精品免费在线| 精品国产乱码久久久久久老虎| 亚洲激情在线播放| 精品一区二区三区免费观看 | 99久久婷婷国产精品综合| 久久综合九色综合欧美就去吻 | 激情综合色播激情啊| 欧美日韩久久不卡| 日韩中文字幕亚洲一区二区va在线 | 欧美亚洲尤物久久| 一区二区三区视频在线看| 成人激情动漫在线观看| 欧美不卡在线视频| 国产精一品亚洲二区在线视频| 久久婷婷国产综合精品青草| 国产精品资源在线看| 国产精品丝袜一区| 91麻豆产精品久久久久久 | 高清不卡在线观看| 亚洲黄色尤物视频| 在线播放欧美女士性生活| 蜜桃久久av一区| 中文一区在线播放| 91丨porny丨户外露出| 亚洲国产日韩在线一区模特| 欧美日韩免费电影| 免费av网站大全久久| 欧美国产乱子伦| 欧美精品免费视频| 成人av在线资源| 久久99热99| 一区二区三区在线影院| 国产色91在线| 欧美日本不卡视频| 成人激情小说网站| 亚洲第一精品在线| 国产日本欧美一区二区| 欧美日韩国产片| 在线视频你懂得一区二区三区| 激情综合五月天| 午夜欧美电影在线观看| 中文乱码免费一区二区| 在线电影院国产精品| 欧美日韩亚洲不卡| 色噜噜偷拍精品综合在线| 国产.精品.日韩.另类.中文.在线.播放| 亚洲成人免费看| 亚洲免费视频中文字幕| 亚洲欧洲韩国日本视频| 国产精品沙发午睡系列990531| 精品免费国产一区二区三区四区| 日韩三级视频在线看| 91久久免费观看| 欧美视频一区二区三区在线观看| 在线看日本不卡| 欧美日韩成人激情| 91精品国产一区二区三区| 精品国产三级电影在线观看| 2023国产一二三区日本精品2022| 精品欧美久久久| 国产午夜精品一区二区三区嫩草| 国产日本亚洲高清| 国产精品女同一区二区三区| 亚洲视频在线一区二区| 亚洲色图丝袜美腿| 国产亚洲一区二区三区四区| 亚洲欧美日韩国产手机在线| 亚洲综合免费观看高清完整版 | 亚洲一级二级在线| 婷婷开心久久网| 久久99精品视频| 国产伦精品一区二区三区视频青涩| 一本色道久久综合亚洲aⅴ蜜桃| 欧美三级中文字| 久久九九国产精品| 亚洲视频在线一区二区| 老司机精品视频线观看86 | 亚洲一区二区在线免费观看视频| 亚洲精品国产品国语在线app| 国产一区二区成人久久免费影院| av资源网一区| 精品噜噜噜噜久久久久久久久试看| 亚洲欧洲av在线| 亚洲一区二区美女| 91在线视频在线| 久久青草欧美一区二区三区| 一区二区国产视频| 国产夫妻精品视频| 久久综合久久久久88| 青青国产91久久久久久| 欧美亚一区二区| 综合自拍亚洲综合图不卡区| 喷白浆一区二区| 欧美一区二区三区啪啪| 午夜视频一区二区三区| 欧美在线影院一区二区| 中文字幕色av一区二区三区| av一区二区三区黑人| 欧美国产一区二区| 国产乱码精品一区二区三区忘忧草 | 国产精品一区一区| 91精品国产乱|