01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: OrderedInvalidType.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.cmf.dam;
09:
10: import com.uwyn.rife.site.ConstrainedBean;
11: import com.uwyn.rife.site.ConstrainedProperty;
12: import com.uwyn.rife.site.Validation;
13:
14: public class OrderedInvalidType extends
15: Validation<ConstrainedBean, ConstrainedProperty> {
16: private int mId = -1;
17: private String mName = null;
18: private String mPriority = null;
19:
20: public OrderedInvalidType() {
21: }
22:
23: protected void activateValidation() {
24: addConstraint(new ConstrainedProperty("name").maxLength(64)
25: .notNull(true).notEmpty(true));
26: addConstraint(new ConstrainedProperty("priority").rangeBegin(0)
27: .ordinal(true));
28: }
29:
30: public void setId(int id) {
31: mId = id;
32: }
33:
34: public int getId() {
35: return mId;
36: }
37:
38: public void setPriority(String priority) {
39: mPriority = priority;
40: }
41:
42: public String getPriority() {
43: return mPriority;
44: }
45:
46: public OrderedInvalidType priority(String priority) {
47: mPriority = priority;
48:
49: return this ;
50: }
51:
52: public void setName(String name) {
53: mName = name;
54: }
55:
56: public String getName() {
57: return mName;
58: }
59:
60: public OrderedInvalidType name(String name) {
61: mName = name;
62:
63: return this;
64: }
65: }
|