KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > riotfamily > components > ComponentList


1 /* ***** BEGIN LICENSE BLOCK *****
2  * Version: MPL 1.1
3  * The contents of this file are subject to the Mozilla Public License Version
4  * 1.1 (the "License"); you may not use this file except in compliance with
5  * the License. You may obtain a copy of the License at
6  * http://www.mozilla.org/MPL/
7  *
8  * Software distributed under the License is distributed on an "AS IS" basis,
9  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
10  * for the specific language governing rights and limitations under the
11  * License.
12  *
13  * The Original Code is Riot.
14  *
15  * The Initial Developer of the Original Code is
16  * Neteye GmbH.
17  * Portions created by the Initial Developer are Copyright (C) 2006
18  * the Initial Developer. All Rights Reserved.
19  *
20  * Contributor(s):
21  * Felix Gnass [fgnass at neteye dot de]
22  *
23  * ***** END LICENSE BLOCK ***** */

24 package org.riotfamily.components;
25
26 import java.util.Date JavaDoc;
27 import java.util.List JavaDoc;
28
29 /**
30  * List of components that can be looked up using a {@link Location}.
31  * Actually the class consists of two lists of
32  * {@link org.riotfamily.components.VersionContainer VersionContainers},
33  * the live-list and the preview-list.
34  */

35 public class ComponentList {
36
37     private Long JavaDoc id;
38
39     private Location location;
40
41     private List JavaDoc liveContainers;
42
43     private List JavaDoc previewContainers;
44
45     private boolean dirty;
46
47     private Date JavaDoc lastModified;
48
49     private String JavaDoc lastModifiedBy;
50
51     private VersionContainer parent;
52
53     public Long JavaDoc getId() {
54         return this.id;
55     }
56
57     public void setId(Long JavaDoc id) {
58         this.id = id;
59     }
60
61     public List JavaDoc getLiveContainers() {
62         return this.liveContainers;
63     }
64
65     public void setLiveContainers(List JavaDoc list) {
66         this.liveContainers = list;
67     }
68
69     public Location getLocation() {
70         return this.location;
71     }
72
73     public void setLocation(Location location) {
74         this.location = location;
75     }
76
77     public VersionContainer getParent() {
78         return this.parent;
79     }
80
81     public void setParent(VersionContainer parent) {
82         this.parent = parent;
83     }
84
85     public List JavaDoc getPreviewContainers() {
86         return this.previewContainers;
87     }
88
89     public void setPreviewContainers(List JavaDoc list) {
90         this.previewContainers = list;
91     }
92
93     /**
94      * Returns whether the list has a preview-list. The flag is needed because
95      * Hibernate does not distinguish between a null collection reference and
96      * an empty collection.
97      */

98     public boolean isDirty() {
99         return this.dirty;
100     }
101
102     public void setDirty(boolean dirty) {
103         this.dirty = dirty;
104     }
105
106     /**
107      * Returns the date of the last modification.
108      * @since 6.4
109      */

110     public Date JavaDoc getLastModified() {
111         return this.lastModified;
112     }
113
114     /**
115      * Sets the date of the last modification.
116      * @since 6.4
117      */

118     public void setLastModified(Date JavaDoc lastModified) {
119         this.lastModified = lastModified;
120     }
121
122     /**
123      * Returns the principal that made the last modification.
124      * @since 6.4
125      */

126     public String JavaDoc getLastModifiedBy() {
127         return this.lastModifiedBy;
128     }
129
130     /**
131      * Sets the principal that made the last modification.
132      * @since 6.4
133      */

134     public void setLastModifiedBy(String JavaDoc lastModifiedBy) {
135         this.lastModifiedBy = lastModifiedBy;
136     }
137
138     public String JavaDoc toString() {
139         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
140         sb.append("ComponentList ");
141         sb.append(location);
142         sb.append(" (").append(id).append(')');
143         return sb.toString();
144     }
145
146 }
147
Popular Tags