예제 #1
0
 public void setAsText(String text) {
   if (text == null || text.indexOf(",") == -1) {
     throw new IllegalArgumentException("设置的字符串格式不正确");
   }
   String[] infos = text.split(",");
   Car car = new Car();
   car.setBrand(infos[0]);
   car.setMaxSpeed(Integer.parseInt(infos[1]));
   car.setPrice(Double.parseDouble(infos[2]));
   setValue(car);
 }
예제 #2
0
 public Object reimplement(Object arg0, Method arg1, Object[] arg2) throws Throwable {
   Car car = new Car();
   car.setBrand("美人豹");
   return car;
 }