KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > workplace > tools > content > check > CmsContentCheckProperetyObject


1 /*
2  * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/content/check/CmsContentCheckProperetyObject.java,v $
3  * Date : $Date: 2006/03/27 14:52:54 $
4  * Version: $Revision: 1.2 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (C) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31
32 package org.opencms.workplace.tools.content.check;
33
34 import java.util.Collections JavaDoc;
35 import java.util.List JavaDoc;
36
37 /**
38  * This class encapsulates the configuration of one property check used by the
39  * property content check.<p>
40  *
41  * @author Michael Emmerich
42  *
43  * @version $Revision: 1.2 $
44  *
45  * @since 6.1.2
46  */

47 public class CmsContentCheckProperetyObject {
48
49     /** Constant for type file or folder.*/
50     public static final String JavaDoc TYPE_BOTH = "both";
51
52     /** Constant for type file. */
53     public static final String JavaDoc TYPE_FILE = "file";
54
55     /** Constant for type folder. */
56     public static final String JavaDoc TYPE_FOLDER = "folder";
57
58     /** Flag for checking if the property value is empty. */
59     private boolean m_empty;
60
61     /** Flag for checking if the property value contains the filename. */
62     private boolean m_filename;
63
64     /** The minimum length of the property value. */
65     private int m_length;
66
67     /** The propertyname. */
68     private String JavaDoc m_propertyname;
69
70     /** The resourcetype (file or folder). */
71     private String JavaDoc m_type;
72
73     /** The property value to check for. */
74     private List JavaDoc m_value;
75
76     /**
77      * Constructor, creates a new empty CmsContentCheckProperetyObject.<p> *
78      */

79     public CmsContentCheckProperetyObject() {
80
81         m_propertyname = null;
82         m_type = TYPE_BOTH;
83         m_empty = false;
84         m_filename = false;
85         m_length = -1;
86         m_value = Collections.EMPTY_LIST;
87     }
88
89     /**
90      * Returns the minimum length.<p>
91      *
92      * @return the minimum length
93      */

94     public int getLength() {
95
96         return m_length;
97     }
98
99     /**
100      * Returns the propertyname.<p>
101      *
102      * @return the propertyname
103      */

104     public String JavaDoc getPropertyname() {
105
106         return m_propertyname;
107     }
108
109     /**
110      * Returns the type.<p>
111      *
112      * @return the type
113      */

114     public String JavaDoc getType() {
115
116         return m_type;
117     }
118
119     /**
120      * Returns the value.<p>
121      *
122      * @return the value
123      */

124     public List JavaDoc getValue() {
125
126         return m_value;
127     }
128
129     /**
130      * Returns the empty flag.<p>
131      *
132      * @return the empty flag
133      */

134     public boolean isEmpty() {
135
136         return m_empty;
137     }
138
139     /**
140      * Returns the filename flag.<p>
141      *
142      * @return the filename flag
143      */

144     public boolean isFilename() {
145
146         return m_filename;
147     }
148
149     /**
150      * Sets the empty flag.<p>
151      *
152      * @param empty the empty flag to set
153      */

154     public void setEmpty(boolean empty) {
155
156         m_empty = empty;
157     }
158
159     /**
160      * Sets the filename flag.<p>
161      *
162      * @param filename the filename flag to set
163      */

164     public void setFilename(boolean filename) {
165
166         m_filename = filename;
167     }
168
169     /**
170      * Sets the minimum length.<p>
171      *
172      * @param length the minimum length to set
173      */

174     public void setLength(int length) {
175
176         m_length = length;
177     }
178
179     /**
180      * Sets the propertyname.<p>
181      *
182      * @param propertyname the propertyname to set
183      */

184     public void setPropertyname(String JavaDoc propertyname) {
185
186         m_propertyname = propertyname;
187     }
188
189     /**
190      * Sets the type.<p>
191      *
192      * @param type the type to set
193      */

194     public void setType(String JavaDoc type) {
195
196         m_type = type;
197     }
198
199     /**
200      * Sets the value.<p>
201      *
202      * @param value the value to set
203      */

204     public void setValue(List JavaDoc value) {
205
206         m_value = value;
207     }
208
209     /**
210      *
211      * @see java.lang.Object#toString()
212      */

213     public String JavaDoc toString() {
214
215         StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
216         buf.append(this.getClass().getName());
217         buf.append(" [Propertyname=");
218         buf.append(m_propertyname);
219         buf.append(" Type=");
220         buf.append(m_type);
221         buf.append(" emptycheck=");
222         buf.append(m_empty);
223         buf.append(" filenamecheck=");
224         buf.append(m_filename);
225         buf.append(" min length=");
226         buf.append(m_length);
227         buf.append(" value=");
228         buf.append(m_value);
229         buf.append("]");
230         return buf.toString();
231     }
232
233 }
234
Popular Tags