1 17 18 package org.apache.geronimo.connector.deployment.dconfigbean; 19 20 import javax.enterprise.deploy.model.DDBean ; 21 22 import org.apache.geronimo.deployment.plugin.DConfigBeanSupport; 23 import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType; 24 import org.apache.xmlbeans.SchemaTypeLoader; 25 26 32 public class ConfigPropertySettingDConfigBean extends DConfigBeanSupport { 33 34 public ConfigPropertySettingDConfigBean(DDBean ddBean, GerConfigPropertySettingType configPropertySetting) { 35 super(ddBean, configPropertySetting); 36 String name = ddBean.getText("config-property-name")[0]; 37 if (configPropertySetting.getName() == null) { 38 configPropertySetting.setName(name); 39 String [] values = ddBean.getText("config-property-value"); 40 if (values != null && values.length == 1) { 41 configPropertySetting.setStringValue(values[0]); 42 } 43 } else { 44 assert name.equals(configPropertySetting.getName()); 45 } 46 } 47 48 GerConfigPropertySettingType getConfigPropertySetting() { 49 return (GerConfigPropertySettingType) getXmlObject(); 50 } 51 52 public String getConfigPropertyName() { 53 return getConfigPropertySetting().getName(); 54 } 55 56 public String getConfigPropertyType() { 58 return getDDBean().getText("config-property/config-property-type")[0]; 59 } 60 61 public String getConfigPropertyValue() { 62 return getConfigPropertySetting().getStringValue(); 63 } 64 65 public void setConfigPropertyValue(String configPropertyValue) { 66 getConfigPropertySetting().setStringValue(configPropertyValue); 67 } 68 69 protected SchemaTypeLoader getSchemaTypeLoader() { 70 return ResourceAdapterDConfigRoot.SCHEMA_TYPE_LOADER; 71 } 72 73 } 74 75 | Popular Tags |