1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
package net.smartlab.web.bean; |
25 |
|
|
26 |
|
import java.math.BigInteger; |
27 |
|
import java.util.Locale; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@author |
33 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 5 |
Complexity Density: 0,83 |
|
34 |
|
public class BigIntegerConverter extends NumberConverter { |
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
39 |
0
|
public BigIntegerConverter() {... |
40 |
0
|
super(); |
41 |
|
} |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
@param |
47 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
48 |
0
|
public BigIntegerConverter(long value) {... |
49 |
0
|
super(value); |
50 |
|
} |
51 |
|
|
52 |
|
|
53 |
|
@see |
54 |
|
|
55 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 3 |
Complexity Density: 0,75 |
|
56 |
0
|
public Object convert(Class type, Object value, Locale locale) throws ConversionException {... |
57 |
0
|
if (type.equals(BigInteger.class)) { |
58 |
0
|
try { |
59 |
0
|
return new BigInteger(value.toString()); |
60 |
|
} catch (NumberFormatException nfe) { |
61 |
|
if (super.hasDefault()) { |
62 |
|
return new BigInteger(Long.toString((long)this.getDefault())); |
63 |
|
} |
64 |
|
throw new ConversionException(nfe); |
65 |
|
} |
66 |
|
} else { |
67 |
0
|
return value.toString(); |
68 |
|
} |
69 |
|
} |
70 |
|
|
71 |
|
} |