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