Skip to content

Commit b90e8a1

Browse files
committed
Camel case
1 parent d9bb741 commit b90e8a1

32 files changed

+234
-226
lines changed

src/main/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,11 @@ public Object getValue(final String xpath, final Expression expr, final Class re
598598
/**
599599
* Gets a VariablePointer for the given variable name.
600600
*
601-
* @param name variable name
601+
* @param qName variable name
602602
* @return NodePointer
603603
*/
604-
public NodePointer getVariablePointer(final QName name) {
605-
return NodePointer.newNodePointer(name, VariablePointerFactory.contextWrapper(this), getLocale());
604+
public NodePointer getVariablePointer(final QName qName) {
605+
return NodePointer.newNodePointer(qName, VariablePointerFactory.contextWrapper(this), getLocale());
606606
}
607607

608608
/**

src/main/java/org/apache/commons/jxpath/ri/axes/AttributeContext.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ public boolean nextNode() {
5858
super.setPosition(getCurrentPosition() + 1);
5959
if (!setStarted) {
6060
setStarted = true;
61-
QName name;
61+
QName qName;
6262
if (nodeTest instanceof NodeNameTest) {
63-
name = ((NodeNameTest) nodeTest).getNodeName();
63+
qName = ((NodeNameTest) nodeTest).getNodeName();
6464
} else if (nodeTest instanceof NodeTypeTest && ((NodeTypeTest) nodeTest).getNodeType() == Compiler.NODE_TYPE_NODE) {
65-
name = WILDCARD;
65+
qName = WILDCARD;
6666
} else {
6767
iterator = null;
6868
return false;
6969
}
70-
iterator = parentContext.getCurrentNodePointer().attributeIterator(name);
70+
iterator = parentContext.getCurrentNodePointer().attributeIterator(qName);
7171
}
7272
if (iterator == null) {
7373
return false;

src/main/java/org/apache/commons/jxpath/ri/axes/SimplePathInterpreter.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ private static int computeQuality(NodePointer pointer) {
8282
private static NodePointer createChildPointerForStep(final PropertyOwnerPointer parentPointer, final Step step) {
8383
final int axis = step.getAxis();
8484
if (axis == Compiler.AXIS_CHILD || axis == Compiler.AXIS_ATTRIBUTE) {
85-
final QName name = ((NodeNameTest) step.getNodeTest()).getNodeName();
86-
if (axis == Compiler.AXIS_ATTRIBUTE && isLangAttribute(name)) {
85+
final QName qName = ((NodeNameTest) step.getNodeTest()).getNodeName();
86+
if (axis == Compiler.AXIS_ATTRIBUTE && isLangAttribute(qName)) {
8787
return new LangAttributePointer(parentPointer);
8888
}
89-
if (parentPointer.isValidProperty(name)) {
89+
if (parentPointer.isValidProperty(qName)) {
9090
final NodePointer childPointer = parentPointer.getPropertyPointer();
91-
((PropertyPointer) childPointer).setPropertyName(name.toString());
91+
((PropertyPointer) childPointer).setPropertyName(qName.toString());
9292
childPointer.setAttribute(axis == Compiler.AXIS_ATTRIBUTE);
9393
return childPointer;
9494
}
@@ -116,8 +116,8 @@ public static NodePointer createNullPointer(final EvalContext context, NodePoint
116116
final int axis = step.getAxis();
117117
if (axis == Compiler.AXIS_CHILD || axis == Compiler.AXIS_ATTRIBUTE) {
118118
final NullPropertyPointer pointer = new NullPropertyPointer(parent);
119-
final QName name = ((NodeNameTest) step.getNodeTest()).getNodeName();
120-
pointer.setPropertyName(name.toString());
119+
final QName qName = ((NodeNameTest) step.getNodeTest()).getNodeName();
120+
pointer.setPropertyName(qName.toString());
121121
pointer.setAttribute(axis == Compiler.AXIS_ATTRIBUTE);
122122
parent = pointer;
123123
}
@@ -655,11 +655,11 @@ private static boolean isCollectionElement(final NodePointer pointer, final int
655655
/**
656656
* Learn whether {@code name} is a lang attribute.
657657
*
658-
* @param name to compare
658+
* @param qName to compare
659659
* @return boolean
660660
*/
661-
private static boolean isLangAttribute(final QName name) {
662-
return name.getPrefix() != null && name.getPrefix().equals("xml") && name.getName().equals("lang");
661+
private static boolean isLangAttribute(final QName qName) {
662+
return qName.getPrefix() != null && qName.getPrefix().equals("xml") && qName.getName().equals("lang");
663663
}
664664

665665
/**

src/main/java/org/apache/commons/jxpath/ri/model/NodePointer.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ public abstract class NodePointer implements Pointer {
5353
* Allocates an new child NodePointer by iterating through all installed NodePointerFactories until it finds one that can create a pointer.
5454
*
5555
* @param parent pointer
56-
* @param name QName
56+
* @param qName QName
5757
* @param bean Object
5858
* @return NodePointer
5959
*/
60-
public static NodePointer newChildNodePointer(final NodePointer parent, final QName name, final Object bean) {
60+
public static NodePointer newChildNodePointer(final NodePointer parent, final QName qName, final Object bean) {
6161
final NodePointerFactory[] factories = JXPathContextReferenceImpl.getNodePointerFactories();
6262
for (final NodePointerFactory element : factories) {
63-
final NodePointer pointer = element.createNodePointer(parent, name, bean);
63+
final NodePointer pointer = element.createNodePointer(parent, qName, bean);
6464
if (pointer != null) {
6565
return pointer;
6666
}
@@ -71,20 +71,20 @@ public static NodePointer newChildNodePointer(final NodePointer parent, final QN
7171
/**
7272
* Allocates an entirely new NodePointer by iterating through all installed NodePointerFactories until it finds one that can create a pointer.
7373
*
74-
* @param name QName
74+
* @param qName QName
7575
* @param bean Object
7676
* @param locale Locale
7777
* @return NodePointer
7878
*/
79-
public static NodePointer newNodePointer(final QName name, final Object bean, final Locale locale) {
79+
public static NodePointer newNodePointer(final QName qName, final Object bean, final Locale locale) {
8080
NodePointer pointer;
8181
if (bean == null) {
82-
pointer = new NullPointer(name, locale);
82+
pointer = new NullPointer(qName, locale);
8383
return pointer;
8484
}
8585
final NodePointerFactory[] factories = JXPathContextReferenceImpl.getNodePointerFactories();
8686
for (final NodePointerFactory element : factories) {
87-
pointer = element.createNodePointer(name, bean, locale);
87+
pointer = element.createNodePointer(qName, bean, locale);
8888
if (pointer != null) {
8989
return pointer;
9090
}
@@ -336,40 +336,40 @@ public int compareTo(final Object object) {
336336
* Called to create a non-existing attribute
337337
*
338338
* @param context the owning JXPathCOntext
339-
* @param name the QName at which an attribute should be created
339+
* @param qName the QName at which an attribute should be created
340340
* @return created NodePointer
341341
*/
342-
public NodePointer createAttribute(final JXPathContext context, final QName name) {
343-
throw new JXPathException("Cannot create an attribute for path " + asPath() + "/@" + name + ", operation is not allowed for this type of node");
342+
public NodePointer createAttribute(final JXPathContext context, final QName qName) {
343+
throw new JXPathException("Cannot create an attribute for path " + asPath() + "/@" + qName + ", operation is not allowed for this type of node");
344344
}
345345

346346
/**
347347
* Called by a child pointer when it needs to create a parent object for a non-existent collection element. It may have to expand the collection, then
348348
* create an element object and return a new pointer describing the newly created element.
349349
*
350350
* @param context the owning JXPathCOntext
351-
* @param name the QName at which a child should be created
351+
* @param qName the QName at which a child should be created
352352
* @param index child index.
353353
* @return created NodePointer
354354
*/
355-
public NodePointer createChild(final JXPathContext context, final QName name, final int index) {
355+
public NodePointer createChild(final JXPathContext context, final QName qName, final int index) {
356356
throw new JXPathException(
357-
"Cannot create an object for path " + asPath() + "/" + name + "[" + (index + 1) + "]" + ", operation is not allowed for this type of node");
357+
"Cannot create an object for path " + asPath() + "/" + qName + "[" + (index + 1) + "]" + ", operation is not allowed for this type of node");
358358
}
359359

360360
/**
361361
* Called by a child pointer if that child needs to assign the value supplied in the createPath(context, value) call to a non-existent node. This method may
362362
* have to expand the collection in order to assign the element.
363363
*
364364
* @param context the owning JXPathCOntext
365-
* @param name the QName at which a child should be created
365+
* @param qName the QName at which a child should be created
366366
* @param index child index.
367367
* @param value node value to set
368368
* @return created NodePointer
369369
*/
370-
public NodePointer createChild(final JXPathContext context, final QName name, final int index, final Object value) {
370+
public NodePointer createChild(final JXPathContext context, final QName qName, final int index, final Object value) {
371371
throw new JXPathException(
372-
"Cannot create an object for path " + asPath() + "/" + name + "[" + (index + 1) + "]" + ", operation is not allowed for this type of node");
372+
"Cannot create an object for path " + asPath() + "/" + qName + "[" + (index + 1) + "]" + ", operation is not allowed for this type of node");
373373
}
374374

375375
/**

src/main/java/org/apache/commons/jxpath/ri/model/NodePointerFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@ public interface NodePointerFactory {
3131
* Create a NodePointer for the supplied child object.
3232
*
3333
* @param parent parent node
34-
* @param name String node name
34+
* @param qName node name
3535
* @param object child object
3636
* @return null if this factory does not recognize objects of the supplied type.
3737
*/
38-
NodePointer createNodePointer(NodePointer parent, QName name, Object object);
38+
NodePointer createNodePointer(NodePointer parent, QName qName, Object object);
3939

4040
/**
4141
* Create a NodePointer for the supplied object. The node will represent the "root" object for a path.
4242
*
43-
* @param name String node name
43+
* @param qName node name
4444
* @param object child object
4545
* @param locale Locale
4646
* @return null if this factory does not recognize objects of the supplied type.
4747
*/
48-
NodePointer createNodePointer(QName name, Object object, Locale locale);
48+
NodePointer createNodePointer(QName qName, Object object, Locale locale);
4949

5050
/**
5151
* The factory order number determines its position between other factories.

src/main/java/org/apache/commons/jxpath/ri/model/VariablePointer.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class VariablePointer extends NodePointer {
4444
/**
4545
* Qualified name.
4646
*/
47-
private final QName name;
47+
private final QName qName;
4848

4949
/**
5050
* Value pointer.
@@ -59,32 +59,32 @@ public class VariablePointer extends NodePointer {
5959
/**
6060
* Constructs a new (non-actual) VariablePointer.
6161
*
62-
* @param name variable name
62+
* @param qName variable name
6363
*/
64-
public VariablePointer(final QName name) {
64+
public VariablePointer(final QName qName) {
6565
super(null);
66-
this.name = name;
66+
this.qName = qName;
6767
actual = false;
6868
}
6969

7070
/**
7171
* Constructs a new VariablePointer.
7272
*
7373
* @param variables Variables instance
74-
* @param name variable name
74+
* @param qName variable name
7575
*/
76-
public VariablePointer(final Variables variables, final QName name) {
76+
public VariablePointer(final Variables variables, final QName qName) {
7777
super(null);
7878
this.variables = variables;
79-
this.name = name;
79+
this.qName = qName;
8080
actual = true;
8181
}
8282

8383
@Override
8484
public String asPath() {
8585
final StringBuilder buffer = new StringBuilder();
8686
buffer.append('$');
87-
buffer.append(name);
87+
buffer.append(qName);
8888
if (!actual) {
8989
if (index != WHOLE_COLLECTION) {
9090
buffer.append('[').append(index + 1).append(']');
@@ -96,8 +96,8 @@ public String asPath() {
9696
}
9797

9898
@Override
99-
public NodeIterator attributeIterator(final QName name) {
100-
return getValuePointer().attributeIterator(name);
99+
public NodeIterator attributeIterator(final QName qName) {
100+
return getValuePointer().attributeIterator(qName);
101101
}
102102

103103
@Override
@@ -111,7 +111,7 @@ public int compareChildNodePointers(final NodePointer pointer1, final NodePointe
111111
}
112112

113113
@Override
114-
public NodePointer createChild(final JXPathContext context, final QName name, final int index) {
114+
public NodePointer createChild(final JXPathContext context, final QName qName, final int index) {
115115
final Object collection = createCollection(context, index);
116116
if (!isActual() || index != 0 && index != WHOLE_COLLECTION) {
117117
final AbstractFactory factory = getAbstractFactory(context);
@@ -127,7 +127,7 @@ public NodePointer createChild(final JXPathContext context, final QName name, fi
127127
}
128128

129129
@Override
130-
public NodePointer createChild(final JXPathContext context, final QName name, final int index, final Object value) {
130+
public NodePointer createChild(final JXPathContext context, final QName qName, final int index, final Object value) {
131131
final Object collection = createCollection(context, index);
132132
ValueUtils.setValue(collection, index, value);
133133
final NodePointer cl = (NodePointer) clone();
@@ -146,7 +146,7 @@ private Object createCollection(final JXPathContext context, int index) {
146146
createPath(context);
147147
Object collection = getBaseValue();
148148
if (collection == null) {
149-
throw new JXPathAbstractFactoryException("Factory did not assign a collection to variable '" + name + "' for path: " + asPath());
149+
throw new JXPathAbstractFactoryException("Factory did not assign a collection to variable '" + qName + "' for path: " + asPath());
150150
}
151151
if (index == WHOLE_COLLECTION) {
152152
index = 0;
@@ -155,7 +155,7 @@ private Object createCollection(final JXPathContext context, int index) {
155155
}
156156
if (index >= getLength()) {
157157
collection = ValueUtils.expandCollection(collection, index + 1);
158-
variables.declareVariable(name.toString(), collection);
158+
variables.declareVariable(qName.toString(), collection);
159159
}
160160
return collection;
161161
}
@@ -164,8 +164,8 @@ private Object createCollection(final JXPathContext context, int index) {
164164
public NodePointer createPath(final JXPathContext context) {
165165
if (!actual) {
166166
final AbstractFactory factory = getAbstractFactory(context);
167-
if (!factory.declareVariable(context, name.toString())) {
168-
throw new JXPathAbstractFactoryException("Factory cannot define variable '" + name + "' for path: " + asPath());
167+
if (!factory.declareVariable(context, qName.toString())) {
168+
throw new JXPathAbstractFactoryException("Factory cannot define variable '" + qName + "' for path: " + asPath());
169169
}
170170
findVariables(context);
171171
// Assert: actual == true
@@ -193,7 +193,7 @@ public boolean equals(final Object object) {
193193
return false;
194194
}
195195
final VariablePointer other = (VariablePointer) object;
196-
return variables == other.variables && name.equals(other.name) && index == other.index;
196+
return variables == other.variables && qName.equals(other.qName) && index == other.index;
197197
}
198198

199199
/**
@@ -206,7 +206,7 @@ protected void findVariables(final JXPathContext context) {
206206
JXPathContext varCtx = context;
207207
while (varCtx != null) {
208208
variables = varCtx.getVariables();
209-
if (variables.isDeclaredVariable(name.toString())) {
209+
if (variables.isDeclaredVariable(qName.toString())) {
210210
actual = true;
211211
break;
212212
}
@@ -218,9 +218,9 @@ protected void findVariables(final JXPathContext context) {
218218
@Override
219219
public Object getBaseValue() {
220220
if (!actual) {
221-
throw new JXPathException("Undefined variable: " + name);
221+
throw new JXPathException("Undefined variable: " + qName);
222222
}
223-
return variables.getVariable(name.toString());
223+
return variables.getVariable(qName.toString());
224224
}
225225

226226
@Override
@@ -240,7 +240,7 @@ public NodePointer getImmediateValuePointer() {
240240

241241
@Override
242242
public Object getImmediateNode() {
243-
throw new JXPathException("Undefined variable: " + name);
243+
throw new JXPathException("Undefined variable: " + qName);
244244
}
245245
};
246246
}
@@ -261,12 +261,12 @@ public int getLength() {
261261

262262
@Override
263263
public QName getName() {
264-
return name;
264+
return qName;
265265
}
266266

267267
@Override
268268
public int hashCode() {
269-
return (actual ? System.identityHashCode(variables) : 0) + name.hashCode() + index;
269+
return (actual ? System.identityHashCode(variables) : 0) + qName.hashCode() + index;
270270
}
271271

272272
@Override
@@ -305,15 +305,15 @@ public NodePointer namespacePointer(final String name) {
305305
public void remove() {
306306
if (actual) {
307307
if (index == WHOLE_COLLECTION) {
308-
variables.undeclareVariable(name.toString());
308+
variables.undeclareVariable(qName.toString());
309309
} else {
310310
if (index < 0) {
311311
throw new JXPathInvalidAccessException("Index is less than 1: " + asPath());
312312
}
313313
Object collection = getBaseValue();
314314
if (collection != null && index < getLength()) {
315315
collection = ValueUtils.remove(collection, index);
316-
variables.declareVariable(name.toString(), collection);
316+
variables.declareVariable(qName.toString(), collection);
317317
}
318318
}
319319
}
@@ -328,14 +328,14 @@ public void setIndex(final int index) {
328328
@Override
329329
public void setValue(final Object value) {
330330
if (!actual) {
331-
throw new JXPathException("Cannot set undefined variable: " + name);
331+
throw new JXPathException("Cannot set undefined variable: " + qName);
332332
}
333333
valuePointer = null;
334334
if (index != WHOLE_COLLECTION) {
335335
final Object collection = getBaseValue();
336336
ValueUtils.setValue(collection, index, value);
337337
} else {
338-
variables.declareVariable(name.toString(), value);
338+
variables.declareVariable(qName.toString(), value);
339339
}
340340
}
341341

0 commit comments

Comments
 (0)