1 21 package com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent; 22 23 import com.jaspersoft.jasperserver.api.metadata.common.domain.DataType; 24 import com.jaspersoft.jasperserver.api.metadata.common.domain.Resource; 25 import com.jaspersoft.jasperserver.api.metadata.common.service.ResourceFactory; 26 import com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.PersistentObjectResolver; 27 import com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.ReferenceResolver; 28 29 30 37 public class RepoDataType extends RepoResource 38 { 39 40 43 private byte type = DataType.TYPE_TEXT; 44 private Integer maxLength = null; 45 private Integer decimals = null; 46 private String regularExpr = null; 47 private Comparable minValue = null; 48 private Comparable maxValue = null; 49 private boolean isStrictMin = false; 50 private boolean isStrictMax = false; 51 52 53 56 public byte getType() 57 { 58 return type; 59 } 60 61 64 public void setType(byte type) 65 { 66 this.type = type; 67 } 68 69 72 public Integer getMaxLength() 73 { 74 return maxLength; 75 } 76 77 80 public void setMaxLength(Integer maxLength) 81 { 82 this.maxLength = maxLength; 83 } 84 85 88 public Integer getDecimals() 89 { 90 return decimals; 91 } 92 93 96 public void setDecimals(Integer decimals) 97 { 98 this.decimals = decimals; 99 } 100 101 104 public String getRegularExpr() 105 { 106 return regularExpr; 107 } 108 109 112 public void setRegularExpr(String regularExpr) 113 { 114 this.regularExpr = regularExpr; 115 } 116 117 120 public Comparable getMinValue() 121 { 122 return minValue; 123 } 124 125 128 public void setMinValue(Comparable min) 129 { 130 this.minValue = min; 131 } 132 133 136 public Comparable getMaxValue() 137 { 138 return maxValue; 139 } 140 141 144 public void setMaxValue(Comparable max) 145 { 146 this.maxValue = max; 147 } 148 149 152 public boolean isStrictMin() 153 { 154 return isStrictMin; 155 } 156 157 160 public void setStrictMin(boolean isStrictMin) 161 { 162 this.isStrictMin = isStrictMin; 163 } 164 165 168 public boolean isStrictMax() 169 { 170 return isStrictMax; 171 } 172 173 176 public void setStrictMax(boolean isStrictMax) 177 { 178 this.isStrictMax = isStrictMax; 179 } 180 181 184 protected void copyFrom(Resource clientRes, ReferenceResolver referenceResolver) 185 { 186 super.copyFrom(clientRes, referenceResolver); 187 188 DataType dataType = (DataType) clientRes; 189 190 setType(dataType.getType()); 191 setMaxLength(dataType.getMaxLength()); 192 setDecimals(dataType.getDecimals()); 193 setRegularExpr(dataType.getRegularExpr()); 194 setMinValue(dataType.getMinValue()); 195 setMaxValue(dataType.getMaxValue()); 196 setStrictMin(dataType.isStrictMin()); 197 setStrictMax(dataType.isStrictMax()); 198 } 199 200 protected Class getClientItf() { 201 return DataType.class; 202 } 203 204 protected void copyTo(Resource clientRes, ResourceFactory resourceFactory) 205 { 206 super.copyTo(clientRes, resourceFactory); 207 208 DataType dataType = (DataType) clientRes; 209 dataType.setType(getType()); 210 dataType.setMaxLength(getMaxLength()); 211 dataType.setDecimals(getDecimals()); 212 dataType.setRegularExpr(getRegularExpr()); 213 dataType.setMinValue(getMinValue()); 214 dataType.setMaxValue(getMaxValue()); 215 dataType.setStrictMin(isStrictMin()); 216 dataType.setStrictMax(isStrictMax()); 217 } 218 219 } 220 | Popular Tags |