View Javadoc

1   /*
2    * Copyright 2010 The Kuali Foundation 
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with the
6    * License. You may obtain a copy of the License at
7    *
8    * http://www.osedu.org/licenses/ECL-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13   * implied. See the License for the specific language governing
14   * permissions and limitations under the License.
15   */
16  
17  package org.kuali.student.r2.common.dto;
18  
19  import java.io.Serializable;
20  import java.util.Date;
21  import java.util.List;
22  
23  import javax.xml.bind.annotation.XmlAccessType;
24  import javax.xml.bind.annotation.XmlAccessorType;
25  import javax.xml.bind.annotation.XmlAnyElement;
26  import javax.xml.bind.annotation.XmlElement;
27  import javax.xml.bind.annotation.XmlType;
28  
29  import org.kuali.student.r2.common.infc.Meta;
30  //import org.w3c.dom.Element;
31  
32  /**
33   * Information about meta data for entities.
34   *
35   * @author tom
36   */
37  
38  @XmlAccessorType(XmlAccessType.FIELD)
39  @XmlType(name = "MetaInfo", propOrder = {
40                  "versionInd", "createTime", "createId", 
41                  "updateTime", "updateId" })//, "_futureElements" }) TODO KSCM-372: Non-GWT translatable code})
42  
43  public class MetaInfo 
44      implements Meta, Serializable {
45  
46      private static final long serialVersionUID = 1L;
47  
48      @XmlElement
49      private String versionInd;
50  
51      @XmlElement
52      private Date createTime;
53  
54      @XmlElement
55      private String createId;
56  
57      @XmlElement
58      private Date updateTime;
59  
60      @XmlElement
61      private String updateId;
62  
63  //    TODO KSCM-372: Non-GWT translatable code
64  //    @XmlAnyElement
65  //    private List<Element> _futureElements;
66  
67  
68      /**
69       * Constructs a new MetaInfo.
70       */
71      public MetaInfo() {
72      }
73  
74      /**
75       * Constructs a new MetaInfo from another Meta.
76       *
77       * @param meta the Meta to copy
78       */
79      public MetaInfo(Meta meta) {
80          if (meta != null) {
81  
82              this.versionInd = meta.getVersionInd();
83  
84              if (meta.getCreateTime() != null) {
85                  this.createTime = new Date(meta.getCreateTime().getTime());
86              }
87  
88              this.createId = meta.getCreateId();
89  
90              if (meta.getUpdateTime() != null) {
91                  this.updateTime = new Date(meta.getUpdateTime().getTime());
92              }
93  
94              this.updateId = meta.getUpdateId();
95          }
96      }
97  
98      @Override
99      public String getVersionInd() {
100         return versionInd;
101     }
102 
103     public void setVersionInd(String versionInd) {
104         this.versionInd = versionInd;
105     }
106 
107     @Override
108     public Date getCreateTime() {
109         return createTime;
110     }
111 
112     public void setCreateTime(Date createTime) {
113         this.createTime = createTime;
114     }
115 
116     @Override
117     public String getCreateId() {
118         return createId;
119     }
120 
121     public void setCreateId(String createId) {
122         this.createId = createId;
123     }
124 
125     @Override
126     public Date getUpdateTime() {
127         return updateTime;
128     }
129 
130     public void setUpdateTime(Date updateTime) {
131         this.updateTime = updateTime;
132     }
133 
134     @Override
135     public String getUpdateId() {
136         return updateId;
137     }
138 
139     public void setUpdateId(String updateId) {
140         this.updateId = updateId;
141     }
142 
143 
144     // Compatibility methods
145 
146     @Deprecated
147     public static MetaInfo newInstance() {
148         return new MetaInfo();
149     }
150     
151     @Deprecated
152     public static MetaInfo getInstance(Meta metaInfo) {
153         return new MetaInfo(metaInfo);
154     }
155 }