1 22 package org.jboss.ejb.plugins.cmp.jdbc.metadata; 23 24 import java.util.ArrayList ; 25 import java.util.Collections ; 26 import java.util.Iterator ; 27 import java.util.List ; 28 import org.jboss.deployment.DeploymentException; 29 import org.jboss.metadata.MetaData; 30 import org.w3c.dom.Element ; 31 32 39 public final class JDBCValueClassMetaData { 40 private final Class javaType; 41 private final List properties; 42 43 52 public JDBCValueClassMetaData(Element classElement, ClassLoader classLoader) throws DeploymentException { 53 String className = MetaData.getUniqueChildContent(classElement, "class"); 54 try { 55 javaType = classLoader.loadClass(className); 56 } catch (ClassNotFoundException e) { 57 throw new DeploymentException("dependent-value-class not found: " + className); 58 } 59 60 List propertyList = new ArrayList (); 61 Iterator iterator = MetaData.getChildrenByTagName(classElement, "property"); 62 while(iterator.hasNext()) { 63 Element propertyElement = (Element )iterator.next(); 64 65 propertyList.add(new JDBCValuePropertyMetaData(propertyElement, javaType)); 66 } 67 properties = Collections.unmodifiableList(propertyList); 68 } 69 70 75 public Class getJavaType() { 76 return javaType; 77 } 78 79 84 public List getProperties() { 85 return properties; 86 } 87 } 88 | Popular Tags |