1 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 serviceDefinitionId; 37 private java.lang.String className; 38 private java.lang.String name; 39 private java.lang.String description; 40 41 public String toString() 42 { 43 return getName(); 44 } 45 48 public Integer getId() { 49 return getServiceDefinitionId(); 50 } 51 52 public java.lang.Integer getServiceDefinitionId() 53 { 54 return this.serviceDefinitionId; 55 } 56 57 public void setServiceDefinitionId(java.lang.Integer serviceDefinitionId) 58 { 59 this.serviceDefinitionId = serviceDefinitionId; 60 } 61 62 public java.lang.String getName() 63 { 64 return this.name; 65 } 66 67 public void setName(java.lang.String 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 getDescription() 79 { 80 return this.description; 81 } 82 83 public void setDescription(java.lang.String 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 getClassName() 94 { 95 return this.className; 96 } 97 98 public void setClassName(java.lang.String 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 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 |