001: /*
002: * File : $Source: /usr/local/cvs/opencms/src-modules/org/opencms/workplace/tools/content/check/CmsContentCheckPropertyObject.java,v $
003: * Date : $Date: 2008-02-27 12:05:41 $
004: * Version: $Revision: 1.2 $
005: *
006: * This library is part of OpenCms -
007: * the Open Source Content Management System
008: *
009: * Copyright (c) 2002 - 2008 Alkacon Software GmbH (http://www.alkacon.com)
010: *
011: * This library is free software; you can redistribute it and/or
012: * modify it under the terms of the GNU Lesser General Public
013: * License as published by the Free Software Foundation; either
014: * version 2.1 of the License, or (at your option) any later version.
015: *
016: * This library is distributed in the hope that it will be useful,
017: * but WITHOUT ANY WARRANTY; without even the implied warranty of
018: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: * Lesser General Public License for more details.
020: *
021: * For further information about Alkacon Software GmbH, please see the
022: * company website: http://www.alkacon.com
023: *
024: * For further information about OpenCms, please see the
025: * project website: http://www.opencms.org
026: *
027: * You should have received a copy of the GNU Lesser General Public
028: * License along with this library; if not, write to the Free Software
029: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
030: */
031:
032: package org.opencms.workplace.tools.content.check;
033:
034: import java.util.Collections;
035: import java.util.List;
036:
037: /**
038: * This class encapsulates the configuration of one property check used by the
039: * property content check.<p>
040: *
041: * @author Michael Emmerich
042: *
043: * @version $Revision: 1.2 $
044: *
045: * @since 6.1.2
046: */
047: public class CmsContentCheckPropertyObject {
048:
049: /** Constant for type file or folder.*/
050: public static final String TYPE_BOTH = "both";
051:
052: /** Constant for type file. */
053: public static final String TYPE_FILE = "file";
054:
055: /** Constant for type folder. */
056: public static final String TYPE_FOLDER = "folder";
057:
058: /** Flag for checking if the property value is empty. */
059: private boolean m_empty;
060:
061: /** Flag for checking if the property value contains the filename. */
062: private boolean m_filename;
063:
064: /** The minimum length of the property value. */
065: private int m_length;
066:
067: /** The propertyname. */
068: private String m_propertyname;
069:
070: /** The resourcetype (file or folder). */
071: private String m_type;
072:
073: /** The property value to check for. */
074: private List m_value;
075:
076: /**
077: * Constructor, creates a new empty CmsContentCheckProperetyObject.<p> *
078: */
079: public CmsContentCheckPropertyObject() {
080:
081: m_propertyname = null;
082: m_type = TYPE_BOTH;
083: m_empty = false;
084: m_filename = false;
085: m_length = -1;
086: m_value = Collections.EMPTY_LIST;
087: }
088:
089: /**
090: * Returns the minimum length.<p>
091: *
092: * @return the minimum length
093: */
094: public int getLength() {
095:
096: return m_length;
097: }
098:
099: /**
100: * Returns the propertyname.<p>
101: *
102: * @return the propertyname
103: */
104: public String getPropertyname() {
105:
106: return m_propertyname;
107: }
108:
109: /**
110: * Returns the type.<p>
111: *
112: * @return the type
113: */
114: public String getType() {
115:
116: return m_type;
117: }
118:
119: /**
120: * Returns the value.<p>
121: *
122: * @return the value
123: */
124: public List 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 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 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 value) {
205:
206: m_value = value;
207: }
208:
209: /**
210: *
211: * @see java.lang.Object#toString()
212: */
213: public String toString() {
214:
215: StringBuffer buf = new StringBuffer();
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: }
|