KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > entities > management > ServiceDefinitionVO


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cms.entities.management;
25
26 import org.infoglue.cms.entities.kernel.BaseEntityVO;
27 import org.infoglue.cms.entities.management.impl.simple.ServiceDefinitionImpl;
28 import org.infoglue.cms.exception.ConstraintException;
29 import org.infoglue.cms.util.ConstraintExceptionBuffer;
30 import org.infoglue.cms.util.validators.ValidatorFactory;
31
32
33 public class ServiceDefinitionVO implements BaseEntityVO
34 {
35
36     private java.lang.Integer JavaDoc serviceDefinitionId;
37     private java.lang.String JavaDoc className;
38     private java.lang.String JavaDoc name;
39     private java.lang.String JavaDoc description;
40
41     public String JavaDoc toString()
42     {
43         return getName();
44     }
45     /**
46      * @see org.infoglue.cms.entities.kernel.BaseEntityVO#getId()
47      */

48     public Integer JavaDoc getId() {
49         return getServiceDefinitionId();
50     }
51
52     public java.lang.Integer JavaDoc getServiceDefinitionId()
53     {
54         return this.serviceDefinitionId;
55     }
56                 
57     public void setServiceDefinitionId(java.lang.Integer JavaDoc serviceDefinitionId)
58     {
59         this.serviceDefinitionId = serviceDefinitionId;
60     }
61         
62     public java.lang.String JavaDoc getName()
63     {
64         return this.name;
65     }
66                 
67     public void setName(java.lang.String JavaDoc name) throws ConstraintException
68     {
69         ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
70         
71         ValidatorFactory.createStringValidator("ServiceDefinition.name", true, 4, 50).validate(name, ceb);
72  
73
74         ceb.throwIfNotEmpty();
75         this.name = name;
76     }
77     
78     public java.lang.String JavaDoc getDescription()
79     {
80         return this.description;
81     }
82                 
83     public void setDescription(java.lang.String JavaDoc description) throws ConstraintException
84     {
85         ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
86         ValidatorFactory.createStringValidator("ServiceDefinition.description", true, 4, 255).validate(description, ceb);
87  
88
89         ceb.throwIfNotEmpty();
90         this.description = description;
91     }
92
93     public java.lang.String JavaDoc getClassName()
94     {
95         return this.className;
96     }
97                 
98     public void setClassName(java.lang.String JavaDoc className) throws ConstraintException
99     {
100         ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
101         ValidatorFactory.createStringValidator("ServiceDefinition.className", true, 4, 100).validate(className, ceb);
102  
103
104         ceb.throwIfNotEmpty();
105         this.className = className;
106     }
107     /**
108      * @see org.infoglue.cms.entities.kernel.BaseEntityVO#validate()
109      */

110     public ConstraintExceptionBuffer validate() {
111         ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
112         if (name != null) ValidatorFactory.createStringValidator("ServiceDefinition.name", true, 4, 50, true, ServiceDefinitionImpl.class, this.getId(), null).validate(name, ceb);
113
114         return ceb;
115     }
116   
117 }
118         
119
Popular Tags