1 17 package org.apache.servicemix.jbi.config.spring; 18 19 import org.w3c.dom.Element ; 20 21 26 public class BeanPropertyElementProcessor extends BeanElementProcessor { 27 private String propertyName; 28 29 public BeanPropertyElementProcessor(String className, String propertyName) { 30 super(className); 31 this.propertyName = propertyName; 32 } 33 34 public BeanPropertyElementProcessor(Class type, String propertyName) { 35 this(type.getName(), propertyName); 36 } 37 38 public BeanPropertyElementProcessor(Class type, String propertyName, ElementProcessor processor) { 39 super(type.getName(), processor); 40 this.propertyName = propertyName; 41 } 42 43 44 protected Element createBeanElement(Element root, Element element, String className) { 45 Element property = root.getOwnerDocument().createElement("property"); 46 String name = propertyName; 47 if (name == null) { 48 name = getElementNameToPropertyName(element); 49 } 50 property.setAttribute("name", name); 51 root.appendChild(property); 52 return super.createBeanElement(property, element, className); 53 } 54 } 55 | Popular Tags |