1 28 29 package com.caucho.config; 30 31 import com.caucho.util.L10N; 32 33 public class StringAttributeProgram extends BuilderProgram { 34 static L10N L = new L10N(StringAttributeProgram.class); 35 36 private String _key; 37 private String _value; 38 39 public StringAttributeProgram(String key, String value) 40 { 41 _key = key; 42 _value = value; 43 } 44 45 public void configure(Object bean) 46 throws ConfigException 47 { 48 if (bean == null) 49 return; 50 51 try { 52 Config.setAttribute(bean, _key, _value); 53 } catch (RuntimeException e) { 54 throw e; 55 } catch (Exception e) { 56 throw new ConfigException(e); 57 } 58 } 59 60 public Object configure(Class cl) 61 throws ConfigException 62 { 63 throw new UnsupportedOperationException (); 64 } 65 } 66 | Popular Tags |