View Javadoc

1   /*
2    * Copyright 2006 The Xanot team
3    */
4   package org.xanot.structure;
5   
6   /***
7    * Collection adding rule. This rule define how an XML element's attribute tobe
8    * mapped to an object's collection property.
9    * 
10   * @author Ferdinand Neman (newm4n _at_ gmail.com)
11   */
12  public class CloseCollectionInstanceRule extends XanotRule {
13  	private String methodName = "";
14  
15  	private String dateFormat = null;
16  
17  	/***
18  	 * Creates a new CloseColletionInstance object.
19  	 * 
20  	 * @param path
21  	 *            Path of the element. Equals to xml element name.
22  	 * @param methodName
23  	 *            Method name tobe called on the parent object for addition.
24  	 */
25  	public CloseCollectionInstanceRule(String path, String methodName) {
26  		super(path);
27  		this.methodName = methodName;
28  	}
29  
30  	/***
31  	 * Get the parent's method name used for addition.
32  	 * 
33  	 * @return Returns the methodName.
34  	 */
35  	public String getMethodName() {
36  		return methodName;
37  	}
38  
39  	/***
40  	 * Set the parent's method name used for addition.
41  	 * 
42  	 * @param methodName
43  	 *            The methodName to set.
44  	 */
45  	public void setMethodName(String methodName) {
46  		this.methodName = methodName;
47  	}
48  
49  	/***
50  	 * Get string representation of this object.
51  	 * 
52  	 * @return String representation.
53  	 */
54  	public String toString() {
55  		return "CloseCollectionInstanceRule : [path:" + getPath()
56  				+ "],[methodName:" + methodName + "]";
57  	}
58  
59  	/***
60  	 * Get the date format value.
61  	 * 
62  	 * @return Date format pattern
63  	 */
64  	public String getDateFormat() {
65  		return dateFormat;
66  	}
67  
68  	/***
69  	 * Set the date format value
70  	 * 
71  	 * @param dateFormat
72  	 *            new date format pattern
73  	 */
74  	public void setDateFormat(String dateFormat) {
75  		this.dateFormat = dateFormat;
76  	}
77  }