1 16 package org.apache.cocoon.forms.datatype.convertor; 17 18 import org.apache.cocoon.forms.FormsConstants; 19 import org.apache.cocoon.forms.util.DomHelper; 20 21 import org.w3c.dom.Element ; 22 23 24 41 public class BeanConvertorBuilder 42 implements ConvertorBuilder 43 { 44 46 55 public Convertor build( final Element configElement ) 56 throws Exception 57 { 58 if( configElement == null ) 59 { 60 return null; 61 } 62 63 final Element beanEl = 64 DomHelper.getChildElement( configElement, FormsConstants.DEFINITION_NS, 65 "bean", false ); 66 final String clazz = 67 ( ( beanEl == null ) ? Object .class.getName( ) 68 : beanEl.getFirstChild( ).getNodeValue( ) ); 69 final Element idPathEl = 70 DomHelper.getChildElement( configElement, FormsConstants.DEFINITION_NS, 71 "id-path", false ); 72 final String idPath = 73 ( ( idPathEl != null ) 74 ? idPathEl.getFirstChild( ).getNodeValue( ) : null ); 75 final BeanConvertor convertor = new BeanConvertor( clazz, idPath ); 76 77 return convertor; 78 } 79 } 80 | Popular Tags |