001 package org.tynamo.descriptor;
002
003 public class EmbeddedDescriptor extends TynamoClassDescriptorImpl implements IdentifierDescriptor
004 {
005
006 private int index;
007
008 private boolean readOnly;
009
010 private boolean identifier;
011
012 private boolean generated;
013
014 private String name;
015
016 /////////////////////////////////////////////////////////////////////////////////////////////////////////
017 // constructors
018 /////////////////////////////////////////////////////////////////////////////////////////////////////////
019
020 public EmbeddedDescriptor(Class beanType, TynamoClassDescriptor descriptor)
021 {
022 super(descriptor);
023 this.beanType = beanType;
024 }
025
026 /////////////////////////////////////////////////////////////////////////////////////////////////////////
027 // methods
028 /////////////////////////////////////////////////////////////////////////////////////////////////////////
029
030 /////////////////////////////////////////////////////////////////////////////////////////////////////////
031 // bean setters/getters
032 /////////////////////////////////////////////////////////////////////////////////////////////////////////
033
034 public boolean isNumeric()
035 {
036 // TODO Auto-generated method stub
037 return false;
038 }
039
040 public boolean isBoolean()
041 {
042 // TODO Auto-generated method stub
043 return false;
044 }
045
046 public boolean isDate()
047 {
048 // TODO Auto-generated method stub
049 return false;
050 }
051
052 public boolean isString()
053 {
054 // TODO Auto-generated method stub
055 return false;
056 }
057
058 public boolean isObjectReference()
059 {
060 // TODO Auto-generated method stub
061 return false;
062 }
063
064 public boolean isOwningObjectReference()
065 {
066 // TODO Auto-generated method stub
067 return false;
068 }
069
070 private boolean required;
071
072 private int length;
073
074 private boolean large;
075
076 private String format;
077
078 private boolean searchable;
079
080 private boolean summary;
081
082 private boolean richText;
083
084 private Class beanType;
085
086 public boolean isEmbedded()
087 {
088 return true;
089 }
090
091 public Class getPropertyType()
092 {
093 return getType();
094 }
095
096 public void setPropertyType(Class propertyType)
097 {
098 setType(propertyType);
099 }
100
101 public int getIndex()
102 {
103 return index;
104 }
105
106 public boolean isReadOnly()
107 {
108 return readOnly;
109 }
110
111 public void setReadOnly(boolean readOnly)
112 {
113 this.readOnly = readOnly;
114 }
115
116 public void setIndex(int index)
117 {
118 this.index = index;
119 }
120
121 public String getName()
122 {
123 return name;
124 }
125
126 public void setName(String name)
127 {
128 this.name = name;
129 }
130
131 public boolean isCollection()
132 {
133 return false;
134 }
135
136 @Override
137 public Object clone()
138 {
139 return new EmbeddedDescriptor(getBeanType(), this);
140 }
141
142 public String getFormat()
143 {
144 return format;
145 }
146
147 public void setFormat(String format)
148 {
149 this.format = format;
150 }
151
152 public boolean isLarge()
153 {
154 return large;
155 }
156
157 public void setLarge(boolean large)
158 {
159 this.large = large;
160 }
161
162 public int getLength()
163 {
164 return length;
165 }
166
167 public void setLength(int length)
168 {
169 this.length = length;
170 }
171
172 public boolean isSearchable()
173 {
174 return searchable;
175 }
176
177 public void setSearchable(boolean searchable)
178 {
179 this.searchable = searchable;
180 }
181
182 public boolean isSummary()
183 {
184 return summary;
185 }
186
187 public void setSummary(boolean summary)
188 {
189 this.summary = summary;
190 }
191
192 public Class getBeanType()
193 {
194 return beanType;
195 }
196
197 public void setBeanType(Class beanType)
198 {
199 this.beanType = beanType;
200 }
201
202 public boolean isRichText()
203 {
204 return richText;
205 }
206
207 public void setRichText(boolean richText)
208 {
209 this.richText = richText;
210 }
211
212 public boolean isRequired()
213 {
214 return required;
215 }
216
217 public void setRequired(boolean required)
218 {
219 this.required = required;
220 }
221
222 @Override
223 public void copyFrom(Descriptor descriptor)
224 {
225
226 super.copyFrom(descriptor);
227 }
228
229 public boolean isIdentifier()
230 {
231 return identifier;
232 }
233
234 public void setIdentifier(boolean identifier)
235 {
236 this.identifier = identifier;
237 }
238
239 public boolean isGenerated()
240 {
241 return generated;
242 }
243
244 public void setGenerated(boolean generated)
245 {
246 this.generated = generated;
247 }
248 }