1 16 package org.directwebremoting.convert; 17 18 import java.lang.reflect.Method ; 19 20 import org.directwebremoting.extend.MarshallException; 21 import org.directwebremoting.extend.Property; 22 import org.directwebremoting.util.Logger; 23 24 28 public class PlainProperty implements Property 29 { 30 34 public PlainProperty(String name, Object value) 35 { 36 this.name = name; 37 this.value = value; 38 } 39 40 43 public String getName() 44 { 45 return name; 46 } 47 48 51 public Class getPropertyType() 52 { 53 return value.getClass(); 54 } 55 56 59 public Method getSetter() 60 { 61 return null; 62 } 63 64 67 public Object getValue(Object bean) throws MarshallException 68 { 69 return value; 70 } 71 72 75 public void setValue(Object bean, Object value) throws MarshallException 76 { 77 log.warn("Attempt to setValue() on plain property."); 78 } 79 80 83 private String name; 84 85 88 private Object value; 89 90 93 private static final Logger log = Logger.getLogger(PlainProperty.class); 94 } 95 | Popular Tags |