1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.api.document.attribute;
17
18 import javax.xml.bind.annotation.XmlAccessType;
19 import javax.xml.bind.annotation.XmlAccessorType;
20 import javax.xml.bind.annotation.XmlElement;
21 import javax.xml.bind.annotation.XmlRootElement;
22 import javax.xml.bind.annotation.XmlType;
23
24
25
26
27
28
29
30 @XmlRootElement(name = DocumentAttributeString.Constants.ROOT_ELEMENT_NAME)
31 @XmlAccessorType(XmlAccessType.NONE)
32 @XmlType(name = DocumentAttributeString.Constants.TYPE_NAME, propOrder = {
33 DocumentAttributeString.Elements.VALUE
34 })
35 public final class DocumentAttributeString extends DocumentAttribute {
36
37 @XmlElement(name = Elements.VALUE, required = false)
38 private final String value;
39
40 @SuppressWarnings("unused")
41 private DocumentAttributeString() {
42 this.value = null;
43 }
44
45 private DocumentAttributeString(Builder builder) {
46 super(builder.getName());
47 this.value = builder.getValue();
48 }
49
50 @Override
51 public String getValue() {
52 return value;
53 }
54
55 @Override
56 public DocumentAttributeDataType getDataType() {
57 return DocumentAttributeDataType.STRING;
58 }
59
60
61
62
63 public static final class Builder extends AbstractBuilder<String> {
64
65 private Builder(String name) {
66 super(name);
67 }
68
69
70
71
72
73
74
75
76 public static Builder create(String name) {
77 return new Builder(name);
78 }
79
80 @Override
81 public DocumentAttributeDataType getDataType() {
82 return DocumentAttributeDataType.STRING;
83 }
84
85 @Override
86 public DocumentAttributeString build() {
87 return new DocumentAttributeString(this);
88 }
89
90 }
91
92
93
94
95 static class Constants {
96 final static String ROOT_ELEMENT_NAME = "documentAttributeString";
97 final static String TYPE_NAME = "DocumentAttributeStringType";
98 }
99
100
101
102
103 static class Elements {
104 final static String VALUE = "value";
105 }
106
107 }