1 package org.codehaus.xfire.aegis;
2
3 /***
4 * Basic type conversions for reading messages.
5 *
6 * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
7 */
8 public abstract class AbstractMessageReader
9 implements MessageReader
10 {
11 public AbstractMessageReader()
12 {
13 }
14
15 /***
16 * @see org.codehaus.xfire.aegis.MessageReader#getValueAsInt()
17 */
18 public int getValueAsInt()
19 {
20 return Integer.parseInt( getValue() );
21 }
22
23 /***
24 * @see org.codehaus.xfire.aegis.MessageReader#getValueAsLong()
25 */
26 public long getValueAsLong()
27 {
28 return Long.parseLong( getValue() );
29 }
30
31 /***
32 * @see org.codehaus.xfire.aegis.MessageReader#getValueAsDouble()
33 */
34 public double getValueAsDouble()
35 {
36 return Double.parseDouble( getValue() );
37 }
38
39 /***
40 * @see org.codehaus.xfire.aegis.MessageReader#getValueAsFloat()
41 */
42 public float getValueAsFloat()
43 {
44 return Float.parseFloat( getValue() );
45 }
46
47 /***
48 * @see org.codehaus.xfire.aegis.MessageReader#getValueAsBoolean()
49 */
50 public boolean getValueAsBoolean()
51 {
52 return Boolean.valueOf( getValue() ).booleanValue();
53 }
54 }