Skip to content

Commit 65efec0

Browse files
committed
Javadoc
1 parent 2147937 commit 65efec0

File tree

10 files changed

+139
-86
lines changed

10 files changed

+139
-86
lines changed

src/main/java/org/apache/commons/jxpath/JXPathBasicBeanInfo.java

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,34 @@ public class JXPathBasicBeanInfo implements JXPathBeanInfo {
3838
private static final Comparator PROPERTY_DESCRIPTOR_COMPARATOR = (left, right) -> ((PropertyDescriptor) left).getName()
3939
.compareTo(((PropertyDescriptor) right).getName());
4040

41+
/**
42+
* Whether objects of this class are treated as atomic objects which have no properties of their own.
43+
*/
4144
private boolean atomic;
45+
46+
/**
47+
* Bean class.
48+
*/
4249
private final Class clazz;
50+
51+
/**
52+
* The DynamicPropertyHandler class for a dynamic class.
53+
*/
4354
private Class dynamicPropertyHandlerClass;
55+
56+
/**
57+
* List of property descriptors for the beans described by this bean info object.
58+
*/
4459
private transient PropertyDescriptor[] propertyDescriptors;
60+
61+
/**
62+
* PropertyDescriptor for the specified name or null if there is no such property.
63+
*/
4564
private transient HashMap propertyDescriptorMap;
4665

4766
/**
4867
* Create a new JXPathBasicBeanInfo.
49-
*
68+
*
5069
* @param clazz bean class
5170
*/
5271
public JXPathBasicBeanInfo(final Class clazz) {
@@ -55,7 +74,7 @@ public JXPathBasicBeanInfo(final Class clazz) {
5574

5675
/**
5776
* Create a new JXPathBasicBeanInfo.
58-
*
77+
*
5978
* @param clazz bean class
6079
* @param atomic whether objects of this class are treated as atomic objects which have no properties of their own.
6180
*/
@@ -66,7 +85,7 @@ public JXPathBasicBeanInfo(final Class clazz, final boolean atomic) {
6685

6786
/**
6887
* Create a new JXPathBasicBeanInfo.
69-
*
88+
*
7089
* @param clazz bean class
7190
* @param dynamicPropertyHandlerClass dynamic property handler class
7291
*/
@@ -77,9 +96,9 @@ public JXPathBasicBeanInfo(final Class clazz, final Class dynamicPropertyHandler
7796
}
7897

7998
/**
80-
* For a dynamic class, returns the corresponding DynamicPropertyHandler class.
81-
*
82-
* @return Class
99+
* Gets the DynamicPropertyHandler class for a dynamic class.
100+
*
101+
* @return the DynamicPropertyHandler class for a dynamic class.
83102
*/
84103
@Override
85104
public Class getDynamicPropertyHandlerClass() {
@@ -131,9 +150,9 @@ public synchronized PropertyDescriptor[] getPropertyDescriptors() {
131150
}
132151

133152
/**
134-
* Returns true if objects of this class are treated as atomic objects which have no properties of their own.
135-
*
136-
* @return boolean
153+
* Tests whether objects of this class are treated as atomic objects which have no properties of their own.
154+
*
155+
* @return whether objects of this class are treated as atomic objects which have no properties of their own.
137156
*/
138157
@Override
139158
public boolean isAtomic() {
@@ -142,7 +161,7 @@ public boolean isAtomic() {
142161

143162
/**
144163
* Return true if the corresponding objects have dynamic properties.
145-
*
164+
*
146165
* @return boolean
147166
*/
148167
@Override

src/main/java/org/apache/commons/jxpath/JXPathBeanInfo.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,41 +30,41 @@
3030
public interface JXPathBeanInfo extends Serializable {
3131

3232
/**
33-
* For dynamic objects, returns the class implementing the {@link DynamicPropertyHandler} interface. That class can be used to access dynamic properties.
34-
*
35-
* @return Class
33+
* Gets the class implementing the {@link DynamicPropertyHandler} interface for dynamic objects. That class can be used to access dynamic properties.
34+
*
35+
* @return Class The class implementing the {@link DynamicPropertyHandler} interface.
3636
*/
3737
Class getDynamicPropertyHandlerClass();
3838

3939
/**
40-
* Returns a PropertyDescriptor for the specified name or null if there is no such property.
41-
*
40+
* Gets a PropertyDescriptor for the specified name or null if there is no such property.
41+
*
4242
* @param propertyName property name
4343
* @return PropertyDescriptor
4444
*/
4545
PropertyDescriptor getPropertyDescriptor(String propertyName);
4646

4747
/**
48-
* Returns a list of property descriptors for the beans described by this bean info object. Returns null for atomic beans.
49-
*
48+
* Gets a list of property descriptors for the beans described by this bean info object. Returns null for atomic beans.
49+
*
5050
* @return PropertyDescriptor[]
5151
*/
5252
PropertyDescriptor[] getPropertyDescriptors();
5353

5454
/**
55-
* Returns true if objects of this class are treated as atomic objects which have no properties of their own. For example, {@link String} and {@link Number}
55+
* Tests whether objects of this class are treated as atomic objects which have no properties of their own. For example, {@link String} and {@link Number}
5656
* are atomic.
57-
*
58-
* @return boolean
57+
*
58+
* @return Tests whether objects of this class are treated as atomic objects.
5959
*/
6060
boolean isAtomic();
6161

6262
/**
63-
* Returns true if the objects of this class have dynamic properties (e.g. java.util.Map). If this method returns true, {@link #getPropertyDescriptors}
64-
* should return null and {@link #getDynamicPropertyHandlerClass} should return a valid class name. An object cannot have both static and dynamic properties
65-
* at the same time.
66-
*
67-
* @return boolean
63+
* Tests whether the objects of this class have dynamic properties (e.g. java.util.Map). If this method returns true, {@link #getPropertyDescriptors} should
64+
* return null and {@link #getDynamicPropertyHandlerClass} should return a valid class name. An object cannot have both static and dynamic properties at the
65+
* same time.
66+
*
67+
* @return whether the objects of this class have dynamic properties.
6868
*/
6969
boolean isDynamic();
7070
}

src/main/java/org/apache/commons/jxpath/Variables.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,32 @@ public interface Variables extends Serializable {
2828
/**
2929
* Defines a new variable with the specified value or modifies the value of an existing variable. May throw UnsupportedOperationException.
3030
*
31-
* @param varName variable name
31+
* @param name variable name
3232
* @param value to declare
3333
*/
34-
void declareVariable(String varName, Object value);
34+
void declareVariable(String name, Object value);
3535

3636
/**
3737
* Returns the value of the specified variable.
3838
*
39-
* @param varName variable name
39+
* @param name variable name
4040
* @return Object value
4141
* @throws IllegalArgumentException if there is no such variable.
4242
*/
43-
Object getVariable(String varName);
43+
Object getVariable(String name);
4444

4545
/**
4646
* Returns true if the specified variable is declared.
4747
*
48-
* @param varName variable name
48+
* @param name variable name
4949
* @return boolean
5050
*/
51-
boolean isDeclaredVariable(String varName);
51+
boolean isDeclaredVariable(String name);
5252

5353
/**
5454
* Removes an existing variable. May throw UnsupportedOperationException.
5555
*
56-
* @param varName is a variable name without the "$" sign
56+
* @param name is a variable name without the "$" sign
5757
*/
58-
void undeclareVariable(String varName);
58+
void undeclareVariable(String name);
5959
}

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ public class DynamicPropertyPointer extends PropertyPointer {
3636

3737
private static final long serialVersionUID = -5720585681149150822L;
3838
private final DynamicPropertyHandler handler;
39+
40+
/** The name of the currently selected property or "*" if none has been selected. */
3941
private String name;
42+
43+
/** The names of all properties, sorted alphabetically. */
4044
private String[] names;
4145
private String requiredPropertyName;
4246

@@ -161,7 +165,7 @@ public int getPropertyIndex() {
161165
}
162166

163167
/**
164-
* Returns the name of the currently selected property or "*" if none has been selected.
168+
* Gets the name of the currently selected property or "*" if none has been selected.
165169
*
166170
* @return String
167171
*/
@@ -175,7 +179,7 @@ public String getPropertyName() {
175179
}
176180

177181
/**
178-
* Names of all properties, sorted alphabetically.
182+
* Gets the names of all properties, sorted alphabetically.
179183
*
180184
* @return String[]
181185
*/

src/main/java/org/apache/commons/jxpath/ri/model/jdom/JDOMAttributePointer.java

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,19 @@
2828
public class JDOMAttributePointer extends NodePointer {
2929

3030
private static final long serialVersionUID = 8896050354479644028L;
31-
private final Attribute attr;
31+
32+
/** JDOM Attribute. */
33+
private final Attribute attribute;
3234

3335
/**
3436
* Create a JDOMAttributePointer.
35-
*
36-
* @param parent NodePointer parent
37-
* @param attr JDOM Attribute
37+
*
38+
* @param parent NodePointer parent.
39+
* @param attribute JDOM Attribute.
3840
*/
39-
public JDOMAttributePointer(final NodePointer parent, final Attribute attr) {
41+
public JDOMAttributePointer(final NodePointer parent, final Attribute attribute) {
4042
super(parent);
41-
this.attr = attr;
43+
this.attribute = attribute;
4244
}
4345

4446
@Override
@@ -63,17 +65,17 @@ public int compareChildNodePointers(final NodePointer pointer1, final NodePointe
6365

6466
@Override
6567
public boolean equals(final Object object) {
66-
return object == this || object instanceof JDOMAttributePointer && ((JDOMAttributePointer) object).attr == attr;
68+
return object == this || object instanceof JDOMAttributePointer && ((JDOMAttributePointer) object).attribute == attribute;
6769
}
6870

6971
@Override
7072
public Object getBaseValue() {
71-
return attr;
73+
return attribute;
7274
}
7375

7476
@Override
7577
public Object getImmediateNode() {
76-
return attr;
78+
return attribute;
7779
}
7880

7981
@Override
@@ -83,12 +85,12 @@ public int getLength() {
8385

8486
@Override
8587
public QName getName() {
86-
return new QName(JDOMNodePointer.getPrefix(attr), JDOMNodePointer.getLocalName(attr));
88+
return new QName(JDOMNodePointer.getPrefix(attribute), JDOMNodePointer.getLocalName(attribute));
8789
}
8890

8991
@Override
9092
public String getNamespaceURI() {
91-
String uri = attr.getNamespaceURI();
93+
String uri = attribute.getNamespaceURI();
9294
if (uri != null && uri.isEmpty()) {
9395
uri = null;
9496
}
@@ -97,12 +99,12 @@ public String getNamespaceURI() {
9799

98100
@Override
99101
public Object getValue() {
100-
return attr.getValue();
102+
return attribute.getValue();
101103
}
102104

103105
@Override
104106
public int hashCode() {
105-
return System.identityHashCode(attr);
107+
return System.identityHashCode(attribute);
106108
}
107109

108110
@Override
@@ -122,11 +124,11 @@ public boolean isLeaf() {
122124

123125
@Override
124126
public void remove() {
125-
attr.getParent().removeAttribute(attr);
127+
attribute.getParent().removeAttribute(attribute);
126128
}
127129

128130
@Override
129131
public void setValue(final Object value) {
130-
attr.setValue((String) TypeUtils.convert(value, String.class));
132+
attribute.setValue((String) TypeUtils.convert(value, String.class));
131133
}
132134
}

src/main/java/org/apache/commons/jxpath/ri/model/jdom/JDOMNamespacePointer.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@
2626
public class JDOMNamespacePointer extends NodePointer {
2727

2828
private static final long serialVersionUID = 7935311686545862379L;
29+
30+
/** Namespace prefix. */
2931
private final String prefix;
32+
33+
/** Namespace URI string. */
3034
private String namespaceURI;
3135

3236
/**
3337
* Create a new JDOMNamespacePointer.
34-
*
38+
*
3539
* @param parent parent pointer
3640
* @param prefix ns prefix
3741
*/
@@ -42,7 +46,7 @@ public JDOMNamespacePointer(final NodePointer parent, final String prefix) {
4246

4347
/**
4448
* Create a new JDOMNamespacePointer.
45-
*
49+
*
4650
* @param parent parent pointer
4751
* @param prefix ns prefix
4852
* @param namespaceURI ns URI
@@ -123,7 +127,7 @@ public boolean isLeaf() {
123127

124128
/**
125129
* Throws UnsupportedOperationException.
126-
*
130+
*
127131
* @param value Object value to set
128132
*/
129133
@Override

0 commit comments

Comments
 (0)