Coverage report

| %line | %branch
--- | --- | ---
tsukuba_bunko.resource.NumberDeserializer |
45% |
50% |

1 |  |
     package tsukuba_bunko.resource;
2 |  |
3 |  |
     import	org.xml.sax.SAXException;
4 |  |
5 |  |
6 |  |
     /**
7 |  |
      * <code>java.lang.Number</code> 系の値をデシリアライズする <code>ResourceDeserializer</code> です.
8 |  |
      * @author	$Author: ppoi $
9 |  |
      */
10 |  |
     public class NumberDeserializer	extends SimpleDeserializer	{
11 |  |
12 |  |
     	/**
13 |  |
     	 * 型
14 |  |
     	 */
15 | 320 |
     	private String	_type = null;
16 |  |
17 |  |
     	/**
18 |  |
     	 * <code>NumberDeserializer</code> のインスタンスを作成します.
19 |  |
     	 */
20 |  |
     	public NumberDeserializer()
21 |  |
     	{
22 | 320 |
     		super();
23 | 320 |
     	}
24 |  |
25 |  |
26 |  |
     //
27 |  |
     //	SimpleDeserializer の実装
28 |  |
     //
29 |  |
     	protected Object convertValue( String source )
30 |  |
     		throws SAXException
31 |  |
     	{
32 |  |
     		try	{
33 | 90 |
     			String	type = getTypeName();
34 | 90 |
     			Number	value = null;
35 | 90 |
     			if( type.equals("integer") )	{
36 | 90 |
     				value = Integer.valueOf( source );
37 | 80 |
     			}
38 | 0 |
     			else if( type.equals("long") )	{
39 | 0 |
     				value = Long.valueOf( source );
40 | 0 |
     			}
41 | 0 |
     			else if( type.equals("double") )	{
42 | 0 |
     				value = Double.valueOf( source );
43 | 0 |
     			}
44 | 0 |
     			else if( type.equals("float") )	{
45 | 0 |
     				value = Float.valueOf( source );
46 | 0 |
     			}
47 | 0 |
     			else if( type.equals("short") )	{
48 | 0 |
     				value = Short.valueOf( source );
49 | 0 |
     			}
50 | 0 |
     			else if( type.equals("byte") )	{
51 | 0 |
     				value = Byte.valueOf( source );
52 | 0 |
     			}
53 |  |
     			else	{
54 | 0 |
     				throw new SAXException( "unsupported type \"" + _type + "\"" );
55 |  |
     			}
56 | 80 |
     			return value;
57 |  |
     		}
58 | 10 |
     		catch( NumberFormatException nfe )	{
59 | 10 |
     			System.err.println( "[hogehgoe]" );
60 | 10 |
     			nfe.printStackTrace();
61 | 10 |
     			throw new SAXException( nfe );
62 |  |
     		}
63 |  |
     	}
64 |  |
     }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.