View Javadoc

1   /*
2    * Copyright 2006 The Xanot team
3    */
4   package org.xanot;
5   
6   import java.util.List;
7   
8   import org.xanot.structure.AttributeSetRule;
9   import org.xanot.structure.CloseCollectionInstanceRule;
10  import org.xanot.structure.CloseInstanceRule;
11  import org.xanot.structure.CreateInstanceRule;
12  import org.xanot.structure.ParentReferenceRule;
13  import org.xanot.structure.PropertyCollectionSetRule;
14  import org.xanot.structure.PropertySetRule;
15  import org.xanot.structure.XanotRule;
16  
17  /***
18   * <p>
19   * Generate an object value and creation rule
20   * </p>
21   * 
22   * @author Ferdinand Neman (newm4n_at_gmail.com)
23   */
24  public interface RuleBuilder {
25  	/***
26  	 * Get the root class
27  	 * 
28  	 * @return Root class, never return null
29  	 */
30  	public Class getRoot();
31  
32  	/***
33  	 * Get List of <code>XanotRule</code> with specified path.
34  	 * 
35  	 * @param path
36  	 *            The path
37  	 * @return List of <code>XanotRule</code> that it's path is equals to the
38  	 *         specified path
39  	 */
40  	public List<XanotRule> getRules(String path);
41  
42  	/***
43  	 * Get List of <code>XanotRule</code> that have a path similar to an array
44  	 * of paths.
45  	 * 
46  	 * @param paths
47  	 *            Array of paths.
48  	 * @return List of <code>XanotRule</code> that have a path similar to the
49  	 *         array of path.
50  	 */
51  	public List<XanotRule> getRules(String[] paths);
52  
53  	/***
54  	 * Get <code>CreateInstanceRule</code> with specified path.
55  	 * 
56  	 * @param path
57  	 *            The path
58  	 * @return <code>CreateInstanceRule</code> that it's path is equals to the
59  	 *         specified path
60  	 */
61  	public CreateInstanceRule getCreateInstanceRule(String path);
62  
63  	/***
64  	 * Get array of <code>CreateInstanceRule</code> that have a path similar
65  	 * to an array of paths.
66  	 * 
67  	 * @param paths
68  	 *            Array of paths.
69  	 * @return Array of <code>CreateInstanceRule</code> that have a path
70  	 *         similar to the array of path.
71  	 */
72  	public CreateInstanceRule[] getCreateInstanceRule(String[] paths);
73  
74  	/***
75  	 * Get closer instance with specified path.
76  	 * 
77  	 * @param path
78  	 *            The path
79  	 * @return CloseInstanceRule that it's path is equals to the specified path
80  	 */
81  	public CloseInstanceRule getCloseInstanceRule(String path);
82  
83  	/***
84  	 * Get array of <code>CloseInstanceRule</code> that have a path similar to
85  	 * an array of paths.
86  	 * 
87  	 * @param path
88  	 *            Array of paths.
89  	 * @return Array of <code>CloseInstanceRule</code> that have a path
90  	 *         similar to the array of path.
91  	 */
92  	public CloseInstanceRule[] getCloseInstanceRule(String[] path);
93  
94  	/***
95  	 * Get <code>PropertySetRule</code> with specified path.
96  	 * 
97  	 * @param path
98  	 *            The path
99  	 * @return <code>PropertySetRule</code> that it's path is equals to the
100 	 *         specified path
101 	 */
102 	public PropertySetRule getPropertySetRule(String path);
103 
104 	/***
105 	 * Get array of <code>PropertySetRule</code> that have a path similar to
106 	 * an array of paths.
107 	 * 
108 	 * @param path
109 	 *            Array of paths.
110 	 * @return Array of <code>PropertySetRule</code> that have a path similar
111 	 *         to the array of path.
112 	 */
113 	public PropertySetRule[] getPropertySetRule(String[] path);
114 
115 	/***
116 	 * Get attribute setter with specified path.
117 	 * 
118 	 * @param path
119 	 *            Rule Path
120 	 * @return AttributeSetRule instance or null no Attribute Set rule with that
121 	 *         path.
122 	 */
123 	public AttributeSetRule getAttributeSetRule(String path);
124 
125 	/***
126 	 * Get array of <code>AttributeSetRule</code> that have a path similar to
127 	 * an array of paths.
128 	 * 
129 	 * @param path
130 	 *            Array of paths.
131 	 * @return Array of <code>AttributeSetRule</code> that have a path similar
132 	 *         to the array of path.
133 	 */
134 	public AttributeSetRule[] getAttributeSetRule(String[] path);
135 
136 	/***
137 	 * Get <code>CloseCollectionInstanceRule</code> with specified path.
138 	 * 
139 	 * @param path
140 	 *            The path
141 	 * @return <code>CloseCollectionInstanceRule</code> that it's path is
142 	 *         equals to the specified path
143 	 */
144 	public CloseCollectionInstanceRule getCloseCollectionInstanceRule(
145 			String path);
146 
147 	/***
148 	 * Get array of <code>CloseCollectionInstanceRule</code> that have a path
149 	 * similar to an array of paths.
150 	 * 
151 	 * @param path
152 	 *            Array of paths.
153 	 * @return Array of <code>CloseCollectionInstanceRule</code> that have a
154 	 *         path similar to the array of path.
155 	 */
156 	public CloseCollectionInstanceRule[] getCloseCollectionInstanceRule(
157 			String[] path);
158 
159 	/***
160 	 * Get <code>PropertyCollectionSetRule</code> with specified path.
161 	 * 
162 	 * @param path
163 	 *            The path
164 	 * @return <code>PropertyCollectionSetRule</code> that it's path is equals
165 	 *         to the specified path
166 	 */
167 	public PropertyCollectionSetRule getPropertyCollectionSetRule(String path);
168 
169 	/***
170 	 * Get array of <code>PropertyCollectionSetRule</code> that have a path
171 	 * similar to an array of paths.
172 	 * 
173 	 * @param path
174 	 *            Array of paths.
175 	 * @return Array of <code>PropertyCollectionSetRule</code> that have a
176 	 *         path similar to the array of path.
177 	 */
178 	public PropertyCollectionSetRule[] getPropertyCollectionSetRule(
179 			String[] path);
180 
181 	/***
182 	 * Get <code>CreateInstanceRule</code> with specified path.
183 	 * 
184 	 * @param path
185 	 *            The path
186 	 * @return <code>CreateInstanceRule</code> that it's path is equals to the
187 	 *         specified path
188 	 */
189 	public ParentReferenceRule getParentReferenceRule(String path);
190 
191 	/***
192 	 * Get array of <code>CreateInstanceRule</code> that have a path similar
193 	 * to an array of paths.
194 	 * 
195 	 * @param paths
196 	 *            Array of paths.
197 	 * @return Array of <code>CreateInstanceRule</code> that have a path
198 	 *         similar to the array of path.
199 	 */
200 	public ParentReferenceRule[] getParentReferenceRule(String[] paths);
201 }