You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2011/12/23 02:22:40 UTC
svn commit: r1222526 - in
/camel/trunk/camel-core/src/main/java/org/apache/camel/util:
ExpressionComparator.java LRUSoftCache.java ObjectHelper.java
OgnlHelper.java PackageHelper.java PredicateAssertHelper.java
ResourceHelper.java package.html
Author: ningjiang
Date: Fri Dec 23 01:22:39 2011
New Revision: 1222526
URL: http://svn.apache.org/viewvc?rev=1222526&view=rev
Log:
CAMEL-4820 Applied the Javadoc patch of org.apache.camel.util package with thanks to Glen
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExpressionComparator.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/LRUSoftCache.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/OgnlHelper.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/PackageHelper.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/PredicateAssertHelper.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResourceHelper.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/package.html
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExpressionComparator.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExpressionComparator.java?rev=1222526&r1=1222525&r2=1222526&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExpressionComparator.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExpressionComparator.java Fri Dec 23 01:22:39 2011
@@ -22,8 +22,8 @@ import org.apache.camel.Exchange;
import org.apache.camel.Expression;
/**
- * An implementation of {@link Comparator} which takes an {@link Expression} which is evaluated
- * on each exchange to compare
+ * An implementation of {@link Comparator} that takes an {@link Expression} which is evaluated
+ * on each exchange to be compared
*
* @version
*/
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/LRUSoftCache.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/LRUSoftCache.java?rev=1222526&r1=1222525&r2=1222526&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/LRUSoftCache.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/LRUSoftCache.java Fri Dec 23 01:22:39 2011
@@ -27,7 +27,7 @@ import java.util.Set;
* A Least Recently Used Cache which uses {@link SoftReference}.
* <p/>
* This implementation uses {@link java.lang.ref.SoftReference} for stored values in the cache, to support the JVM
- * when it wants to reclaim objects when its running out of memory. Therefore this implementation does
+ * when it wants to reclaim objects when it's running out of memory. Therefore this implementation does
* not support <b>all</b> the {@link java.util.Map} methods.
* <p/>
* The following methods is <b>only</b> be be used:
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java?rev=1222526&r1=1222525&r2=1222526&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java Fri Dec 23 01:22:39 2011
@@ -69,9 +69,9 @@ public final class ObjectHelper {
}
/**
- * A helper method for comparing objects for equality in which it uses type coerce to coerce
- * types between the left and right values. This allows you to equal test eg String and Integer as
- * Camel will be able to coerce the types.
+ * A helper method for comparing objects for equality in which it uses type coercion to coerce
+ * types between the left and right values. This allows you test for equality for example with
+ * a String and Integer type as Camel will be able to coerce the types.
*/
public static boolean typeCoerceEquals(TypeConverter converter, Object leftValue, Object rightValue) {
// sanity check
@@ -108,18 +108,18 @@ public final class ObjectHelper {
}
/**
- * A helper method for comparing objects for equality in which it uses type coerce to coerce
- * types between the left and right values. This allows you to equal test eg String and Integer as
- * Camel will be able to coerce the types
+ * A helper method for comparing objects for inequality in which it uses type coercion to coerce
+ * types between the left and right values. This allows you test for inequality for example with
+ * a String and Integer type as Camel will be able to coerce the types.
*/
public static boolean typeCoerceNotEquals(TypeConverter converter, Object leftValue, Object rightValue) {
return !typeCoerceEquals(converter, leftValue, rightValue);
}
/**
- * A helper method for comparing objects ordering in which it uses type coerce to coerce
- * types between the left and right values. This allows you to equal test eg String and Integer as
- * Camel will be able to coerce the types
+ * A helper method for comparing objects ordering in which it uses type coercion to coerce
+ * types between the left and right values. This allows you test for ordering for example with
+ * a String and Integer type as Camel will be able to coerce the types.
*/
@SuppressWarnings({"unchecked", "rawtypes"})
public static int typeCoerceCompare(TypeConverter converter, Object leftValue, Object rightValue) {
@@ -1214,7 +1214,7 @@ public final class ObjectHelper {
}
/**
- * Cleans the string to pure java identifier so we can use it for loading class names.
+ * Cleans the string to a pure Java identifier so we can use it for loading class names.
* <p/>
* Especially from Spring DSL people can have \n \t or other characters that otherwise
* would result in ClassNotFoundException
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/OgnlHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/OgnlHelper.java?rev=1222526&r1=1222525&r2=1222526&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/OgnlHelper.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/OgnlHelper.java Fri Dec 23 01:22:39 2011
@@ -22,7 +22,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
- * Helper for Camel OGNL expressions.
+ * Helper for Camel OGNL (Object-Graph Navigation Language) expressions.
*
* @version
*/
@@ -36,17 +36,17 @@ public final class OgnlHelper {
/**
* Tests whether or not the given String is a Camel OGNL expression.
* <p/>
- * Its consider Camel OGNL expression when it contains either one of the following chars: . or [
+ * An expression is considered an OGNL expression when it contains either one of the following chars: . or [
*
* @param expression the String
- * @return <tt>true</tt> if Camel OGNL expression, otherwise <tt>false</tt>.
+ * @return <tt>true</tt> if a Camel OGNL expression, otherwise <tt>false</tt>.
*/
public static boolean isValidOgnlExpression(String expression) {
if (ObjectHelper.isEmpty(expression)) {
return false;
}
- // the brackets should come in pair
+ // the brackets should come in a pair
int bracketBegin = StringHelper.countChar(expression, '[');
int bracketEnd = StringHelper.countChar(expression, ']');
if (bracketBegin > 0 && bracketEnd > 0) {
@@ -81,10 +81,10 @@ public final class OgnlHelper {
}
/**
- * Tests whether or not the given Camel OGNL expression is using the elvis operator or not.
+ * Tests whether or not the given Camel OGNL expression is using the Elvis operator or not.
*
* @param ognlExpression the Camel OGNL expression
- * @return <tt>true</tt> if the elvis operator is used, otherwise <tt>false</tt>.
+ * @return <tt>true</tt> if the Elvis operator is used, otherwise <tt>false</tt>.
*/
public static boolean isNullSafeOperator(String ognlExpression) {
if (ObjectHelper.isEmpty(ognlExpression)) {
@@ -163,7 +163,7 @@ public final class OgnlHelper {
/**
* Regular expression with repeating groups is a pain to get right
* and then nobody understands the reg exp afterwards.
- * So use a bit ugly/low-level java code to split the ognl into methods.
+ * So we use a bit ugly/low-level Java code to split the OGNL into methods.
*/
public static List<String> splitOgnl(String ognl) {
List<String> methods = new ArrayList<String>();
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/PackageHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/PackageHelper.java?rev=1222526&r1=1222525&r2=1222526&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/PackageHelper.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/PackageHelper.java Fri Dec 23 01:22:39 2011
@@ -34,12 +34,12 @@ public final class PackageHelper {
/**
* Returns true if the version number of the given package name can be found and is greater than or equal to the minimum version.
*
- * For package names which include multiple dots, the dots are removed. So for example a spring version of 2.5.1 is converted to
- * 2.51 so you can assert that its >= 2.51 (so above 2.50 and less than 2.52 etc).
+ * For package names which include multiple dots, dots after the leftmost are removed. So for example a spring version of 2.5.1
+ * is converted to 2.51 so you can assert that it's >= 2.51 (so above 2.50 and less than 2.52 etc).
*
* @param packageName the Java package name to compare
* @param minimumVersion the minimum version number
- * @return true if the package name can be determined and if its greater than or equal to the minimum value
+ * @return true if the package name can be determined and if it's greater than or equal to the minimum value
*/
public static boolean isValidVersion(String packageName, double minimumVersion) {
try {
@@ -65,13 +65,13 @@ public final class PackageHelper {
double number = Double.parseDouble(value);
return number >= minimumVersion;
} else {
- LOG.debug("Failed to find out version from package: " + packageName);
+ LOG.debug("Could not determine version of package: " + packageName);
}
}
}
} catch (Exception e) {
if (LOG.isDebugEnabled()) {
- LOG.debug("Failed to find out version from package: " + packageName, e);
+ LOG.debug("Could not determine version of package: " + packageName, e);
}
}
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/PredicateAssertHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/PredicateAssertHelper.java?rev=1222526&r1=1222525&r2=1222526&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/PredicateAssertHelper.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/PredicateAssertHelper.java Fri Dec 23 01:22:39 2011
@@ -36,7 +36,7 @@ public final class PredicateAssertHelper
ObjectHelper.notNull(exchange, "exchange");
if (predicate instanceof BinaryPredicate) {
- // special for binary evaluable as we can get more detailed information
+ // with binary evaluations as we can get more detailed information
BinaryPredicate eval = (BinaryPredicate) predicate;
String evalText = eval.matchesReturningFailureMessage(exchange);
if (evalText != null) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResourceHelper.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResourceHelper.java?rev=1222526&r1=1222525&r2=1222526&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResourceHelper.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResourceHelper.java Fri Dec 23 01:22:39 2011
@@ -29,7 +29,7 @@ import java.net.URLConnection;
import org.apache.camel.spi.ClassResolver;
/**
- * Helper for loading resources on the classpath or file system.
+ * Helper class for loading resources on the classpath or file system.
*/
public final class ResourceHelper {
@@ -38,10 +38,10 @@ public final class ResourceHelper {
}
/**
- * Determines whether the uri has a scheme (eg file:, classpath: or http:)
+ * Determines whether the URI has a scheme (e.g. file:, classpath: or http:)
*
- * @param uri the uri
- * @return <tt>true</tt> if the uri starts with a scheme
+ * @param uri the URI
+ * @return <tt>true</tt> if the URI starts with a scheme
*/
public static boolean hasScheme(String uri) {
if (uri == null) {
@@ -54,12 +54,11 @@ public final class ResourceHelper {
/**
* Resolves the mandatory resource.
* <p/>
- * If possible prefer to use {@link #resolveMandatoryResourceAsUrl(org.apache.camel.spi.ClassResolver, String)}
- * if possible.
+ * If possible recommended to use {@link #resolveMandatoryResourceAsUrl(org.apache.camel.spi.ClassResolver, String)}
*
* @param classResolver the class resolver to load the resource from the classpath
- * @param uri uri of the resource
- * @return the resource as an {@link InputStream}, remember to close the stream after usage.
+ * @param uri URI of the resource
+ * @return the resource as an {@link InputStream}. Remember to close this stream after usage.
* @throws java.io.IOException is thrown if the resource file could not be found or loaded as {@link InputStream}
*/
public static InputStream resolveMandatoryResourceAsInputStream(ClassResolver classResolver, String uri) throws IOException {
@@ -98,9 +97,9 @@ public final class ResourceHelper {
*
* @param classResolver the class resolver to load the resource from the classpath
* @param uri uri of the resource
- * @return the resource as an {@link InputStream}, remember to close the stream after usage.
+ * @return the resource as an {@link InputStream}. Remember to close this stream after usage.
* @throws java.io.FileNotFoundException is thrown if the resource file could not be found
- * @throws java.net.MalformedURLException if the uri is malformed
+ * @throws java.net.MalformedURLException if the URI is malformed
*/
public static URL resolveMandatoryResourceAsUrl(ClassResolver classResolver, String uri) throws FileNotFoundException, MalformedURLException {
if (uri.startsWith("file:")) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/package.html
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/package.html?rev=1222526&r1=1222525&r2=1222526&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/package.html (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/package.html Fri Dec 23 01:22:39 2011
@@ -19,7 +19,7 @@
</head>
<body>
-Utility classes used by the core of Camel and useful for Camel component developers
+Utility classes used by the core of Camel. Also useful for Camel component developers.
</body>
</html>