1 15 package org.apache.tapestry.bean; 16 17 import org.apache.tapestry.IBinding; 18 19 30 31 public class Default 32 { 33 private IBinding binding; 34 private Object defaultValue; 35 36 public void resetForPool() 37 { 38 binding = null; 39 defaultValue = null; 40 } 41 42 public void setBinding(IBinding value) 43 { 44 binding = value; 45 } 46 47 public IBinding getBinding() 48 { 49 return binding; 50 } 51 52 public void setDefaultValue(Object value) 53 { 54 defaultValue = value; 55 } 56 57 public Object getDefaultValue() 58 { 59 return defaultValue; 60 } 61 62 67 68 public Object getValue() 69 { 70 if (binding == null) 71 return defaultValue; 72 73 Object value = binding.getObject(); 74 75 if (value == null) 76 return defaultValue; 77 78 return value; 79 } 80 81 82 83 public void discardFromPool() 84 { 85 } 86 87 } | Popular Tags |