BeanUtils

reading properties


import org.apache.commons.beanutils.PropertyUtils;

public class Prop {
  public static void main(String[] args) throws Exception {
    Bean0 b0 = new Bean0();
    PropertyUtils.setProperty(b0, "id", new Long(10));
    PropertyUtils.setProperty(b0, "name", "John");
    PropertyUtils.setProperty(b0, "age", 20);
    System.out.println(b0);
  }
}
最終更新:2006年03月06日 02:48
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。