1 3 package jodd.bean; 4 5 import jodd.introspector.DefaultIntrospector; 6 import jodd.introspector.ClassDescriptor; 7 8 16 public class BeanProperty { 17 18 BeanProperty(Object bean, String propertyName) { 19 this.name = propertyName; 20 setBean(bean); 21 last = true; 22 } 23 24 26 Object bean; 27 ClassDescriptor cd; 28 29 32 public void setBean(Object bean) { 33 this.bean = bean; 34 this.cd = (bean == null ? null : DefaultIntrospector.lookup(bean.getClass())); 35 } 36 37 40 public Object getBean() { 41 return bean; 42 } 43 46 public ClassDescriptor getClassDescriptor() { 47 return cd; 48 } 49 50 52 String name; 53 54 57 public String getName() { 58 return name; 59 } 60 61 64 public void setName(String name) { 65 this.name = name; 66 } 67 68 70 boolean last; 71 72 public boolean isLast() { 73 return last; 74 } 75 76 public void setLast(boolean last) { 77 this.last = last; 78 } 79 80 82 public String toString() { 83 return bean.getClass().getName() + '#' + name; 84 } 85 } 86 | Popular Tags |