You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/04/12 14:55:45 UTC
(commons-jxpath) 05/06: Fix typos in Javadoc and exception messages
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jxpath.git
commit 56fa34a4fca471bf82690a27c3c2b64f2104d1ed
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sat Apr 12 10:30:18 2025 -0400
Fix typos in Javadoc and exception messages
---
.../apache/commons/jxpath/CompiledExpression.java | 12 ++++++------
.../org/apache/commons/jxpath/JXPathContext.java | 18 +++++++++---------
.../java/org/apache/commons/jxpath/ri/Compiler.java | 2 +-
.../jxpath/ri/JXPathContextReferenceImpl.java | 20 ++++++++++----------
.../commons/jxpath/ri/compiler/Expression.java | 2 +-
.../apache/commons/jxpath/ri/model/NodePointer.java | 2 +-
src/site/xdoc/users-guide.xml | 4 ++--
.../jxpath/ri/JXPathCompiledExpressionTest.java | 2 +-
8 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/src/main/java/org/apache/commons/jxpath/CompiledExpression.java b/src/main/java/org/apache/commons/jxpath/CompiledExpression.java
index bc5423a..27e68f7 100644
--- a/src/main/java/org/apache/commons/jxpath/CompiledExpression.java
+++ b/src/main/java/org/apache/commons/jxpath/CompiledExpression.java
@@ -45,7 +45,7 @@ public interface CompiledExpression {
* <p>
* Will throw an exception if one of the following conditions occurs:
* <ul>
- * <li>Elements of the xpath aleady exist, by the path does not in fact describe an existing property
+ * <li>Elements of the XPath aleady exist, by the path does not in fact describe an existing property
* <li>The AbstractFactory fails to create an instance for an intermediate element.
* <li>The property is not writable (no public, non-static set method)
* </ul>
@@ -57,7 +57,7 @@ public interface CompiledExpression {
Pointer createPathAndSetValue(JXPathContext context, Object value);
/**
- * Traverses the xpath and returns a Pointer. A Pointer provides easy access to a property. If the xpath matches no properties in the graph, the pointer
+ * Traverses the XPath and returns a Pointer. A Pointer provides easy access to a property. If the XPath matches no properties in the graph, the pointer
* will be null.
*
* @param context base
@@ -67,7 +67,7 @@ public interface CompiledExpression {
Pointer getPointer(JXPathContext context, String xpath);
/**
- * Evaluates the xpath and returns the resulting object. Primitive types are wrapped into objects.
+ * Evaluates the XPath and returns the resulting object. Primitive types are wrapped into objects.
*
* @param context to evaluate
* @return Object
@@ -84,7 +84,7 @@ public interface CompiledExpression {
Object getValue(JXPathContext context, Class requiredType);
/**
- * Traverses the xpath and returns a Iterator of all results found for the path. If the xpath matches no properties in the graph, the Iterator will not be
+ * Traverses the XPath and returns a Iterator of all results found for the path. If the XPath matches no properties in the graph, the Iterator will not be
* null.
*
* @param context base
@@ -93,7 +93,7 @@ public interface CompiledExpression {
Iterator iterate(JXPathContext context);
/**
- * Traverses the xpath and returns an Iterator of Pointers. A Pointer provides easy access to a property. If the xpath matches no properties in the graph,
+ * Traverses the XPath and returns an Iterator of Pointers. A Pointer provides easy access to a property. If the XPath matches no properties in the graph,
* the Iterator be empty, but not null.
*
* @param context to iterate
@@ -118,7 +118,7 @@ public interface CompiledExpression {
/**
* Modifies the value of the property described by the supplied xpath. Will throw an exception if one of the following conditions occurs:
* <ul>
- * <li>The xpath does not in fact describe an existing property
+ * <li>The XPath does not in fact describe an existing property
* <li>The property is not writable (no public, non-static set method)
* </ul>
*
diff --git a/src/main/java/org/apache/commons/jxpath/JXPathContext.java b/src/main/java/org/apache/commons/jxpath/JXPathContext.java
index ddd64e0..5f19744 100644
--- a/src/main/java/org/apache/commons/jxpath/JXPathContext.java
+++ b/src/main/java/org/apache/commons/jxpath/JXPathContext.java
@@ -37,7 +37,7 @@ import org.apache.commons.jxpath.util.KeyManagerUtils;
*
* <h2>JXPath Interprets XPath Syntax on Java Object Graphs</h2>
*
- * JXPath uses an intuitive interpretation of the xpath syntax in the context of Java object graphs. Here are some examples:
+ * JXPath uses an intuitive interpretation of the XPath syntax in the context of Java object graphs. Here are some examples:
*
* <h3>Example 1: JavaBean Property Access</h3>
*
@@ -83,7 +83,7 @@ import org.apache.commons.jxpath.util.KeyManagerUtils;
*
* In this case XPath is used to access a property of a nested bean.
* <p>
- * A property identified by the xpath does not have to be a "leaf" property. For instance, we can extract the whole Address object in above example:
+ * A property identified by the XPath does not have to be a "leaf" property. For instance, we can extract the whole Address object in above example:
* </p>
*
* <pre>
@@ -467,7 +467,7 @@ public abstract class JXPathContext {
* <p>
* Will throw an exception if one of the following conditions occurs:
* <ul>
- * <li>Elements of the xpath aleady exist, but the path does not in fact describe an existing property
+ * <li>Elements of the XPath aleady exist, but the path does not in fact describe an existing property
* <li>The AbstractFactory fails to create an instance for an intermediate element.
* <li>The property is not writable (no public, non-static set method)
* </ul>
@@ -621,9 +621,9 @@ public abstract class JXPathContext {
}
/**
- * Traverses the xpath and returns a Pointer. A Pointer provides easy access to a property.
+ * Traverses the XPath and returns a Pointer. A Pointer provides easy access to a property.
* <p>
- * If the xpath <a href='#matches_no_property_in_the_graph'>matches no properties in the graph</a> the behavior depends on the value that has been
+ * If the XPath <a href='#matches_no_property_in_the_graph'>matches no properties in the graph</a> the behavior depends on the value that has been
* configured with {@link #setLenient(boolean)}:
* </p>
* <ul>
@@ -687,7 +687,7 @@ public abstract class JXPathContext {
public abstract JXPathContext getRelativeContext(Pointer pointer);
/**
- * Evaluates the xpath and returns the resulting object. Primitive types are wrapped into objects.
+ * Evaluates the XPath and returns the resulting object. Primitive types are wrapped into objects.
*
* @param xpath to evaluate
* @return Object found
@@ -730,7 +730,7 @@ public abstract class JXPathContext {
}
/**
- * Traverses the xpath and returns an Iterator of all results found for the path. If the xpath matches no properties in the graph, the Iterator will be
+ * Traverses the XPath and returns an Iterator of all results found for the path. If the XPath matches no properties in the graph, the Iterator will be
* empty, but not null.
*
* @param <E> the type of elements returned by the iterator.
@@ -740,7 +740,7 @@ public abstract class JXPathContext {
public abstract <E> Iterator<E> iterate(String xpath);
/**
- * Traverses the xpath and returns an Iterator of Pointers. A Pointer provides easy access to a property. If the xpath matches no properties in the graph,
+ * Traverses the XPath and returns an Iterator of Pointers. A Pointer provides easy access to a property. If the XPath matches no properties in the graph,
* the Iterator be empty, but not null.
*
* @param xpath to iterate
@@ -898,7 +898,7 @@ public abstract class JXPathContext {
/**
* Modifies the value of the property described by the supplied xpath. Will throw an exception if one of the following conditions occurs:
* <ul>
- * <li>The xpath does not in fact describe an existing property
+ * <li>The XPath does not in fact describe an existing property
* <li>The property is not writable (no public, non-static set method)
* </ul>
*
diff --git a/src/main/java/org/apache/commons/jxpath/ri/Compiler.java b/src/main/java/org/apache/commons/jxpath/ri/Compiler.java
index 451b656..b0ee110 100644
--- a/src/main/java/org/apache/commons/jxpath/ri/Compiler.java
+++ b/src/main/java/org/apache/commons/jxpath/ri/Compiler.java
@@ -24,7 +24,7 @@ package org.apache.commons.jxpath.ri;
* Since objects returned by Compiler methods are passed as arguments to other Compiler methods, the descriptions of these methods use virtual types. There are
* four virtual object types: EXPRESSION, QNAME, STEP and NODE_TEST.
* <p>
- * The following example illustrates this notion. This sequence compiles the xpath "foo[round(1 div 2)]/text()": <blockquote>
+ * The following example illustrates this notion. This sequence compiles the XPath "foo[round(1 div 2)]/text()": <blockquote>
*
* <pre>
* Object qname1 = compiler.qname(null, "foo")
diff --git a/src/main/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java b/src/main/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java
index 0119d12..549ef2a 100644
--- a/src/main/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java
+++ b/src/main/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java
@@ -328,7 +328,7 @@ public class JXPathContextReferenceImpl extends JXPathContext {
}
return ((NodePointer) pointer).createPath(this);
} catch (final Throwable ex) {
- throw new JXPathException("Exception trying to create xpath " + xpath, ex);
+ throw new JXPathException("Exception trying to create XPath " + xpath, ex);
}
}
@@ -344,7 +344,7 @@ public class JXPathContextReferenceImpl extends JXPathContext {
try {
return setValue(xpath, expr, value, true);
} catch (final Throwable ex) {
- throw new JXPathException("Exception trying to create xpath " + xpath, ex);
+ throw new JXPathException("Exception trying to create XPath " + xpath, ex);
}
}
@@ -488,7 +488,7 @@ public class JXPathContextReferenceImpl extends JXPathContext {
}
/**
- * Traverses the xpath and returns the resulting object. Primitive types are wrapped into objects.
+ * Traverses the XPath and returns the resulting object. Primitive types are wrapped into objects.
*
* @param xpath expression
* @return Object found
@@ -606,7 +606,7 @@ public class JXPathContextReferenceImpl extends JXPathContext {
}
/**
- * Traverses the xpath and returns a Iterator of all results found for the path. If the xpath matches no properties in the graph, the Iterator will not be
+ * Traverses the XPath and returns a Iterator of all results found for the path. If the XPath matches no properties in the graph, the Iterator will not be
* null.
*
* @param xpath expression
@@ -618,7 +618,7 @@ public class JXPathContextReferenceImpl extends JXPathContext {
}
/**
- * Traverses the xpath and returns a Iterator of all results found for the path. If the xpath matches no properties in the graph, the Iterator will not be
+ * Traverses the XPath and returns a Iterator of all results found for the path. If the XPath matches no properties in the graph, the Iterator will not be
* null.
*
* @param xpath expression
@@ -630,7 +630,7 @@ public class JXPathContextReferenceImpl extends JXPathContext {
}
/**
- * Traverses the xpath and returns an Iterator of Pointers. A Pointer provides easy access to a property. If the xpath matches no properties in the graph,
+ * Traverses the XPath and returns an Iterator of Pointers. A Pointer provides easy access to a property. If the XPath matches no properties in the graph,
* the Iterator be empty, but not null.
*
* @param xpath expression
@@ -642,7 +642,7 @@ public class JXPathContextReferenceImpl extends JXPathContext {
}
/**
- * Traverses the xpath and returns an Iterator of Pointers. A Pointer provides easy access to a property. If the xpath matches no properties in the graph,
+ * Traverses the XPath and returns an Iterator of Pointers. A Pointer provides easy access to a property. If the XPath matches no properties in the graph,
* the Iterator be empty, but not null.
*
* @param xpath expression
@@ -711,7 +711,7 @@ public class JXPathContextReferenceImpl extends JXPathContext {
pointer.remove();
}
} catch (final Throwable ex) {
- throw new JXPathException("Exception trying to remove xpath " + xpath, ex);
+ throw new JXPathException("Exception trying to remove XPath " + xpath, ex);
}
}
@@ -734,7 +734,7 @@ public class JXPathContextReferenceImpl extends JXPathContext {
}
/**
- * Sets the value of xpath to value.
+ * Sets the value of XPath to value.
*
* @param xpath path
* @param expr compiled Expression
@@ -744,7 +744,7 @@ public class JXPathContextReferenceImpl extends JXPathContext {
try {
setValue(xpath, expr, value, false);
} catch (final Throwable ex) {
- throw new JXPathException("Exception trying to set value with xpath " + xpath, ex);
+ throw new JXPathException("Exception trying to set value with XPath " + xpath, ex);
}
}
diff --git a/src/main/java/org/apache/commons/jxpath/ri/compiler/Expression.java b/src/main/java/org/apache/commons/jxpath/ri/compiler/Expression.java
index 712afa0..09ebb3d 100644
--- a/src/main/java/org/apache/commons/jxpath/ri/compiler/Expression.java
+++ b/src/main/java/org/apache/commons/jxpath/ri/compiler/Expression.java
@@ -30,7 +30,7 @@ import org.apache.commons.jxpath.util.ValueUtils;
/**
* Common superclass for several types of nodes in the parse tree. Provides APIs for optimization of evaluation of expressions. Specifically, an expression only
- * needs to executed once during the evaluation of an xpath if that expression is context-independent. Expression.isContextDependent() provides that hint.
+ * needs to executed once during the evaluation of an XPath if that expression is context-independent. Expression.isContextDependent() provides that hint.
*/
public abstract class Expression {
diff --git a/src/main/java/org/apache/commons/jxpath/ri/model/NodePointer.java b/src/main/java/org/apache/commons/jxpath/ri/model/NodePointer.java
index e3b030a..76ba5ce 100644
--- a/src/main/java/org/apache/commons/jxpath/ri/model/NodePointer.java
+++ b/src/main/java/org/apache/commons/jxpath/ri/model/NodePointer.java
@@ -188,7 +188,7 @@ public abstract class NodePointer implements Pointer {
/**
* Returns an XPath that maps to this Pointer.
*
- * @return String xpath expression
+ * @return String XPath expression
*/
@Override
public String asPath() {
diff --git a/src/site/xdoc/users-guide.xml b/src/site/xdoc/users-guide.xml
index 2f48e71..49d0003 100644
--- a/src/site/xdoc/users-guide.xml
+++ b/src/site/xdoc/users-guide.xml
@@ -218,7 +218,7 @@ String fName = (String)context.getValue("firstName");
<subsection name="Lenient Mode">
<p>
The <code>context.getValue(xpath)</code> method throws
- an exception if the supplied xpath does not map to an
+ an exception if the supplied XPath does not map to an
existing property. This constraint can be relaxed by
calling <code>context.setLenient(true)</code>. In the
lenient mode the method merely returns null if the path
@@ -743,7 +743,7 @@ String fName = (String)context.getValue("firstName");
<section name="Exceptions During XPath Evaluation">
<p>
Exceptions thrown by accessor methods are treated differently depending
- on the evaluated xpath and the particular method used to do the
+ on the evaluated XPath and the particular method used to do the
evaluation.
</p>
<p>
diff --git a/src/test/java/org/apache/commons/jxpath/ri/JXPathCompiledExpressionTest.java b/src/test/java/org/apache/commons/jxpath/ri/JXPathCompiledExpressionTest.java
index 0668628..5819a7c 100644
--- a/src/test/java/org/apache/commons/jxpath/ri/JXPathCompiledExpressionTest.java
+++ b/src/test/java/org/apache/commons/jxpath/ri/JXPathCompiledExpressionTest.java
@@ -55,7 +55,7 @@ public class JXPathCompiledExpressionTest extends AbstractJXPathTest {
}
/**
- * Compiles the xpath into an Expression, checks the expression class, converts the expression to string and checks that the string matches the expected
+ * Compiles the XPath into an Expression, checks the expression class, converts the expression to string and checks that the string matches the expected
* one.
*/
private void assertXPathExpression(final String xpath, final Class expectedClass, final String expected) {