Clover coverage report - CRISPY - 1.1.1
Coverage timestamp: Mi Nov 15 2006 13:09:46 CET
file stats: LOC: 63   Methods: 6
NCLOC: 29   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
BeanTypeMappingFactory.java 100% 100% 100% 100%
coverage
 1    /**
 2    *
 3    */
 4    package net.sf.crispy.impl.jaxrpc;
 5   
 6    import javax.xml.namespace.QName;
 7    import javax.xml.rpc.encoding.DeserializerFactory;
 8    import javax.xml.rpc.encoding.SerializerFactory;
 9   
 10    import net.sf.crispy.InvocationException;
 11    import net.sf.crispy.util.Util;
 12   
 13    import org.apache.axis.encoding.ser.BeanDeserializerFactory;
 14    import org.apache.axis.encoding.ser.BeanSerializerFactory;
 15   
 16    /**
 17    *
 18    * Factory to create a TypeMapping for transfer for JavaBean-object.
 19    *
 20    * @author Linke
 21    *
 22    */
 23    public class BeanTypeMappingFactory implements TypeMappingFactory {
 24   
 25    private Class clazz = null;
 26    private QName qName = null;
 27   
 28  33 public BeanTypeMappingFactory() { }
 29   
 30  34 public void setParameter (String pvParams[]) {
 31  34 if (pvParams == null) {
 32  1 throw new IllegalArgumentException ("The class name is null (in BeanTypeMappingFactory)!");
 33    }
 34   
 35  33 String lvClassName = pvParams[1];
 36  33 try {
 37  33 clazz = Class.forName(lvClassName);
 38  32 qName = Util.createQNameByClass(clazz);
 39    } catch (Exception e) {
 40  1 throw new InvocationException("Can't create class (in BeanTypeMappingFactory) from string: " + lvClassName, e);
 41    }
 42    }
 43    /**
 44    * @see net.sf.crispy.impl.jaxrpc.TypeMappingFactory#getJavaType()
 45    */
 46  38 public Class getJavaType() { return clazz; }
 47   
 48    /**
 49    * @see net.sf.crispy.impl.jaxrpc.TypeMappingFactory#getXmlType()
 50    */
 51  50 public QName getXmlType() { return qName; }
 52   
 53    /**
 54    * @see net.sf.crispy.impl.jaxrpc.TypeMappingFactory#getSerializerFactory()
 55    */
 56  6 public SerializerFactory getSerializerFactory() { return new BeanSerializerFactory(clazz, getXmlType()); }
 57   
 58    /**
 59    * @see net.sf.crispy.impl.jaxrpc.TypeMappingFactory#getDeserializerFactory()
 60    */
 61  6 public DeserializerFactory getDeserializerFactory() { return new BeanDeserializerFactory(clazz, getXmlType()); }
 62   
 63    }