View Javadoc

1   /*
2    * Copyright 2006 The Xanot team
3    */
4   package org.xanot.structure;
5   
6   /***
7    * Close instance rule. This rule define how an XML element's element tobe set
8    * into the parent property.
9    * 
10   * @author Ferdinand Neman (newm4n _at_ gmail.com)
11   */
12  public class CloseInstanceRule extends XanotRule {
13  	private String propertyName = null;
14  
15  	private String dateFormat = null;
16  
17  	/***
18  	 * Creates a new CloseInstanceRule object.
19  	 * 
20  	 * @param path
21  	 *            The path, should be equals to the closing xml tag name.
22  	 * @param propertyName
23  	 *            Property on the parent side where the object belongs.
24  	 */
25  	public CloseInstanceRule(String path, String propertyName) {
26  		super(path);
27  		setPropertyName(propertyName);
28  	}
29  
30  	/***
31  	 * Get property on the parent side where the object belongs.
32  	 * 
33  	 * @return Returns the propertyName.
34  	 */
35  	public String getPropertyName() {
36  		return propertyName;
37  	}
38  
39  	/***
40  	 * Set property on the parent side where the object belongs.
41  	 * 
42  	 * @param propertyName
43  	 *            The propertyName to set.
44  	 */
45  	public void setPropertyName(String propertyName) {
46  		this.propertyName = propertyName;
47  	}
48  
49  	/***
50  	 * Get string representation of this object.
51  	 * 
52  	 * @return String representation.
53  	 */
54  	public String toString() {
55  		return "CloseInstanceRule : [path:" + getPath() + "],[property:"
56  				+ propertyName + "]";
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  }