| 1 |
|
package org.trails.descriptor; |
| 2 |
|
|
| 3 |
|
public class EmbeddedDescriptor extends TrailsClassDescriptor implements IPropertyDescriptor |
| 4 |
|
{ |
| 5 |
|
|
| 6 |
|
private int index; |
| 7 |
|
|
| 8 |
|
private boolean readOnly; |
| 9 |
|
|
| 10 |
|
private String name; |
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
public EmbeddedDescriptor(Class beanType, String displayName, Class type) |
| 17 |
|
{ |
| 18 |
7 |
super(type, displayName); |
| 19 |
7 |
this.beanType = beanType; |
| 20 |
7 |
} |
| 21 |
|
|
| 22 |
|
public EmbeddedDescriptor(Class beanType, IClassDescriptor descriptor) |
| 23 |
|
{ |
| 24 |
3 |
super(descriptor); |
| 25 |
3 |
this.beanType = beanType; |
| 26 |
3 |
} |
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
public boolean isNumeric() |
| 37 |
|
{ |
| 38 |
|
|
| 39 |
0 |
return false; |
| 40 |
|
} |
| 41 |
|
|
| 42 |
|
public boolean isBoolean() |
| 43 |
|
{ |
| 44 |
|
|
| 45 |
0 |
return false; |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
public boolean isDate() |
| 49 |
|
{ |
| 50 |
|
|
| 51 |
0 |
return false; |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
public boolean isString() |
| 55 |
|
{ |
| 56 |
|
|
| 57 |
0 |
return false; |
| 58 |
|
} |
| 59 |
|
|
| 60 |
|
public boolean isObjectReference() |
| 61 |
|
{ |
| 62 |
|
|
| 63 |
0 |
return false; |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
public boolean isOwningObjectReference() |
| 67 |
|
{ |
| 68 |
|
|
| 69 |
0 |
return false; |
| 70 |
|
} |
| 71 |
|
|
| 72 |
|
private boolean required; |
| 73 |
|
|
| 74 |
|
private int length; |
| 75 |
|
|
| 76 |
|
private boolean large; |
| 77 |
|
|
| 78 |
|
private String format; |
| 79 |
|
|
| 80 |
|
private boolean searchable; |
| 81 |
|
|
| 82 |
|
private boolean summary; |
| 83 |
|
|
| 84 |
|
private boolean richText; |
| 85 |
|
|
| 86 |
|
private Class beanType; |
| 87 |
|
|
| 88 |
|
public boolean isEmbedded() |
| 89 |
|
{ |
| 90 |
1 |
return true; |
| 91 |
|
} |
| 92 |
|
|
| 93 |
|
public Class getPropertyType() |
| 94 |
|
{ |
| 95 |
3 |
return getType(); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
public void setPropertyType(Class propertyType) |
| 99 |
|
{ |
| 100 |
4 |
setType(propertyType); |
| 101 |
4 |
} |
| 102 |
|
|
| 103 |
|
public int getIndex() |
| 104 |
|
{ |
| 105 |
6 |
return index; |
| 106 |
|
} |
| 107 |
|
|
| 108 |
|
public boolean isReadOnly() |
| 109 |
|
{ |
| 110 |
3 |
return readOnly; |
| 111 |
|
} |
| 112 |
|
|
| 113 |
|
public void setReadOnly(boolean readOnly) |
| 114 |
|
{ |
| 115 |
4 |
this.readOnly = readOnly; |
| 116 |
4 |
} |
| 117 |
|
|
| 118 |
|
public void setIndex(int index) |
| 119 |
|
{ |
| 120 |
4 |
this.index = index; |
| 121 |
4 |
} |
| 122 |
|
|
| 123 |
|
public String getName() |
| 124 |
|
{ |
| 125 |
6 |
return name; |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
public void setName(String name) |
| 129 |
|
{ |
| 130 |
4 |
this.name = name; |
| 131 |
4 |
} |
| 132 |
|
|
| 133 |
|
public boolean isCollection() |
| 134 |
|
{ |
| 135 |
0 |
return false; |
| 136 |
|
} |
| 137 |
|
|
| 138 |
|
@Override |
| 139 |
|
public Object clone() |
| 140 |
|
{ |
| 141 |
3 |
return new EmbeddedDescriptor(getBeanType(), this); |
| 142 |
|
} |
| 143 |
|
|
| 144 |
|
public String getFormat() |
| 145 |
|
{ |
| 146 |
3 |
return format; |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
public void setFormat(String format) |
| 150 |
|
{ |
| 151 |
4 |
this.format = format; |
| 152 |
4 |
} |
| 153 |
|
|
| 154 |
|
public boolean isLarge() |
| 155 |
|
{ |
| 156 |
3 |
return large; |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
public void setLarge(boolean large) |
| 160 |
|
{ |
| 161 |
4 |
this.large = large; |
| 162 |
4 |
} |
| 163 |
|
|
| 164 |
|
public int getLength() |
| 165 |
|
{ |
| 166 |
3 |
return length; |
| 167 |
|
} |
| 168 |
|
|
| 169 |
|
public void setLength(int length) |
| 170 |
|
{ |
| 171 |
4 |
this.length = length; |
| 172 |
4 |
} |
| 173 |
|
|
| 174 |
|
public boolean isSearchable() |
| 175 |
|
{ |
| 176 |
3 |
return searchable; |
| 177 |
|
} |
| 178 |
|
|
| 179 |
|
public void setSearchable(boolean searchable) |
| 180 |
|
{ |
| 181 |
4 |
this.searchable = searchable; |
| 182 |
4 |
} |
| 183 |
|
|
| 184 |
|
public boolean isSummary() |
| 185 |
|
{ |
| 186 |
3 |
return summary; |
| 187 |
|
} |
| 188 |
|
|
| 189 |
|
public void setSummary(boolean summary) |
| 190 |
|
{ |
| 191 |
4 |
this.summary = summary; |
| 192 |
4 |
} |
| 193 |
|
|
| 194 |
|
public Class getBeanType() |
| 195 |
|
{ |
| 196 |
9 |
return beanType; |
| 197 |
|
} |
| 198 |
|
|
| 199 |
|
public void setBeanType(Class beanType) |
| 200 |
|
{ |
| 201 |
4 |
this.beanType = beanType; |
| 202 |
4 |
} |
| 203 |
|
|
| 204 |
|
public boolean isRichText() |
| 205 |
|
{ |
| 206 |
3 |
return richText; |
| 207 |
|
} |
| 208 |
|
|
| 209 |
|
public void setRichText(boolean richText) |
| 210 |
|
{ |
| 211 |
4 |
this.richText = richText; |
| 212 |
4 |
} |
| 213 |
|
|
| 214 |
|
public boolean isRequired() |
| 215 |
|
{ |
| 216 |
3 |
return required; |
| 217 |
|
} |
| 218 |
|
|
| 219 |
|
public void setRequired(boolean required) |
| 220 |
|
{ |
| 221 |
4 |
this.required = required; |
| 222 |
4 |
} |
| 223 |
|
|
| 224 |
|
@Override |
| 225 |
|
public void copyFrom(IDescriptor descriptor) |
| 226 |
|
{ |
| 227 |
|
|
| 228 |
1 |
super.copyFrom(descriptor); |
| 229 |
1 |
} |
| 230 |
|
|
| 231 |
|
public boolean isIdentifier() |
| 232 |
|
{ |
| 233 |
1 |
return false; |
| 234 |
|
} |
| 235 |
|
|
| 236 |
|
|
| 237 |
|
} |