| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.student.r2.core.comment.dto; |
| 17 | |
|
| 18 | |
import org.kuali.student.r2.common.dto.IdNamelessEntityInfo; |
| 19 | |
import org.kuali.student.r2.common.dto.RichTextInfo; |
| 20 | |
import org.kuali.student.r2.core.comment.infc.Comment; |
| 21 | |
import org.w3c.dom.Element; |
| 22 | |
|
| 23 | |
import javax.xml.bind.annotation.*; |
| 24 | |
import java.io.Serializable; |
| 25 | |
import java.util.Date; |
| 26 | |
import java.util.List; |
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
|
| 34 | 0 | @XmlAccessorType(XmlAccessType.FIELD) |
| 35 | |
@XmlType(name = "CommentInfo", propOrder = {"id", "typeKey", "stateKey", |
| 36 | |
"commentText", "referenceTypeKey", "referenceId", "effectiveDate", |
| 37 | |
"expirationDate", "meta", "attributes", "_futureElements"}) |
| 38 | |
public class CommentInfo extends IdNamelessEntityInfo implements Comment, Serializable { |
| 39 | |
|
| 40 | |
private static final long serialVersionUID = 1L; |
| 41 | |
|
| 42 | |
@XmlElement |
| 43 | |
private RichTextInfo commentText; |
| 44 | |
|
| 45 | |
@XmlElement |
| 46 | |
private String referenceTypeKey; |
| 47 | |
|
| 48 | |
@XmlElement |
| 49 | |
private String referenceId; |
| 50 | |
|
| 51 | |
@XmlElement |
| 52 | |
private Date effectiveDate; |
| 53 | |
|
| 54 | |
@XmlElement |
| 55 | |
private Date expirationDate; |
| 56 | |
|
| 57 | |
@XmlAnyElement |
| 58 | |
private List<Element> _futureElements; |
| 59 | |
|
| 60 | 0 | public CommentInfo() { |
| 61 | 0 | } |
| 62 | |
|
| 63 | |
public CommentInfo(Comment comment) { |
| 64 | 0 | super(comment); |
| 65 | 0 | if (null != comment) { |
| 66 | 0 | this.commentText = (null != comment.getCommentText()) ? new RichTextInfo(comment.getCommentText()) : null; |
| 67 | 0 | this.referenceTypeKey = comment.getReferenceTypeKey(); |
| 68 | 0 | this.referenceId = comment.getReferenceId(); |
| 69 | 0 | this.effectiveDate = (null != comment.getEffectiveDate()) ? new Date(comment.getEffectiveDate().getTime()) : null; |
| 70 | 0 | this.expirationDate = (null != comment.getExpirationDate()) ? new Date(comment.getExpirationDate().getTime()) : null; |
| 71 | 0 | this._futureElements = null; |
| 72 | |
} |
| 73 | 0 | } |
| 74 | |
|
| 75 | |
@Override |
| 76 | |
public RichTextInfo getCommentText() { |
| 77 | 0 | return commentText; |
| 78 | |
} |
| 79 | |
|
| 80 | |
public void setCommentText(RichTextInfo commentText) { |
| 81 | 0 | this.commentText = commentText; |
| 82 | 0 | } |
| 83 | |
|
| 84 | |
@Override |
| 85 | |
public String getReferenceTypeKey() { |
| 86 | 0 | return referenceTypeKey; |
| 87 | |
} |
| 88 | |
|
| 89 | |
public void setReferenceTypeKey(String referenceTypeKey) { |
| 90 | 0 | this.referenceTypeKey = referenceTypeKey; |
| 91 | 0 | } |
| 92 | |
|
| 93 | |
@Override |
| 94 | |
public String getReferenceId() { |
| 95 | 0 | return referenceId; |
| 96 | |
} |
| 97 | |
|
| 98 | |
public void setReferenceId(String referenceId) { |
| 99 | 0 | this.referenceId = referenceId; |
| 100 | 0 | } |
| 101 | |
|
| 102 | |
@Override |
| 103 | |
public Date getEffectiveDate() { |
| 104 | 0 | return effectiveDate; |
| 105 | |
} |
| 106 | |
|
| 107 | |
public void setEffectiveDate(Date effectiveDate) { |
| 108 | 0 | this.effectiveDate = effectiveDate; |
| 109 | 0 | } |
| 110 | |
|
| 111 | |
@Override |
| 112 | |
public Date getExpirationDate() { |
| 113 | 0 | return expirationDate; |
| 114 | |
} |
| 115 | |
|
| 116 | |
public void setExpirationDate(Date expirationDate) { |
| 117 | 0 | this.expirationDate = expirationDate; |
| 118 | 0 | } |
| 119 | |
|
| 120 | |
} |