1 16 17 package org.apache.commons.betwixt; 18 19 import org.apache.commons.beanutils.DynaBean; 20 import org.apache.commons.beanutils.DynaClass; 21 import org.apache.commons.beanutils.DynaProperty; 22 23 24 29 public class DynaWithDotBetwixt implements DynaBean { 30 31 private String notDynaProperty; 32 private String dynaProperty; 33 34 public DynaWithDotBetwixt() { 35 this("DEFAUL_NOT_DYNA", "DEFAULT_DYNA"); 36 } 37 38 39 public DynaWithDotBetwixt(String notDynaProperty, String dynaProperty) { 40 this.notDynaProperty = notDynaProperty; 41 this.dynaProperty = dynaProperty; 42 } 43 44 public String getNotDynaProperty() { 45 return notDynaProperty; 46 } 47 48 public String fiddleDyna() { 49 return dynaProperty; 50 } 51 52 public boolean contains(String name, String key) { 53 return false; 54 } 55 56 public Object get(String name) { 57 return dynaProperty; 58 } 59 60 public Object get(String name, int index) { 61 return dynaProperty; 62 } 63 64 public Object get(String name, String key) { 65 return dynaProperty; 66 } 67 68 public DynaClass getDynaClass() { 69 return new DynaClass() { 70 public DynaProperty[] getDynaProperties() { 71 DynaProperty[] properties = {new DynaProperty("DynaProp", String .class)}; 72 return properties; 73 } 74 75 public String getName() { 76 return "DynaWithDotBetwixtClass"; 77 } 78 79 public DynaBean newInstance() { 80 return new DynaWithDotBetwixt(); 81 } 82 83 public DynaProperty getDynaProperty(String name) { 84 if ("DynaProp".equals(name)) { 85 return new DynaProperty("DynaProp", String .class); 86 } 87 return null; 88 } 89 }; 90 } 91 92 public void remove(String name, String key) {} 93 94 public void set(String name, Object value) {} 95 96 public void set(String name, int index, Object value) {} 97 98 public void set(String name, String key, Object value) {} 99 100 } 101 102 | Popular Tags |