| 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 org.joda.time.DateTime; |
| 19 | |
import org.kuali.rice.core.api.util.jaxb.DateTimeAdapter; |
| 20 | |
|
| 21 | |
import javax.xml.bind.annotation.XmlAccessType; |
| 22 | |
import javax.xml.bind.annotation.XmlAccessorType; |
| 23 | |
import javax.xml.bind.annotation.XmlElement; |
| 24 | |
import javax.xml.bind.annotation.XmlRootElement; |
| 25 | |
import javax.xml.bind.annotation.XmlType; |
| 26 | |
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; |
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | 0 | @XmlRootElement(name = DocumentAttributeDateTime.Constants.ROOT_ELEMENT_NAME) |
| 35 | |
@XmlAccessorType(XmlAccessType.NONE) |
| 36 | |
@XmlType(name = DocumentAttributeDateTime.Constants.TYPE_NAME, propOrder = { |
| 37 | |
DocumentAttributeDateTime.Elements.VALUE |
| 38 | |
}) |
| 39 | 0 | public final class DocumentAttributeDateTime extends DocumentAttribute { |
| 40 | |
|
| 41 | |
@XmlElement(name = Elements.VALUE, required = false) |
| 42 | |
@XmlJavaTypeAdapter(DateTimeAdapter.class) |
| 43 | |
private final DateTime value; |
| 44 | |
|
| 45 | |
@SuppressWarnings("unused") |
| 46 | 0 | private DocumentAttributeDateTime() { |
| 47 | 0 | this.value = null; |
| 48 | 0 | } |
| 49 | |
|
| 50 | |
private DocumentAttributeDateTime(Builder builder) { |
| 51 | 0 | super(builder.getName()); |
| 52 | 0 | this.value = builder.getValue(); |
| 53 | 0 | } |
| 54 | |
|
| 55 | |
@Override |
| 56 | |
public DateTime getValue() { |
| 57 | 0 | return value; |
| 58 | |
} |
| 59 | |
|
| 60 | |
@Override |
| 61 | |
public DocumentAttributeDataType getDataType() { |
| 62 | 0 | return DocumentAttributeDataType.DATE_TIME; |
| 63 | |
} |
| 64 | |
|
| 65 | |
|
| 66 | |
|
| 67 | |
|
| 68 | 0 | public static final class Builder extends AbstractBuilder<DateTime> { |
| 69 | |
|
| 70 | |
private Builder(String name) { |
| 71 | 0 | super(name); |
| 72 | 0 | } |
| 73 | |
|
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | |
|
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | |
public static Builder create(String name) { |
| 82 | 0 | return new Builder(name); |
| 83 | |
} |
| 84 | |
|
| 85 | |
@Override |
| 86 | |
public DocumentAttributeDataType getDataType() { |
| 87 | 0 | return DocumentAttributeDataType.DATE_TIME; |
| 88 | |
} |
| 89 | |
|
| 90 | |
@Override |
| 91 | |
public DocumentAttributeDateTime build() { |
| 92 | 0 | return new DocumentAttributeDateTime(this); |
| 93 | |
} |
| 94 | |
|
| 95 | |
} |
| 96 | |
|
| 97 | |
|
| 98 | |
|
| 99 | |
|
| 100 | 0 | static class Constants { |
| 101 | |
final static String ROOT_ELEMENT_NAME = "documentAttributeDateTime"; |
| 102 | |
final static String TYPE_NAME = "DocumentAttributeDateTimeType"; |
| 103 | |
} |
| 104 | |
|
| 105 | |
|
| 106 | |
|
| 107 | |
|
| 108 | 0 | static class Elements { |
| 109 | |
final static String VALUE = "value"; |
| 110 | |
} |
| 111 | |
|
| 112 | |
} |