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