1 28 29 package com.caucho.widget.impl; 30 31 import com.caucho.util.L10N; 32 33 public class UrlVarHolder 34 extends VarHolder 35 { 36 private static final L10N L = new L10N(UrlVarHolder.class); 37 38 private static final Object NULL_VALUE = new Object(); 39 40 private VarHolder _varHolder; 41 42 47 public void setVarHolder(VarHolder varHolder) 48 { 49 _varHolder = varHolder; 50 super.setWidgetInit(_varHolder.getWidgetInit()); 51 } 52 53 public void init() 54 { 55 super.init(); 56 57 if (_varHolder == null) 58 throw new IllegalStateException(L.l("`{0}' is required", "var-holder")); 59 } 60 61 public void destroy() 62 { 63 _varHolder = null; 64 65 super.destroy(); 66 } 67 68 protected Object getVarImpl(String name, 69 boolean isDefaultValue, 70 Object defaultValue) 71 { 72 Object value = super.getVarImpl(name, true, NULL_VALUE); 73 74 if (value == NULL_VALUE) 75 value = _varHolder.getVarImpl(name, isDefaultValue, defaultValue); 76 77 return value; 78 } 79 } 80 81 | Popular Tags |