1
2
3
4 package org.xanot.structure;
5
6 /***
7 * Propert Collection Setter rule. This rule define how to map sets of xml tag
8 * with same name into object collection property.
9 *
10 * @author Ferdinand Neman (newm4n _at_ gmail.com)
11 */
12 public class PropertyCollectionSetRule extends XanotRule {
13 private String xmlProperty = null;
14
15 private String methodName = null;
16
17 private String dateFormat = null;
18
19 /***
20 * Creates a new PropertyCollectionSetRule object.
21 *
22 * @param path
23 * Path, should be equals to the parent element's tag name.
24 * @param xmlProperty
25 * the xml tag name
26 * @param methodName
27 * Method name tobe invoke for element addition.
28 */
29 public PropertyCollectionSetRule(String path, String xmlProperty,
30 String methodName) {
31 super(path);
32 setMethodName(methodName);
33 setXmlProperty(xmlProperty);
34 }
35
36 /***
37 * Get the method name tobe invoke for element addition.
38 *
39 * @return Returns the methodName.
40 */
41 public String getMethodName() {
42 return methodName;
43 }
44
45 /***
46 * Set the method name tobe invoke for element addition.
47 *
48 * @param methodName
49 * The methodName to set.
50 */
51 public void setMethodName(String methodName) {
52 this.methodName = methodName;
53 }
54
55 /***
56 * Get the xml element tag name
57 *
58 * @return Returns the xmlProperty.
59 */
60 public String getXmlProperty() {
61 return xmlProperty;
62 }
63
64 /***
65 * Set the xml element tag name
66 *
67 * @param xmlProperty
68 * The xmlProperty to set.
69 */
70 public void setXmlProperty(String xmlProperty) {
71 this.xmlProperty = xmlProperty;
72 }
73
74 /***
75 * Get string representation of this object.
76 *
77 * @return String representation.
78 */
79 public String toString() {
80 return "PropertyCollectionSetRule : [path:" + getPath()
81 + "],[xmlProperty:" + xmlProperty + "],[methodName:"
82 + methodName + "]";
83 }
84
85 /***
86 * Get the date format value.
87 *
88 * @return Date format pattern
89 */
90 public String getDateFormat() {
91 return dateFormat;
92 }
93
94 /***
95 * Set the date format value
96 *
97 * @param dateFormat
98 * new date format pattern
99 */
100 public void setDateFormat(String dateFormat) {
101 this.dateFormat = dateFormat;
102 }
103 }