Skip to content

Commit 493ce17

Browse files
committed
Javadoc
1 parent b90e8a1 commit 493ce17

File tree

4 files changed

+73
-34
lines changed

4 files changed

+73
-34
lines changed

src/main/java/org/apache/commons/jxpath/ri/model/dynabeans/DynaBeanPointer.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class DynaBeanPointer extends PropertyOwnerPointer {
3434

3535
/**
3636
* Learn whether two objects are == || .equals().
37-
*
37+
*
3838
* @param o1 first object
3939
* @param o2 second object
4040
* @return boolean
@@ -43,12 +43,19 @@ private static boolean equalObjects(final Object o1, final Object o2) {
4343
return o1 == o2 || o1 != null && o1.equals(o2);
4444
}
4545

46+
/**
47+
* Qualified name.
48+
*/
4649
private final QName qName;
50+
51+
/**
52+
* DynaBean.
53+
*/
4754
private final DynaBean dynaBean;
4855

4956
/**
5057
* Constructs a new DynaBeanPointer.
51-
*
58+
*
5259
* @param parent pointer
5360
* @param qName is the name given to the first node
5461
* @param dynaBean pointed
@@ -61,7 +68,7 @@ public DynaBeanPointer(final NodePointer parent, final QName qName, final DynaBe
6168

6269
/**
6370
* Constructs a new DynaBeanPointer.
64-
*
71+
*
6572
* @param qName is the name given to the first node
6673
* @param dynaBean pointed
6774
* @param locale Locale

src/main/java/org/apache/commons/jxpath/ri/model/dynabeans/DynaBeanPropertyPointer.java

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,25 @@ public class DynaBeanPropertyPointer extends PropertyPointer {
3636

3737
private static final String CLASS = "class";
3838
private static final long serialVersionUID = 2094421509141267239L;
39+
40+
/**
41+
* DynaBean.
42+
*/
3943
private final DynaBean dynaBean;
44+
45+
/**
46+
* The name of the currently selected property or "*" if none has been selected.
47+
*/
4048
private String name;
49+
50+
/**
51+
* The names of the included properties.
52+
*/
4153
private String[] names;
4254

4355
/**
4456
* Constructs a new DynaBeanPropertyPointer.
45-
*
57+
*
4658
* @param parent pointer
4759
* @param dynaBean pointed
4860
*/
@@ -53,7 +65,7 @@ public DynaBeanPropertyPointer(final NodePointer parent, final DynaBean dynaBean
5365

5466
/**
5567
* Convert a value to the appropriate property type.
56-
*
68+
*
5769
* @param value to convert
5870
* @param element whether this should be a collection element.
5971
* @return conversion result
@@ -84,7 +96,7 @@ public Object getBaseValue() {
8496
/**
8597
* If index == WHOLE_COLLECTION, the value of the property, otherwise the value of the index'th element of the collection represented by the property. If
8698
* the property is not a collection, index should be zero and the value will be the property itself.
87-
*
99+
*
88100
* @return Object
89101
*/
90102
@Override
@@ -127,7 +139,7 @@ public int getPropertyCount() {
127139

128140
/**
129141
* Index of the currently selected property in the list of all properties sorted alphabetically.
130-
*
142+
*
131143
* @return int
132144
*/
133145
@Override
@@ -147,7 +159,7 @@ public int getPropertyIndex() {
147159

148160
/**
149161
* Returns the name of the currently selected property or "*" if none has been selected.
150-
*
162+
*
151163
* @return String
152164
*/
153165
@Override
@@ -172,15 +184,15 @@ public String[] getPropertyNames() {
172184
properties.add(name);
173185
}
174186
}
175-
names = (String[]) properties.toArray(new String[properties.size()]);
187+
names = properties.toArray(new String[properties.size()]);
176188
Arrays.sort(names);
177189
}
178190
return names;
179191
}
180192

181193
/**
182194
* Returns true if the bean has the currently selected property.
183-
*
195+
*
184196
* @return boolean
185197
*/
186198
@Override
@@ -191,7 +203,7 @@ protected boolean isActualProperty() {
191203

192204
/**
193205
* This type of node is auxiliary.
194-
*
206+
*
195207
* @return true
196208
*/
197209
@Override
@@ -201,7 +213,7 @@ public boolean isContainer() {
201213

202214
/**
203215
* Learn whether the property referenced is an indexed property.
204-
*
216+
*
205217
* @return boolean
206218
*/
207219
protected boolean isIndexedProperty() {
@@ -226,7 +238,7 @@ public void remove() {
226238

227239
/**
228240
* Index a property by its index in the list of all properties sorted alphabetically.
229-
*
241+
*
230242
* @param index to set
231243
*/
232244
@Override
@@ -239,7 +251,7 @@ public void setPropertyIndex(final int index) {
239251

240252
/**
241253
* Select a property by name.
242-
*
254+
*
243255
* @param propertyName to select
244256
*/
245257
@Override
@@ -250,7 +262,7 @@ public void setPropertyName(final String propertyName) {
250262

251263
/**
252264
* Sets an indexed value.
253-
*
265+
*
254266
* @param index to change
255267
* @param value to set
256268
*/
@@ -268,7 +280,7 @@ private void setValue(final int index, final Object value) {
268280
/**
269281
* If index == WHOLE_COLLECTION, change the value of the property, otherwise change the value of the index'th element of the collection represented by the
270282
* property.
271-
*
283+
*
272284
* @param value to set
273285
*/
274286
@Override

src/main/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPointer.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,25 @@
3535
public class DynamicPointer extends PropertyOwnerPointer {
3636

3737
private static final long serialVersionUID = -1842347025295904256L;
38+
39+
/**
40+
* Qualified name.
41+
*/
3842
private final QName qName;
43+
44+
/**
45+
* Java bean.
46+
*/
3947
private final Object bean;
48+
49+
/**
50+
* Dynamic property handler.
51+
*/
4052
private final DynamicPropertyHandler handler;
4153

4254
/**
4355
* Constructs a new DynamicPointer.
44-
*
56+
*
4557
* @param parent parent pointer
4658
* @param qName property name
4759
* @param bean owning bean
@@ -56,7 +68,7 @@ public DynamicPointer(final NodePointer parent, final QName qName, final Object
5668

5769
/**
5870
* Constructs a new DynamicPointer.
59-
*
71+
*
6072
* @param qName property name
6173
* @param bean owning bean
6274
* @param handler DynamicPropertyHandler
@@ -101,7 +113,7 @@ public boolean equals(final Object object) {
101113

102114
/**
103115
* Returns the DP object iself.
104-
*
116+
*
105117
* @return Object
106118
*/
107119
@Override
@@ -111,7 +123,7 @@ public Object getBaseValue() {
111123

112124
/**
113125
* Returns 1.
114-
*
126+
*
115127
* @return int
116128
*/
117129
@Override

src/main/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPropertyPointer.java

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,26 @@
3535
public class DynamicPropertyPointer extends PropertyPointer {
3636

3737
private static final long serialVersionUID = -5720585681149150822L;
38+
39+
/**
40+
* Dynamic property handler.
41+
*/
3842
private final DynamicPropertyHandler handler;
39-
43+
4044
/** The name of the currently selected property or "*" if none has been selected. */
4145
private String name;
42-
46+
4347
/** The names of all properties, sorted alphabetically. */
4448
private String[] names;
49+
50+
/**
51+
* The property name from {@link #setPropertyName(String)}.
52+
*/
4553
private String requiredPropertyName;
4654

4755
/**
4856
* Constructs a new DynamicPropertyPointer.
49-
*
57+
*
5058
* @param parent pointer
5159
* @param handler DynamicPropertyHandler
5260
*/
@@ -110,7 +118,7 @@ public NodePointer createPath(final JXPathContext context, final Object value) {
110118

111119
/**
112120
* Returns the value of the property, not an element of the collection represented by the property, if any.
113-
*
121+
*
114122
* @return Object
115123
*/
116124
@Override
@@ -121,7 +129,7 @@ public Object getBaseValue() {
121129
/**
122130
* If index == WHOLE_COLLECTION, the value of the property, otherwise the value of the index'th element of the collection represented by the property. If
123131
* the property is not a collection, index should be zero and the value will be the property itself.
124-
*
132+
*
125133
* @return Object
126134
*/
127135
@Override
@@ -137,7 +145,7 @@ public Object getImmediateNode() {
137145

138146
/**
139147
* Number of the DP object's properties.
140-
*
148+
*
141149
* @return int
142150
*/
143151
@Override
@@ -147,7 +155,7 @@ public int getPropertyCount() {
147155

148156
/**
149157
* Index of the currently selected property in the list of all properties sorted alphabetically.
150-
*
158+
*
151159
* @return int
152160
*/
153161
@Override
@@ -166,7 +174,7 @@ public int getPropertyIndex() {
166174

167175
/**
168176
* Gets the name of the currently selected property or "*" if none has been selected.
169-
*
177+
*
170178
* @return String
171179
*/
172180
@Override
@@ -180,7 +188,7 @@ public String getPropertyName() {
180188

181189
/**
182190
* Gets the names of all properties, sorted alphabetically.
183-
*
191+
*
184192
* @return String[]
185193
*/
186194
@Override
@@ -206,7 +214,7 @@ public String[] getPropertyNames() {
206214

207215
/**
208216
* A dynamic property is always considered actual - all keys are apparently existing with possibly the value of null.
209-
*
217+
*
210218
* @return boolean
211219
*/
212220
@Override
@@ -216,7 +224,7 @@ protected boolean isActualProperty() {
216224

217225
/**
218226
* This type of node is auxiliary.
219-
*
227+
*
220228
* @return true
221229
*/
222230
@Override
@@ -250,7 +258,7 @@ private void removeKey() {
250258

251259
/**
252260
* Index a property by its index in the list of all properties sorted alphabetically.
253-
*
261+
*
254262
* @param index to set
255263
*/
256264
@Override
@@ -264,7 +272,7 @@ public void setPropertyIndex(final int index) {
264272
/**
265273
* Select a property by name. If the supplied name is not one of the object's existing properties, it implicitly adds this name to the object's property
266274
* name list. It does not set the property value though. In order to set the property value, call setValue().
267-
*
275+
*
268276
* @param propertyName to set
269277
*/
270278
@Override
@@ -280,7 +288,7 @@ public void setPropertyName(final String propertyName) {
280288
/**
281289
* If index == WHOLE_COLLECTION, change the value of the property, otherwise change the value of the index'th element of the collection represented by the
282290
* property.
283-
*
291+
*
284292
* @param value to set
285293
*/
286294
@Override

0 commit comments

Comments
 (0)