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

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

?? propertysetter.java

?? log4j的源碼
?? JAVA
字號:
/* * Copyright 1999-2005 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. */// Contributors:  Georg Lundesgaardpackage org.apache.log4j.config;import java.beans.Introspector;import java.beans.PropertyDescriptor;import java.beans.BeanInfo;import java.beans.IntrospectionException;import java.lang.reflect.*;import java.util.*;import org.apache.log4j.*;import org.apache.log4j.helpers.LogLog;import org.apache.log4j.helpers.OptionConverter;import org.apache.log4j.spi.OptionHandler;/**   General purpose Object property setter. Clients repeatedly invokes   {@link #setProperty setProperty(name,value)} in order to invoke setters   on the Object specified in the constructor. This class relies on the   JavaBeans {@link Introspector} to analyze the given Object Class using   reflection.      <p>Usage:   <pre>     PropertySetter ps = new PropertySetter(anObject);     ps.set("name", "Joe");     ps.set("age", "32");     ps.set("isMale", "true");   </pre>   will cause the invocations anObject.setName("Joe"), anObject.setAge(32),   and setMale(true) if such methods exist with those signatures.   Otherwise an {@link IntrospectionException} are thrown.     @author Anders Kristensen   @since 1.1 */public class PropertySetter {  protected Object obj;  protected PropertyDescriptor[] props;    /**    Create a new PropertySetter for the specified Object. This is done    in prepartion for invoking {@link #setProperty} one or more times.        @param obj  the object for which to set properties   */  public  PropertySetter(Object obj) {    this.obj = obj;  }    /**     Uses JavaBeans {@link Introspector} to computer setters of object to be     configured.   */  protected  void introspect() {    try {      BeanInfo bi = Introspector.getBeanInfo(obj.getClass());      props = bi.getPropertyDescriptors();    } catch (IntrospectionException ex) {      LogLog.error("Failed to introspect "+obj+": " + ex.getMessage());      props = new PropertyDescriptor[0];    }  }    /**     Set the properties of an object passed as a parameter in one     go. The <code>properties</code> are parsed relative to a     <code>prefix</code>.     @param obj The object to configure.     @param properties A java.util.Properties containing keys and values.     @param prefix Only keys having the specified prefix will be set.  */  public  static  void setProperties(Object obj, Properties properties, String prefix) {    new PropertySetter(obj).setProperties(properties, prefix);  }    /**     Set the properites for the object that match the     <code>prefix</code> passed as parameter.        */  public  void setProperties(Properties properties, String prefix) {    int len = prefix.length();        for (Enumeration e = properties.propertyNames(); e.hasMoreElements(); ) {      String key = (String) e.nextElement();            // handle only properties that start with the desired frefix.      if (key.startsWith(prefix)) {		// ignore key if it contains dots after the prefix        if (key.indexOf('.', len + 1) > 0) {	  //System.err.println("----------Ignoring---["+key	  //	     +"], prefix=["+prefix+"].");	  continue;	}        	String value = OptionConverter.findAndSubst(key, properties);        key = key.substring(len);        if ("layout".equals(key) && obj instanceof Appender) {          continue;        }                setProperty(key, value);      }    }    activate();  }    /**     Set a property on this PropertySetter's Object. If successful, this     method will invoke a setter method on the underlying Object. The     setter is the one for the specified property name and the value is     determined partly from the setter argument type and partly from the     value specified in the call to this method.          <p>If the setter expects a String no conversion is necessary.     If it expects an int, then an attempt is made to convert 'value'     to an int using new Integer(value). If the setter expects a boolean,     the conversion is by new Boolean(value).          @param name    name of the property     @param value   String value of the property   */  public  void setProperty(String name, String value) {    if (value == null) return;        name = Introspector.decapitalize(name);    PropertyDescriptor prop = getPropertyDescriptor(name);        //LogLog.debug("---------Key: "+name+", type="+prop.getPropertyType());    if (prop == null) {      LogLog.warn("No such property [" + name + "] in "+		  obj.getClass().getName()+"." );    } else {      try {        setProperty(prop, name, value);      } catch (PropertySetterException ex) {        LogLog.warn("Failed to set property [" + name +                    "] to value \"" + value + "\". ", ex.rootCause);      }    }  }    /**       Set the named property given a {@link PropertyDescriptor}.      @param prop A PropertyDescriptor describing the characteristics      of the property to set.      @param name The named of the property to set.      @param value The value of the property.         */  public  void setProperty(PropertyDescriptor prop, String name, String value)    throws PropertySetterException {    Method setter = prop.getWriteMethod();    if (setter == null) {      throw new PropertySetterException("No setter for property ["+name+"].");    }    Class[] paramTypes = setter.getParameterTypes();    if (paramTypes.length != 1) {      throw new PropertySetterException("#params for setter != 1");    }        Object arg;    try {      arg = convertArg(value, paramTypes[0]);    } catch (Throwable t) {      throw new PropertySetterException("Conversion to type ["+paramTypes[0]+					"] failed. Reason: "+t);    }    if (arg == null) {      throw new PropertySetterException(          "Conversion to type ["+paramTypes[0]+"] failed.");    }    LogLog.debug("Setting property [" + name + "] to [" +arg+"].");    try {      setter.invoke(obj, new Object[]  { arg });    } catch (Exception ex) {      throw new PropertySetterException(ex);    }  }    /**     Convert <code>val</code> a String parameter to an object of a     given type.  */  protected  Object convertArg(String val, Class type) {    if(val == null)      return null;    String v = val.trim();    if (String.class.isAssignableFrom(type)) {      return val;    } else if (Integer.TYPE.isAssignableFrom(type)) {      return new Integer(v);    } else if (Long.TYPE.isAssignableFrom(type)) {      return new Long(v);    } else if (Boolean.TYPE.isAssignableFrom(type)) {      if ("true".equalsIgnoreCase(v)) {        return Boolean.TRUE;      } else if ("false".equalsIgnoreCase(v)) {        return Boolean.FALSE;      }    } else if (Priority.class.isAssignableFrom(type)) {      return OptionConverter.toLevel(v, (Level) Level.DEBUG);    }    return null;  }      protected  PropertyDescriptor getPropertyDescriptor(String name) {    if (props == null) introspect();        for (int i = 0; i < props.length; i++) {      if (name.equals(props[i].getName())) {	return props[i];      }    }    return null;  }    public  void activate() {    if (obj instanceof OptionHandler) {      ((OptionHandler) obj).activateOptions();    }  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91蝌蚪porny| 色婷婷狠狠综合| 久久久不卡影院| 国产成人精品亚洲777人妖| 久久精品在线免费观看| 国产精品 日产精品 欧美精品| 日韩理论片一区二区| 91视频国产资源| 五月婷婷欧美视频| 精品精品国产高清一毛片一天堂| 欧美xxxxx裸体时装秀| 精品亚洲成a人| 国产亚洲一二三区| 9i在线看片成人免费| 亚洲国产一区二区a毛片| 91精品久久久久久久91蜜桃| 国产一区二区0| 亚洲欧美偷拍三级| 日韩一级免费观看| 成人激情免费电影网址| 一区二区三区欧美| 精品国产区一区| 91麻豆国产自产在线观看| 亚洲123区在线观看| 国产日韩精品久久久| 欧美日韩亚洲另类| 国产成人精品在线看| 一片黄亚洲嫩模| 久久久久久久久久久久电影| 国产精品国产三级国产普通话蜜臀 | 亚洲男女一区二区三区| 777a∨成人精品桃花网| 成人黄色国产精品网站大全在线免费观看| 欧美日韩一区二区不卡| 国产一区二区三区不卡在线观看| 欧美日韩亚洲综合| 国产精品一级黄| 天堂久久久久va久久久久| 国产免费观看久久| 日韩三级高清在线| 在线观看不卡一区| 99久久精品99国产精品| 黑人精品欧美一区二区蜜桃| 亚洲影院免费观看| 亚洲国产成人一区二区三区| 日韩一级免费观看| 欧美日韩国产高清一区| 99久久99久久精品免费观看| 国产一区二区视频在线| 无吗不卡中文字幕| 一区二区三区在线免费| 日本一区二区三区四区在线视频 | 欧美一级高清片在线观看| 99riav一区二区三区| 狠狠色丁香久久婷婷综| 亚洲一级二级三级在线免费观看| 69成人精品免费视频| 欧美在线一区二区三区| 大胆欧美人体老妇| 国产成人在线视频免费播放| 久草中文综合在线| 免费成人小视频| 三级久久三级久久| 亚洲成人免费av| 一区二区三区在线视频免费| 亚洲欧美日韩一区二区| 国产精品国产自产拍高清av| 中文字幕av一区二区三区| 久久久久88色偷偷免费| 久久久久久久久久久久电影| 精品美女一区二区三区| 精品国产亚洲一区二区三区在线观看| 国产精品亚洲视频| 久久99国产精品麻豆| 久久精品国产精品亚洲综合| 日韩av高清在线观看| 日本欧美久久久久免费播放网| 久久麻豆一区二区| 国产清纯白嫩初高生在线观看91 | 国产蜜臀97一区二区三区| 久久久精品国产免大香伊| 久久综合久久综合亚洲| 久久精品一区四区| 2023国产一二三区日本精品2022| 日本韩国一区二区三区视频| 色婷婷激情综合| 在线观看国产精品网站| 欧美精品少妇一区二区三区| 91麻豆精品国产91久久久 | 亚洲午夜精品在线| 香蕉加勒比综合久久| 日韩精品乱码免费| 国产自产视频一区二区三区| 成人在线视频一区| 欧美亚日韩国产aⅴ精品中极品| 国产一区二区三区在线观看免费视频| 樱花草国产18久久久久| 亚洲自拍都市欧美小说| 日本欧美韩国一区三区| 国产一区二区三区免费看| 99精品视频在线播放观看| 在线观看亚洲精品| 精品少妇一区二区三区在线播放| 欧美三级资源在线| 精品国产乱码久久久久久蜜臀 | 亚洲欧洲av另类| 亚洲成人1区2区| 国产一区视频网站| eeuss鲁片一区二区三区在线看| 久久不见久久见免费视频7 | 国产精品毛片久久久久久久| 国产精品免费视频网站| 亚洲成人高清在线| 国产精品亚洲一区二区三区在线 | 视频在线在亚洲| 国产不卡在线视频| 欧美三级三级三级| 久久久久久电影| 亚洲动漫第一页| 盗摄精品av一区二区三区| 欧美午夜精品一区| 久久久亚洲精品石原莉奈| 亚洲激情自拍偷拍| 激情综合网激情| 色诱亚洲精品久久久久久| 日韩一区二区三区电影| 自拍偷拍欧美精品| 国模大尺度一区二区三区| 在线免费一区三区| 中日韩av电影| 日本aⅴ精品一区二区三区| 一本高清dvd不卡在线观看| 久久午夜色播影院免费高清| 亚洲成人自拍一区| 91免费在线播放| 久久精品一区二区三区不卡牛牛 | 精品黑人一区二区三区久久| 中文字幕一区二区三区在线观看| 中文字幕制服丝袜一区二区三区| 国产亚洲短视频| 毛片av一区二区三区| 欧美调教femdomvk| 综合久久给合久久狠狠狠97色| 亚洲三级在线看| 国产成人在线看| 精品国产91亚洲一区二区三区婷婷| 欧美成人一区二区三区片免费| 精品少妇一区二区三区视频免付费| 日韩一区二区电影| 午夜久久久久久久久久一区二区| 日韩电影在线一区二区三区| 日本精品一级二级| 亚洲图片你懂的| av动漫一区二区| 日本一区二区成人| 国产成人免费在线| 国产亚洲综合在线| 国产精品一色哟哟哟| 精品国产一区二区三区不卡| 久久精品国内一区二区三区| 在线不卡的av| 奇米色一区二区| 91精品免费在线观看| 亚洲妇女屁股眼交7| 欧美丰满一区二区免费视频 | 日本不卡视频在线观看| 在线观看欧美精品| 一区二区三区电影在线播| 91天堂素人约啪| 亚洲女与黑人做爰| 色婷婷久久99综合精品jk白丝| 日韩视频中午一区| 精品在线一区二区三区| 久久久久成人黄色影片| 成人三级在线视频| 亚洲视频1区2区| 欧美日韩精品系列| 天堂成人免费av电影一区| 日韩欧美一区中文| 国产精品一区二区视频| 国产精品毛片久久久久久| 99国产精品久久久久| 一区二区三区中文在线| 欧美高清一级片在线| 久久成人羞羞网站| 欧美激情一区二区三区全黄| 91麻豆福利精品推荐| 婷婷开心激情综合| 久久久www成人免费无遮挡大片| 亚洲一级电影视频| 91精品国产一区二区三区蜜臀| 中文字幕一区不卡| 欧美日免费三级在线| 久久91精品国产91久久小草| 久久午夜电影网| 91麻豆免费观看| 蜜桃视频一区二区三区| 中文字幕亚洲成人| 91麻豆精品国产自产在线观看一区| 玉米视频成人免费看|