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