1 | |
package org.kuali.rice.kew.api.document.attribute; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
import javax.xml.bind.annotation.XmlAccessType; |
8 | |
import javax.xml.bind.annotation.XmlAccessorType; |
9 | |
import javax.xml.bind.annotation.XmlElement; |
10 | |
import javax.xml.bind.annotation.XmlRootElement; |
11 | |
import javax.xml.bind.annotation.XmlType; |
12 | |
import java.math.BigDecimal; |
13 | |
|
14 | 0 | @XmlRootElement(name = DocumentAttributeDecimal.Constants.ROOT_ELEMENT_NAME) |
15 | |
@XmlAccessorType(XmlAccessType.NONE) |
16 | |
@XmlType(name = DocumentAttributeDecimal.Constants.TYPE_NAME, propOrder = { |
17 | |
DocumentAttributeDecimal.Elements.VALUE |
18 | |
}) |
19 | |
public final class DocumentAttributeDecimal extends DocumentAttribute<BigDecimal> { |
20 | |
|
21 | |
@XmlElement(name = Elements.VALUE, required = false) |
22 | |
private final BigDecimal value; |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | 0 | private DocumentAttributeDecimal() { |
28 | 0 | this.value = null; |
29 | 0 | } |
30 | |
|
31 | |
public DocumentAttributeDecimal(String name, BigDecimal value) { |
32 | 0 | super(name); |
33 | 0 | this.value = value; |
34 | 0 | } |
35 | |
|
36 | |
public static DocumentAttributeDecimal create(String name, BigDecimal value) { |
37 | 0 | return new DocumentAttributeDecimal(name, value); |
38 | |
} |
39 | |
|
40 | |
@Override |
41 | |
public BigDecimal getValue() { |
42 | 0 | return value; |
43 | |
} |
44 | |
|
45 | |
@Override |
46 | |
public DocumentAttributeDataType getDataType() { |
47 | 0 | return DocumentAttributeDataType.DECIMAL; |
48 | |
} |
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | 0 | static class Constants { |
54 | |
final static String ROOT_ELEMENT_NAME = "documentAttributeDecimal"; |
55 | |
final static String TYPE_NAME = "DocumentAttributeDecimalType"; |
56 | |
} |
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | 0 | static class Elements { |
62 | |
final static String VALUE = "value"; |
63 | |
} |
64 | |
|
65 | |
} |