View Javadoc

1   /*
2    * Copyright 2000-2005 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.portals.graffito.jcr.mapper.model;
17  
18  /***
19   * 
20   * CollectionDescriptor is used by the mapper to read general information on a collection field
21   * 
22   * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
23   * 
24   */
25  public class CollectionDescriptor
26  {
27  
28       private String fieldName;
29       private String jcrName;     
30       private String elementClassName; 
31       private String collectionConverterClassName;
32       private String collectionClassName;
33       private boolean proxy;
34       private boolean autoRetrieve = true;
35       private boolean autoUpdate = true;
36       private boolean autoInsert = true;     
37       private String jcrNodeType;
38       private boolean jcrAutoCreated;
39       private boolean jcrMandatory;
40       private String jcrOnParentVersion;
41       private boolean jcrProtected;
42       private boolean jcrSameNameSiblings;     
43       
44       private ClassDescriptor classDescriptor;
45      
46      /***
47       * @return Returns the fieldName.
48       */
49      public String getFieldName()
50      {
51          return fieldName;
52      }
53      /***
54       * @param fieldName The fieldName to set.
55       */
56      public void setFieldName(String fieldName)
57      {
58          this.fieldName = fieldName;
59      }
60      /***
61       * @return Returns the jcrName.
62       */
63      public String getJcrName()
64      {
65          return jcrName;
66      }
67      /***
68       * @param jcrName The jcrName to set.
69       */
70      public void setJcrName(String jcrName)
71      {
72          this.jcrName = jcrName;
73      }
74      
75      
76      /***
77       * @return Returns the elementClassName.
78       */
79      public String getElementClassName()
80      {
81          return elementClassName;
82      }
83      /***
84       * @param elementClassName The collection element class name to set.
85       *
86       */
87      public void setElementClassName(String elementClassName)
88      {
89          this.elementClassName = elementClassName;
90      }
91  
92      /***
93       * @return Returns the proxy.
94       */
95      public boolean isProxy()
96      {
97          return proxy;
98      }
99      /***
100      * @param proxy The proxy to set.
101      */
102     public void setProxy(boolean proxy)
103     {
104         this.proxy = proxy;
105     }
106     
107     
108     
109     public boolean isAutoInsert() {
110 		return autoInsert;
111 	}
112 	public void setAutoInsert(boolean autoInsert) {
113 		this.autoInsert = autoInsert;
114 	}
115 	public boolean isAutoRetrieve() {
116 		return autoRetrieve;
117 	}
118 	public void setAutoRetrieve(boolean autoRetrieve) {
119 		this.autoRetrieve = autoRetrieve;
120 	}
121 	public boolean isAutoUpdate() {
122 		return autoUpdate;
123 	}
124 	public void setAutoUpdate(boolean autoUpdate) {
125 		this.autoUpdate = autoUpdate;
126 	}
127 	/***
128      * 
129      * @return The collection converter class name 
130      */
131     public String getCollectionConverter()
132     {
133         return collectionConverterClassName;
134     }
135     
136     /***
137      * Set the collection converter class name
138      * @param collectionConverterClassName The converter to set
139      */
140     public void setCollectionConverter(String collectionConverterClassName)
141     {
142         this.collectionConverterClassName = collectionConverterClassName;
143     }
144     
145     /***
146      *  
147      * @return the collection class name (can be also a Map)
148      */
149     public String getCollectionClassName()
150     {
151         return collectionClassName;
152     }
153     
154     /***
155      * Set the collection class name. 
156      * This collection class has to implement {@link org.apache.portals.graffito.jcr.persistence.collectionconverter.ManageableCollection}
157      * @param collectionClassName The collection class name to set
158      */
159     public void setCollectionClassName(String collectionClassName)
160     {
161         this.collectionClassName = collectionClassName;
162     }
163     
164     /***
165      * 
166      * @return The associated class descriptor
167      */
168     public ClassDescriptor getClassDescriptor()
169     {
170         return classDescriptor;
171     }
172     
173     /***
174      * Set the associated class descriptor
175      * @param classDescriptor the class descriptor to set 
176      */
177     public void setClassDescriptor(ClassDescriptor classDescriptor)
178     {
179         this.classDescriptor = classDescriptor;
180     }
181     
182     /*** Getter for property jcrNodeType.
183      * 
184      * @return jcrNodeType
185      */
186     public String getJcrNodeType()
187     {
188         return jcrNodeType;
189     }
190 
191     /*** Setter for property jcrNodeType.
192      * 
193      * @param value jcrNodeType
194      */
195     public void setJcrNodeType(String value)
196     {
197         this.jcrNodeType = value;
198     }
199 
200     /*** Getter for property jcrAutoCreated.
201      * 
202      * @return jcrAutoCreated
203      */
204     public boolean isJcrAutoCreated()
205     {
206         return jcrAutoCreated;
207     }
208 
209     /*** Setter for property jcrAutoCreated.
210      * 
211      * @param value jcrAutoCreated
212      */
213     public void setJcrAutoCreated(boolean value)
214     {
215         this.jcrAutoCreated = value;
216     }
217 
218     /*** Getter for property jcrMandatory.
219      * 
220      * @return jcrMandatory
221      */
222     public boolean isJcrMandatory()
223     {
224         return jcrMandatory;
225     }
226 
227     /*** Setter for property jcrMandatory.
228      * 
229      * @param value jcrMandatory
230      */
231     public void setJcrMandatory(boolean value)
232     {
233         this.jcrMandatory = value;
234     }
235 
236     /*** Getter for property jcrOnParentVersion.
237      * 
238      * @return jcrOnParentVersion
239      */
240     public String getJcrOnParentVersion()
241     {
242         return jcrOnParentVersion;
243     }
244 
245     /*** Setter for property jcrOnParentVersion.
246      * 
247      * @param value jcrOnParentVersion
248      */
249     public void setJcrOnParentVersion(String value)
250     {
251         this.jcrOnParentVersion = value;
252     }
253 
254     /*** Getter for property jcrProtected.
255      * 
256      * @return jcrProtected
257      */
258     public boolean isJcrProtected()
259     {
260         return jcrProtected;
261     }
262 
263     /*** Setter for property jcrProtected.
264      * 
265      * @param value jcrProtected
266      */
267     public void setJcrProtected(boolean value)
268     {
269         this.jcrProtected = value;
270     }
271 
272     /*** Getter for property jcrSameNameSiblings.
273      * 
274      * @return jcrSameNameSiblings
275      */
276     public boolean isJcrSameNameSiblings()
277     {
278         return jcrSameNameSiblings;
279     }
280 
281     /*** Setter for property jcrSameNameSiblings.
282      * 
283      * @param value jcrSameNameSiblings
284      */
285     public void setJcrSameNameSiblings(boolean value)
286     {
287         this.jcrSameNameSiblings = value;
288     }
289     
290 	public String toString() {
291 		
292 		return "Collection Descriptor : " +  this.getFieldName();
293 	}    
294 }