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