You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by cb...@apache.org on 2018/10/01 16:09:11 UTC
svn commit: r1842514 [1/2] - in /velocity/tools/trunk: ./
velocity-tools-generic/src/main/java/org/apache/velocity/tools/
velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/
velocity-tools-generic/src/main/java/org/apache/velocity/to...
Author: cbrisson
Date: Mon Oct 1 16:09:11 2018
New Revision: 1842514
URL: http://svn.apache.org/viewvc?rev=1842514&view=rev
Log:
[tools] More javadoc fixes
Modified:
velocity/tools/trunk/pom.xml
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/ToolInfo.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/XmlUtils.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ConfigurationUtils.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/Data.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/EasyFactoryConfiguration.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/FactoryConfiguration.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/FileFactoryConfiguration.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfiguration.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/CollectionTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ComparisonDateTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ContextTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ConversionTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DateTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DisplayTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/EscapeTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/FieldTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/FormatConfig.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ImportSupport.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ImportTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonContent.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/LinkTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/LocaleConfig.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/LoopTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MarkupTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/NumberTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/RenderTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ValueParser.java
velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/XmlTool.java
Modified: velocity/tools/trunk/pom.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/pom.xml?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/pom.xml (original)
+++ velocity/tools/trunk/pom.xml Mon Oct 1 16:09:11 2018
@@ -199,6 +199,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.0.1</version>
<configuration>
<excludePackageNames>org.apache.velocity.tools.examples</excludePackageNames>
<additionalparam>${javadoc.opts}</additionalparam>
@@ -211,6 +212,7 @@
<goal>aggregate</goal>
</goals>
<configuration>
+ <source>1.8</source>
</configuration>
</execution>
</executions>
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/ToolInfo.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/ToolInfo.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/ToolInfo.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/ToolInfo.java Mon Oct 1 16:09:11 2018
@@ -51,7 +51,7 @@ public class ToolInfo implements java.io
* Creates a new instance using the minimum required info
* necessary for a tool.
* @param key tool key
- * @param class tool class
+ * @param clazz tool class
*/
public ToolInfo(String key, Class clazz)
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/XmlUtils.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/XmlUtils.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/XmlUtils.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/XmlUtils.java Mon Oct 1 16:09:11 2018
@@ -316,7 +316,7 @@ public final class XmlUtils
}
/**
- * @param target node
+ * @param node target node
* @param attr attribute name
* @param def default value
* @return An attribute coerced to an integer.
@@ -538,7 +538,7 @@ public final class XmlUtils
/**
* Checkes whether the given mime type is an XML format
- * @param mimeType
+ * @param mimeType mime type
* @return <code>true</code> if this mime type is an XML format
*/
public static boolean isXmlMimeType(String mimeType)
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ConfigurationUtils.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ConfigurationUtils.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ConfigurationUtils.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ConfigurationUtils.java Mon Oct 1 16:09:11 2018
@@ -72,6 +72,7 @@ public class ConfigurationUtils
* will override their superclasses. So, if you are using the VelocityStruts
* jar, then your $link reference will be a StrutsLinkTool. If you are using
* the VelocityView jar, it will be a standard LinkTool.
+ * @return the default {@link FactoryConfiguration}
*/
public static FactoryConfiguration getDefaultTools()
{
@@ -90,6 +91,7 @@ public class ConfigurationUtils
/**
* Returns a {@link FactoryConfiguration} including all default
* "GenericTools" available and no others.
+ * @return the generic tools default {@link FactoryConfiguration}
*/
public static FactoryConfiguration getGenericTools()
{
@@ -105,6 +107,7 @@ public class ConfigurationUtils
/**
* <p>Returns a {@link FactoryConfiguration} including all default
* "VelocityView" tools available as well as the default "GenericTools".</p>
+ * @return all default tools {@link ConfigurationFactory}
* @throws ConfigurationException if a tools.xml is not found at the {@link #VIEW_DEFAULTS_PATH}.
*/
public static FactoryConfiguration getVelocityView()
@@ -123,6 +126,7 @@ public class ConfigurationUtils
* Returns a {@link FactoryConfiguration} loaded from the path specified
* in the "org.apache.velocity.tools" system property (if any).
* If no such property has been set {@code null} will be returned.
+ * @return system property defined {@link FactoryConfiguration}
* @throws ResourceNotFoundException if the system property has a value
* but no configuration file was found at the specified location
*/
@@ -139,6 +143,7 @@ public class ConfigurationUtils
/**
* Returns a new, standard {@link ToolboxFactory} configured
* with the results of {@link #findFromSystemProperty()}.
+ * @return new {@link ToolboxFactory}
*/
public static ToolboxFactory createFactory()
{
@@ -157,6 +162,7 @@ public class ConfigurationUtils
* Convenience method that automatically creates a new
* {@link ConfigurationCleaner} and applies it to the specified
* {@link Configuration}.
+ * @param config {@link configuration}
*/
public static void clean(Configuration config)
{
@@ -171,6 +177,8 @@ public class ConfigurationUtils
* at the specified path. If no such file is found at that path, this
* will throw a {@link ResourceNotFoundException}.
*
+ * @param path configuration path
+ * @return new {@linkFactoryConfiguration}
* @see #find(String path)
*/
public static FactoryConfiguration load(String path)
@@ -191,6 +199,8 @@ public class ConfigurationUtils
* configuration loaded from the file system is given precedence (i.e.
* it is added onto the other). If no match is found in either, then
* this will return {@code null}.
+ * @param path configuration classpath or filesystem path
+ * @return new {@link FactoryConfiguration} for the given path
*/
public static FactoryConfiguration find(String path)
{
@@ -215,6 +225,8 @@ public class ConfigurationUtils
* specified path. If found, it will read and return it as a
* {@link FactoryConfiguration}. If not found, this will return
* {@code null}.
+ * @param path filesystem path
+ * @return new {@link FactoryConfiguration} for the given path
* @throws IllegalStateException if the file exists, but its path could not be converted to a URL for reading.
*/
public static FactoryConfiguration findInFileSystem(String path)
@@ -235,6 +247,8 @@ public class ConfigurationUtils
}
/**
+ * @param path configuration classpath
+ * @return new {@link FactoryConfiguration} for the given classpath
* @see #findInClasspath(String path, Object caller)
*/
public static FactoryConfiguration findInClasspath(String path)
@@ -250,6 +264,9 @@ public class ConfigurationUtils
* {@code null}. If there are multiple matching resources in the
* classpath, then they will be added together in the order found
* (i.e. the last one will have precedence).
+ * @param path configuration classpath
+ * @param caller classloader context
+ * @return new {@link FactoryConfiguration} for the given classpath
* @see ClassUtils#getResources(String path, Object caller)
*/
public static FactoryConfiguration findInClasspath(String path, Object caller)
@@ -297,6 +314,8 @@ public class ConfigurationUtils
* Returns a {@link FactoryConfiguration} read from a known configuration
* file type at the specified {@link URL}. If the file is missing or unreadable,
* this will simply return {@code null} (i.e. if an IOException is thrown).
+ * @param url configuration URL
+ * @return new {@link FactoryConfiguration} for the given URL
* @throws UnsupportedOperationException if the file type (identified via suffix)
* is neither ".xml" or ".properties"
*/
@@ -339,6 +358,11 @@ public class ConfigurationUtils
return config;
}
+ /**
+ * Get a specific {@link FactoryConfiguration} class
+ * @param classname FacotyConfiguration class
+ * @return new FactoryConfiguration instance
+ */
public static FactoryConfiguration getFromClass(String classname)
{
try
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/Data.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/Data.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/Data.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/Data.java Mon Oct 1 16:09:11 2018
@@ -95,6 +95,7 @@ public class Data implements Comparable<
/**
* This doesn't take a {@link Class} parameter because
* this class was not created for all-java configuration.
+ * @param classname class name
*/
public void setClass(String classname)
{
@@ -158,6 +159,7 @@ public class Data implements Comparable<
/**
* This is a convenience method for those doing configuration in java.
* It cannot be named setConverter(), or else it would confuse BeanUtils.
+ * @param converter value converter
*/
public void convertWith(Converter converter)
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/EasyFactoryConfiguration.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/EasyFactoryConfiguration.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/EasyFactoryConfiguration.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/EasyFactoryConfiguration.java Mon Oct 1 16:09:11 2018
@@ -127,6 +127,7 @@ public class EasyFactoryConfiguration ex
/**
* Adds the {@link ConfigurationUtils#getDefaultTools()} configuration to this
* the current configuration.
+ * @return new EasyFacotryConfiguration instance with all default tools
*/
public EasyFactoryConfiguration addDefaultTools()
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/FactoryConfiguration.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/FactoryConfiguration.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/FactoryConfiguration.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/FactoryConfiguration.java Mon Oct 1 16:09:11 2018
@@ -76,6 +76,7 @@ public class FactoryConfiguration
/**
* Creates a new instance with the specified source name
* combined with this class's name as the initial source.
+ * @param source configuration source
*/
public FactoryConfiguration(String source)
{
@@ -84,6 +85,7 @@ public class FactoryConfiguration
/**
* Allows subclasses to construct an instance that uses their classname.
+ * @param clazz FactoryConfiguration class name
*/
protected FactoryConfiguration(Class clazz, String source)
{
@@ -92,6 +94,7 @@ public class FactoryConfiguration
/**
* Returns the original source of this particular instance.
+ * @return configuration source
*/
public String getSource()
{
@@ -101,6 +104,7 @@ public class FactoryConfiguration
/**
* Sets the name of the original source of this particular instance.
* This does not affect subsequently added sources.
+ * @param source configuration source
*/
public void setSource(String source)
{
@@ -111,17 +115,24 @@ public class FactoryConfiguration
* Returns the list of sources for this configuration info in
* order starting from the source name given to this instance
* (if any) and going to the most recently added source.
+ * @return list of all configuration sources
*/
public List<String> getSources()
{
return this.sources;
}
+ /**
+ * @param source source to add
+ */
public void addSource(String source)
{
this.sources.add(source);
}
+ /**
+ * @param newDatum data to add
+ */
public void addData(Data newDatum)
{
// check if we already have a matching datum
@@ -136,11 +147,20 @@ public class FactoryConfiguration
data.add(newDatum);
}
+ /**
+ * @param datum data to remove
+ * @return <code>true</code> if removed
+ */
public boolean removeData(Data datum)
{
return data.remove(datum);
}
+ /**
+ * Search for Data by key
+ * @param datum key of data to get
+ * @return found Data or null
+ */
public Data getData(String key)
{
// create an example to search with
@@ -149,6 +169,11 @@ public class FactoryConfiguration
return getData(findme);
}
+ /**
+ * Search for Data by value
+ * @param findme value to find
+ * @return found Data or null
+ */
public Data getData(Data findme)
{
for (Data datum : data)
@@ -245,6 +270,8 @@ public class FactoryConfiguration
* encompassing all relevant info about the configuration except for the
* source information. In other words, two FactoryConfigurations are considered
* equal if they have the same data, properties and toolboxes in String form.
+ * @param o object to compare to
+ * @return equality
*/
@Override
public boolean equals(Object o)
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/FileFactoryConfiguration.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/FileFactoryConfiguration.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/FileFactoryConfiguration.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/FileFactoryConfiguration.java Mon Oct 1 16:09:11 2018
@@ -44,6 +44,7 @@ public abstract class FileFactoryConfigu
* <p>Reads an configuration from an {@link URL}.</p>
*
* @param url the InputStream to read from
+ * @throws IOException if a problem occurs
*/
protected abstract void readImpl(URL url) throws IOException;
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java Mon Oct 1 16:09:11 2018
@@ -86,6 +86,7 @@ public class ToolConfiguration extends C
/**
* Returns the key set for this tool. If no key has been explicitly
* set, this will return the result of {@link #getDefaultKey()}.
+ * @return tool key
*/
public String getKey()
{
@@ -103,6 +104,7 @@ public class ToolConfiguration extends C
* is transformed into the key by removing any 'Tool' suffix and
* lowercasing the first character. This will only return {@code null}
* if there is both no key and no classname set for this tool.
+ * @return default tool key
*/
public String getDefaultKey()
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfiguration.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfiguration.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfiguration.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfiguration.java Mon Oct 1 16:09:11 2018
@@ -73,6 +73,7 @@ public class XmlFactoryConfiguration ext
/**
* Sets the {@link RuleSet} this loader will use to
* digest the xml toolbox.
+ * @param rules rules set
*/
public void setRuleSet(RuleSet rules)
{
@@ -82,6 +83,7 @@ public class XmlFactoryConfiguration ext
/**
* <p>Retrieves the rule set Digester should use to parse and load
* the toolbox for this manager.</p>
+ * @return rules set
*/
public RuleSet getRuleSet()
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/CollectionTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/CollectionTool.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/CollectionTool.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/CollectionTool.java Mon Oct 1 16:09:11 2018
@@ -83,7 +83,7 @@ import java.util.Map;
* <p>By default the sort tool sorts ascending, you can override this by
* adding a sort type suffix to any property name.</p>
*
- * <p>The supported suffixes are:
+ * <p>The supported suffixes are:</p>
* <pre>
* For ascending
* :asc
@@ -94,7 +94,7 @@ import java.util.Map;
* #foreach($obj in $sorter.sort($objects, ["name:asc", "ordinal:desc"]))
* $obj.name, $obj.ordinal
* #end
- * </pre><p>
+ * </pre>
*
* <p>This will sort first by Name in ascending order and then by Ordinal
* in descending order, of course you could have left the :asc off of the
@@ -231,6 +231,7 @@ public class CollectionTool extends Safe
* of the Collection beforehand, so the original Collection is left
* untouched and null elements filtered out.
*
+ * @param <T> collection content class
* @param c The Collection to sort.
* @param comparator The comparator to use for sorting.
* @return A copy of the original Collection,
@@ -261,6 +262,7 @@ public class CollectionTool extends Safe
* of the array beforehand, so the original array is left
* untouched and null elements filtered out.
*
+ * @param <T> array content class
* @param a The array to sort.
* @param comparator The comparator to use for sorting.
* @return A copy of the original array,
@@ -292,6 +294,7 @@ public class CollectionTool extends Safe
* of the values beforehand, so the original Map is left
* untouched.
*
+ * @param <T> Map values class
* @param map The Map whose values should be sorted.
* @param comparator The comparator to use for sorting.
* @return A copy of the original Map's values,
@@ -425,8 +428,8 @@ public class CollectionTool extends Safe
/**
* Sorts the collection on several properties.
*
- * @param object the collection to be sorted, left unchanged.
- * @param property the property to sort on.
+ * @param collection the collection to be sorted, left unchanged.
+ * @param properties the properties to sort on.
* @return new collection, sorted.
*/
public Collection sort(Collection collection, List properties)
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ComparisonDateTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ComparisonDateTool.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ComparisonDateTool.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ComparisonDateTool.java Mon Oct 1 16:09:11 2018
@@ -188,6 +188,9 @@ public class ComparisonDateTool extends
/**
* Retrieves the specified text resource.
+ * @param key key
+ * @param locale locale
+ * @return text resource
*/
protected String getText(String key, Locale locale)
{
@@ -241,6 +244,8 @@ public class ComparisonDateTool extends
/**
* Returns the number of whole Years in the specified number of milliseconds.
+ * @param ms milliseconds
+ * @return years
*/
public static long toYears(long ms)
{
@@ -249,6 +254,8 @@ public class ComparisonDateTool extends
/**
* Returns the number of whole Months in the specified number of milliseconds.
+ * @param ms milliseconds
+ * @return months
*/
public static long toMonths(long ms)
{
@@ -257,6 +264,8 @@ public class ComparisonDateTool extends
/**
* Returns the number of whole Weeks in the specified number of milliseconds.
+ * @param ms milliseconds
+ * @return weeks
*/
public static long toWeeks(long ms)
{
@@ -265,6 +274,8 @@ public class ComparisonDateTool extends
/**
* Returns the number of whole Days in the specified number of milliseconds.
+ * @param ms milliseconds
+ * @return days
*/
public static long toDays(long ms)
{
@@ -273,6 +284,8 @@ public class ComparisonDateTool extends
/**
* Returns the number of whole Hours in the specified number of milliseconds.
+ * @param ms milliseconds
+ * @return hours
*/
public static long toHours(long ms)
{
@@ -281,6 +294,8 @@ public class ComparisonDateTool extends
/**
* Returns the number of whole Minutes in the specified number of milliseconds.
+ * @param ms milliseconds
+ * @return minutes
*/
public static long toMinutes(long ms)
{
@@ -289,6 +304,8 @@ public class ComparisonDateTool extends
/**
* Returns the number of whole Seconds in the specified number of milliseconds.
+ * @param ms milliseconds
+ * @return seconds
*/
public static long toSeconds(long ms)
{
@@ -305,6 +322,7 @@ public class ComparisonDateTool extends
* between the dates followed by a description of their relative position.
*
* @param then The date in question
+ * @return {@link Comparison} object
*/
public Comparison whenIs(Object then)
{
@@ -319,6 +337,7 @@ public class ComparisonDateTool extends
*
* @param now The date to use as representative of "now"
* @param then The date in question
+ * @return {@link Comparison} object
*/
public Comparison whenIs(Object now, Object then)
{
@@ -333,12 +352,20 @@ public class ComparisonDateTool extends
*
* @param now The date to use as representative of "now"
* @param then The secondary date
+ * @return {@link Comparison} object
*/
public Comparison difference(Object now, Object then)
{
return compare(now, then, DIFF_TYPE);
}
+ /**
+ * Internal comparison method.
+ * @param now The date to use as representative of "now"
+ * @param then The secondary date
+ * @param type Difference type
+ * @return {@link Comparison} object
+ */
protected Comparison compare(Object now, Object then, int type)
{
Calendar calThen = toCalendar(then);
@@ -360,6 +387,7 @@ public class ComparisonDateTool extends
* @param depth The maximum number of units deep to show
* @param abbr Whether the units should be abbreviated or not
* @param loc The locale to be used when looking up resources
+ * @return String representation
*/
protected String toString(long ms, int type, int depth,
boolean abbr, Locale loc)
@@ -451,6 +479,11 @@ public class ComparisonDateTool extends
* "3 minutes 1 second", and
* <code>toString(180000, 2, true, null)</code> will return
* "3 min".
+ * @param diff milliseconds
+ * @param maxUnitDepth maximum unit depth
+ * @param abbreviate whether to abbreviate unit names
+ * @param locale locale to use
+ * @return string representation of the difference
*/
protected String toString(long diff, int maxUnitDepth,
boolean abbreviate, Locale locale)
@@ -533,6 +566,14 @@ public class ComparisonDateTool extends
private final boolean abbreviate;
private final Locale locale;
+ /**
+ * Comparison object constructor
+ * @param ms milliseconds
+ * @param type comparison type
+ * @param depth units depth
+ * @param abbr whether to abbreviate units
+ * @param loc locale to use
+ */
public Comparison(long ms, int type, int depth, boolean abbr, Locale loc)
{
this.milliseconds = ms;
@@ -545,6 +586,8 @@ public class ComparisonDateTool extends
/**
* Sets whether or not this comparison is to be rendered in
* abbreviated form or not. By default, it is not abbreviated.
+ * @param abbr flag value
+ * @return new Comparison object
*/
public Comparison abbr(boolean abbr)
{
@@ -555,6 +598,8 @@ public class ComparisonDateTool extends
/**
* Set the maximum number of units to render for this comparison.
* By default, this is set to 1 unit.
+ * @param depth max units depth
+ * @return new Comparison object
*/
public Comparison depth(int depth)
{
@@ -567,6 +612,8 @@ public class ComparisonDateTool extends
* rendering. This defaults to the Locale configured for this tool,
* if any. If no locale was configured, this defaults to the system
* default.
+ * @param loc locale to use
+ * @return new Comparison object
*/
public Comparison locale(Locale loc)
{
@@ -576,6 +623,7 @@ public class ComparisonDateTool extends
/**
* Return the approximate number of years between the dates being compared.
+ * @return years
*/
public long getYears()
{
@@ -584,6 +632,7 @@ public class ComparisonDateTool extends
/**
* Return the approximate number of months between the dates being compared.
+ * @return months
*/
public long getMonths()
{
@@ -592,6 +641,7 @@ public class ComparisonDateTool extends
/**
* Return the number of weeks between the dates being compared.
+ * @return weeks
*/
public long getWeeks()
{
@@ -600,6 +650,7 @@ public class ComparisonDateTool extends
/**
* Return the number of days between the dates being compared.
+ * @return days
*/
public long getDays()
{
@@ -608,6 +659,7 @@ public class ComparisonDateTool extends
/**
* Return the number of hours between the dates being compared.
+ * @return hours
*/
public long getHours()
{
@@ -616,6 +668,7 @@ public class ComparisonDateTool extends
/**
* Return the number of minutes between the dates being compared.
+ * @return minutes
*/
public long getMinutes()
{
@@ -624,6 +677,7 @@ public class ComparisonDateTool extends
/**
* Return the number of seconds between the dates being compared.
+ * @return seconds
*/
public long getSeconds()
{
@@ -632,6 +686,7 @@ public class ComparisonDateTool extends
/**
* Return the number of milliseconds between the dates being compared.
+ * @return milliseconds
*/
public long getMilliseconds()
{
@@ -643,6 +698,7 @@ public class ComparisonDateTool extends
* to the maximum number of time units available to the tool. By default,
* there are 8 units available, but the tool may be configured to "skip"
* any of the standard units, thus shortening the maximum depth.
+ * @return new Comparison object
*/
public Comparison getFull()
{
@@ -655,6 +711,7 @@ public class ComparisonDateTool extends
* the comparison will render as a period of time, without any suffix
* to describe the relative position of the dates being compared (e.g. "later"
* or "ago").
+ * @return new Comparison object
*/
public Comparison getDifference()
{
@@ -668,6 +725,7 @@ public class ComparisonDateTool extends
* This effectively means that the comparison will render with a suffix
* to describe the relative position of the dates being compared (e.g. "later"
* or "ago").
+ * @return new Comparison object
*/
public Comparison getRelative()
{
@@ -679,6 +737,7 @@ public class ComparisonDateTool extends
* This is equivalent to calling {@link #abbr(boolean abbr)} with
* {@code true} as the argument, thus setting this comparison to be
* rendered in abbreviated form.
+ * @return new Comparison object
*/
public Comparison getAbbr()
{
@@ -687,6 +746,7 @@ public class ComparisonDateTool extends
/**
* Renders this comparison to a String.
+ * @return string representation
*/
public String toString()
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ContextTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ContextTool.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ContextTool.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ContextTool.java Mon Oct 1 16:09:11 2018
@@ -78,6 +78,7 @@ public class ContextTool extends SafeCon
/**
* Returns the context being analyzed by this tool.
+ * @return analyzed context
*/
public Context getThis()
{
@@ -102,6 +103,7 @@ public class ContextTool extends SafeCon
/**
* <p>Return a {@link Set} of the available reference keys in the current
* context.</p>
+ * @return keys set
*/
public Set getKeys()
{
@@ -130,6 +132,7 @@ public class ContextTool extends SafeCon
/**
* Actually do the work of filling in the set of keys
* for {@link #getKeys} here so subclasses can add keys too.
+ * @param keys set to fill with keys
*/
protected void fillKeyset(Set keys)
{
@@ -157,6 +160,7 @@ public class ContextTool extends SafeCon
/**
* <p>Return a {@link Set} of the available values in the current
* context.</p>
+ * @return values set
*/
public Set getValues()
{
@@ -175,6 +179,8 @@ public class ContextTool extends SafeCon
/**
* <p>Returns {@code true} if the context contains a value for the specified
* reference name (aka context key).</p>
+ * @param refName context key
+ * @return <code>true</code> if key is present in the context
*/
public boolean contains(Object refName)
{
@@ -183,6 +189,8 @@ public class ContextTool extends SafeCon
/**
* Retrieves the value for the specified reference name (aka context key).
+ * @param refName context key
+ * @return found value, or null
*/
public Object get(Object refName)
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ConversionTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ConversionTool.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ConversionTool.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ConversionTool.java Mon Oct 1 16:09:11 2018
@@ -34,7 +34,6 @@ import org.apache.velocity.tools.config.
/**
* <p>Utility class for easy conversion of String values to richer types.</p>
- * <p>
* <p>Template example(s):</p>
* <pre>
* $convert.toNumber('12.6') -> 12.6
@@ -83,6 +82,7 @@ public class ConversionTool extends Loca
* subclasses may share the same ValueParser and call configure
* at any time, while preventing templates from doing so when
* configure(Map) is locked.
+ * @param values configuration values
*/
protected void configure(ValueParser values)
{
@@ -111,6 +111,7 @@ public class ConversionTool extends Loca
* Sets the delimiter used for separating values in a single String value.
* The default string delimiter is a comma.
*
+ * @param stringsDelimiter strings delimiter to use
* @see #parseStringList
* @deprecated use {@link CollectionTool#setStringsDelimiter(String)}
*/
@@ -119,6 +120,10 @@ public class ConversionTool extends Loca
this.stringsDelimiter = stringsDelimiter;
}
+ /**
+ * Gets the delimiter used for separating values in a single String value.
+ * @return string delimiter
+ */
public final String getStringsDelimiter()
{
return this.stringsDelimiter;
@@ -129,6 +134,8 @@ public class ConversionTool extends Loca
* a delimited string value.
* The default is true.
*
+ * @param stringsTrim flag value
+ * @deprecated use {@link CollectionTool#setStringsTrim(boolean)}
* @see #parseStringList
*/
protected final void setStringsTrim(boolean stringsTrim)
@@ -138,13 +145,18 @@ public class ConversionTool extends Loca
/**
* @deprecated use {@link CollectionTool#getStringsTrim()}
- * @return strings trim
+ * @return strings trim flag
*/
public final boolean getStringsTrim()
{
return this.stringsTrim;
}
+ /**
+ * Sets numbers format
+ * @deprecated use {@link NumberTool} format
+ * @param format numbers format
+ */
protected final void setNumberFormat(String format)
{
this.numberFormat = format;
@@ -159,6 +171,11 @@ public class ConversionTool extends Loca
return this.numberFormat;
}
+ /**
+ * Sets date format
+ * @param format date format
+ * @deprecated use {@link DateTool} setDateFormat() methods
+ */
protected final void setDateFormat(String format)
{
this.dateFormat = format;
@@ -305,7 +322,7 @@ public class ConversionTool extends Loca
}
/**
- * @param value
+ * @param value target object
* @return calendar
* @deprecated use {@link DateTool#toCalendar(Object)}
*/
@@ -692,6 +709,8 @@ public class ConversionTool extends Loca
* Converts a single String value into an array of Strings by splitting
* it on the tool's set stringsDelimiter. The default stringsDelimiter is a comma,
* and by default, all strings parsed out are trimmed before returning.
+ * @param value string list to parse
+ * @return array of strings
*/
protected String[] parseStringList(String value)
{
@@ -716,7 +735,8 @@ public class ConversionTool extends Loca
/**
* Converts a String value into a Locale.
- *
+ * @param value string of locale to parse
+ * @return parsed locale, or null
*/
protected Locale parseLocale(String value)
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DateTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DateTool.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DateTool.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DateTool.java Mon Oct 1 16:09:11 2018
@@ -100,6 +100,7 @@ public class DateTool extends FormatConf
* subclasses may share the same ValueParser and call configure
* at any time, while preventing templates from doing so when
* configure(Map) is locked.
+ * @param values configuration values
*/
protected void configure(ValueParser values)
{
@@ -112,6 +113,10 @@ public class DateTool extends FormatConf
}
}
+ /**
+ * Sets time zone
+ * @param timezone time zone
+ */
protected void setTimeZone(TimeZone timezone)
{
if (timezone == null)
@@ -197,7 +202,7 @@ public class DateTool extends FormatConf
// ------------------------- date value access ---------------------------
/**
- * Returns the year value of the date returned by {@link #getCalendar()}.
+ * @return the year value of the date returned by {@link #getCalendar()}.
*
* @since VelocityTools 1.2
*/
@@ -207,7 +212,8 @@ public class DateTool extends FormatConf
}
/**
- * Returns the year value of the specified date.
+ * @param date target date
+ * @return the year value of the specified date.
*
* @since VelocityTools 1.2
*/
@@ -217,7 +223,7 @@ public class DateTool extends FormatConf
}
/**
- * Returns the month value of the date returned by {@link #getCalendar()}.
+ * @return the month value of the date returned by {@link #getCalendar()}.
*
* @since VelocityTools 1.2
*/
@@ -227,7 +233,8 @@ public class DateTool extends FormatConf
}
/**
- * Returns the month value of the specified date.
+ * @param date target date
+ * @return the month value of the specified date.
*
* @since VelocityTools 1.2
*/
@@ -237,7 +244,7 @@ public class DateTool extends FormatConf
}
/**
- * Returns the day (of the month) value of the date
+ * @return the day (of the month) value of the date
* returned by {@link #getCalendar()}.
* <br><br>
* NOTE: Unlike java.util.Date, this returns the day of the month.
@@ -254,7 +261,8 @@ public class DateTool extends FormatConf
}
/**
- * Returns the day (of the month) value for the specified date.
+ * @param date target date
+ * @return the day (of the month) value for the specified date.
* <br><br>
* NOTE: Unlike java.util.Date, this returns the day of the month.
* It is equivalent to Date.getDate() and
@@ -270,7 +278,8 @@ public class DateTool extends FormatConf
}
/**
- * Return the specified value of the date returned by
+ * @param field target field
+ * @return the specified value of the date returned by
* {@link #getCalendar()} or null if the field is invalid.
*
* @since VelocityTools 1.2
@@ -281,7 +290,7 @@ public class DateTool extends FormatConf
}
/**
- * Returns the specified value of the specified date,
+ * @return the specified value of the specified date,
* or null if the field or date is invalid. The field may be
* an Integer or it may be the name of the field as a String.
*
@@ -316,7 +325,7 @@ public class DateTool extends FormatConf
}
/**
- * Returns the specified value of the specified date,
+ * @return the specified value of the specified date,
* or null if the field or date is invalid.
*
* @param field the int for the desired field (e.g. Calendar.MONTH)
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DisplayTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DisplayTool.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DisplayTool.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DisplayTool.java Mon Oct 1 16:09:11 2018
@@ -334,6 +334,11 @@ public class DisplayTool extends LocaleC
/**
* Does the actual formatting of the collection.
+ * @param list collection of objects to format
+ * @param delim delimiter
+ * @param finaldelim final delimiter
+ * @param property objects property to use
+ * @return formatted string
*/
protected String format(Collection list, String delim, String finaldelim,
String property)
@@ -370,6 +375,9 @@ public class DisplayTool extends LocaleC
* required here is quite different from that of
* {@link #printf(String,Object...)}.
*
+ * @param format format string
+ * @param args arguments
+ * @return formatted message
* @since VelocityTools 2.0
*/
public String message(String format, Object... args)
@@ -403,6 +411,9 @@ public class DisplayTool extends LocaleC
* required here is quite different from that of
* {@link #message(String,Object...)}.
*
+ * @param format format string
+ * @param args printf arguments
+ * @return formatted string
* @see java.util.Formatter
* @since VelocityTools 2.0
*/
@@ -536,6 +547,7 @@ public class DisplayTool extends LocaleC
/**
* Returns a string of spaces of the specified length.
* @param length the number of spaces to return
+ * @return string of spaces
*/
public String space(int length)
{
@@ -556,6 +568,7 @@ public class DisplayTool extends LocaleC
* Truncates or pads the string value of the specified object as necessary
* to ensure that the returned string's length equals the default cell size.
* @param obj the value to be put in the 'cell'
+ * @return truncated/padded string
*/
public String cell(Object obj)
{
@@ -567,6 +580,7 @@ public class DisplayTool extends LocaleC
* to ensure that the returned string's length equals the specified cell size.
* @param obj the value to be put in the 'cell'
* @param cellsize the size of the cell into which the object must be placed
+ * @return truncated/padded string
*/
public String cell(Object obj, int cellsize)
{
@@ -581,6 +595,7 @@ public class DisplayTool extends LocaleC
* @param obj the value to be put in the 'cell'
* @param suffix the suffix to put at the end of any values that need truncating
* to indicate that they've been truncated
+ * @return truncated/padded string
*/
public String cell(Object obj, String suffix)
{
@@ -594,6 +609,7 @@ public class DisplayTool extends LocaleC
* @param cellsize the size of the cell into which the object must be placed
* @param suffix the suffix to put at the end of any values that need truncating
* to indicate that they've been truncated
+ * @return truncated/padded string
*/
public String cell(Object obj, int cellsize, String suffix)
{
@@ -622,6 +638,7 @@ public class DisplayTool extends LocaleC
* to upper case and returns the resulting string.
*
* @param capitalizeMe The value to be capitalized.
+ * @return capitalized string
*/
public String capitalize(Object capitalizeMe)
{
@@ -650,6 +667,7 @@ public class DisplayTool extends LocaleC
* to lower case and returns the resulting string.
*
* @param uncapitalizeMe The value to be uncapitalized.
+ * @return uncapitalized string
*/
public String uncapitalize(Object uncapitalizeMe)
{
@@ -675,7 +693,7 @@ public class DisplayTool extends LocaleC
/**
* Returns a configured default value if specified value is null.
- * @param checkMe
+ * @param checkMe object to check
* @return a configured default value if the specified value is null.
*/
public Object alt(Object checkMe)
@@ -685,8 +703,8 @@ public class DisplayTool extends LocaleC
/**
* Returns the second argument if first argument specified is null.
- * @param checkMe
- * @param alternate
+ * @param checkMe object to check
+ * @param alternate alternate value
* @return the second argument if the first is null.
*/
public Object alt(Object checkMe, Object alternate)
@@ -702,7 +720,8 @@ public class DisplayTool extends LocaleC
* Inserts HTML line break tag (<br />) in front of all newline
* characters of the string value of the specified object and returns the
* resulting string.
- * @param obj
+ * @param obj source object
+ * @return string with added br tags
*/
public String br(Object obj)
{
@@ -719,7 +738,8 @@ public class DisplayTool extends LocaleC
/**
* Removes HTML tags from the string value of the specified object and
* returns the resulting string.
- * @param obj
+ * @param obj source object
+ * @return text stripped from HTML tags
*/
public String stripTags(Object obj)
{
@@ -729,8 +749,9 @@ public class DisplayTool extends LocaleC
/**
* Removes all not allowed HTML tags from the string value of the specified
* object and returns the resulting string.
- * @param obj
+ * @param obj source object
* @param allowedTags An array of allowed tag names (i.e. "h1","br","img")
+ * @return text stripped from given HTML tags
*/
public String stripTags(Object obj, String... allowedTags)
{
@@ -769,8 +790,9 @@ public class DisplayTool extends LocaleC
* returns 'singular'. Plural form is built using some basic English
* language rules for nouns which does not guarantee correct syntax of a
* result in all cases.
- * @param value
+ * @param value count
* @param singular Singular form of a word.
+ * @return guessed plural
*/
public String plural(int value, String singular)
{
@@ -780,9 +802,10 @@ public class DisplayTool extends LocaleC
/**
* Returns 'plural' parameter if passed 'value' is plural, otherwise
* 'singular' is returned.
- * @param value
+ * @param value count
* @param singular Singular form of a word.
* @param plural Plural form of a word.
+ * @return guessed plural
*/
public String plural(int value, String singular, String plural)
{
@@ -832,6 +855,10 @@ public class DisplayTool extends LocaleC
* Subclasses that wish to perform more advanced, efficient, or just
* different property retrieval methods should override this method to do
* so.
+ * @param object target object
+ * @param property target property
+ * @return property value
+ * @throws IllegalArgumentException if it wasn't possible to get the object's property value
*/
protected Object getProperty(Object object, String property)
{
@@ -848,6 +875,8 @@ public class DisplayTool extends LocaleC
/**
* Returns the {@link Measurements} of the string value of the specified object.
+ * @param measureMe object to measure
+ * @return {@link Measurements} object
*/
public Measurements measure(Object measureMe)
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/EscapeTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/EscapeTool.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/EscapeTool.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/EscapeTool.java Mon Oct 1 16:09:11 2018
@@ -126,6 +126,7 @@ public class EscapeTool extends SafeConf
/**
* Sets the key under which this tool has been configured.
+ * @param key tool key
* @see #velocity
*/
protected void setKey(String key)
@@ -140,6 +141,7 @@ public class EscapeTool extends SafeConf
/**
* Should return the key under which this tool has been configured.
* The default is 'esc'.
+ * @return tool key
* @see #velocity
*/
public String getKey()
@@ -235,6 +237,9 @@ public class EscapeTool extends SafeConf
/**
* This code was pulled from the Apache Harmony project. See
* https://svn.apache.org/repos/asf/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Properties.java
+ * @param string property key or property value
+ * @param key <code>true</code> for a property key
+ * @return escaped string
*/
protected String dumpString(String string, boolean key) {
StringBuilder builder = new StringBuilder();
@@ -520,6 +525,7 @@ public class EscapeTool extends SafeConf
/**
* Renders a new line character appropriate for the
* operating system ("\n" in java).
+ * @return system newline string
* @see #getN()
*/
public String getNewline()
@@ -530,6 +536,7 @@ public class EscapeTool extends SafeConf
/**
* Renders a new line character appropriate for the
* operating system ("\n" in java).
+ * @return system newline string
* @see #getNewline()
*/
public String getN()
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/FieldTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/FieldTool.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/FieldTool.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/FieldTool.java Mon Oct 1 16:09:11 2018
@@ -126,6 +126,8 @@ public class FieldTool extends SafeConfi
* Returns the value for the specified field name as found
* in the stored {@link Map} of field names to values (or placeholders).
* Returns {@code null} if there is no matching field.
+ * @param name field name
+ * @return field value
*/
public Object get(String name)
{
@@ -159,6 +161,8 @@ public class FieldTool extends SafeConfi
* {@link Class} with the specified name cannot be loaded, this will
* return {@code null}, rather than throw an exception.
*
+ * @param classname target class name
+ * @return {@link FieldToolSub} object
* @see #in(Class clazz)
*/
public FieldToolSub in(String classname)
@@ -178,6 +182,8 @@ public class FieldTool extends SafeConfi
* of all the public static field names to values (or a placeholder
* if the value is not final) for the {@link Class} of the
* specified Object.
+ * @param instance target instance
+ * @return {@link FieldToolSub} object
* @see #in(Class clazz)
*/
public FieldToolSub in(Object instance)
@@ -193,6 +199,8 @@ public class FieldTool extends SafeConfi
* Returns a {@link FieldToolSub} holding a {@link Map}
* of all the public static field names to values (or a placeholder
* if the value is not final) for the specified {@link Class}.
+ * @param clazz target class
+ * @return {@link FieldToolSub} object
*/
public FieldToolSub in(Class clazz)
{
@@ -215,6 +223,8 @@ public class FieldTool extends SafeConfi
* stores their value (if final) or else a {@link MutableField} for
* in a {@link Map} under the fields' names. This will never return
* null, only an empty Map if there are no public static fields.
+ * @param clazz target class
+ * @return fields map
*/
protected Map<String,Object> inspect(Class clazz)
{
@@ -251,6 +261,9 @@ public class FieldTool extends SafeConfi
* Retrieves and returns the value of the specified {@link Field}
* in the specified {@link Class}. Returns {@code null} in case of failure.
*
+ * @param field target field
+ * @param clazz target class
+ * @return field value
*/
protected Object retrieve(Field field, Class clazz)
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/FormatConfig.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/FormatConfig.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/FormatConfig.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/FormatConfig.java Mon Oct 1 16:09:11 2018
@@ -69,6 +69,7 @@ public class FormatConfig extends Locale
/**
* Sets the default format for this instance.
+ * @param format default format
*/
protected void setFormat(String format)
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ImportSupport.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ImportSupport.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ImportSupport.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ImportSupport.java Mon Oct 1 16:09:11 2018
@@ -83,14 +83,18 @@ public class ImportSupport extends SafeC
*/
/**
- * configure import support
- * @param values
+ * Configure import support
+ * @param values configuration values
*/
protected void configure(ValueParser values)
{
super.configure(values);
}
+ /**
+ * Sets or clears safe mode
+ * @param safe flag value
+ */
@Override
public void setSafeMode(boolean safe)
{
@@ -101,7 +105,7 @@ public class ImportSupport extends SafeC
*
* @param url the URL resource to return as string
* @return the URL resource as string
- * @throws IOException
+ * @throws IOException if operation failed
*/
public String acquireString(String url) throws IOException
{
@@ -120,7 +124,7 @@ public class ImportSupport extends SafeC
* Aquire the content of a remote URL.
* @param url remote URL
* @return the URL resource as string
- * @throws IOException
+ * @throws IOException if operation failed
*/
protected String acquireRemoteURLString(String url) throws IOException
{
@@ -159,7 +163,7 @@ public class ImportSupport extends SafeC
* Aquire the content of a local URL.
* @param url local URL
* @return the URL resource as string
- * @throws IOException
+ * @throws IOException if operation failed
*/
protected String acquireLocalURLString(String url) throws IOException
{
@@ -170,7 +174,7 @@ public class ImportSupport extends SafeC
* Acquire a reader to an URL
* @param url the URL to read
* @return a Reader for the InputStream created from the supplied URL
- * @throws IOException
+ * @throws IOException if operation failed
*/
public Reader acquireReader(String url) throws IOException
{
@@ -189,7 +193,7 @@ public class ImportSupport extends SafeC
* Acquire a reader to a remote URL
* @param url the URL to read
* @return a Reader for the InputStream created from the supplied URL
- * @throws IOException
+ * @throws IOException if operation failed
*/
protected Reader acquireRemoteURLReader(String url) throws IOException
{
@@ -302,7 +306,7 @@ public class ImportSupport extends SafeC
* Acquire a reader to a local URL - non applicable to the generic version of ImportSupport
* @param url the URL to read
* @return a Reader for the InputStream created from the supplied URL
- * @throws IOException
+ * @throws IOException if operation failed
*/
protected Reader acquireLocalURLReader(String url) throws IOException
{
@@ -559,7 +563,7 @@ public class ImportSupport extends SafeC
* Overridable local file URL builder.
* @param resource the resource to read
* @return the content of the resource
- * @throws IOException
+ * @throws Exception if operation failed
*/
protected URL getFileResource(String resource) throws Exception
{
@@ -576,7 +580,7 @@ public class ImportSupport extends SafeC
* Classpath entry URL builder
* @param resource the resource to read
* @return the content of the resource
- * @throws IOException
+ * @throws Exception if operation failed
*/
protected URL getClasspathResource(String resource) throws Exception
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ImportTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ImportTool.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ImportTool.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ImportTool.java Mon Oct 1 16:09:11 2018
@@ -56,7 +56,7 @@ public class ImportTool extends SafeConf
/**
* Importsupport initialization
- * @param config
+ * @param config configuration values
*/
protected synchronized void initializeImportSupport(ValueParser config)
{
@@ -69,7 +69,7 @@ public class ImportTool extends SafeConf
/**
* Configuration
- * @param values
+ * @param values configuration values
*/
protected void configure(ValueParser values)
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonContent.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonContent.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonContent.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonContent.java Mon Oct 1 16:09:11 2018
@@ -66,6 +66,7 @@ public class JsonContent
/**
* wraps an object
+ * @param object JsonObject to wrap
*/
public JsonContent(JsonObject object)
{
@@ -74,6 +75,7 @@ public class JsonContent
/**
* wraps an array
+ * @param array JsonArray to wrap
*/
public JsonContent(JsonArray array)
{
@@ -82,7 +84,7 @@ public class JsonContent
/**
* Get a value from root array
- * @param index
+ * @param index array index
* @return value, or null
*/
public Object get(int index)
@@ -101,7 +103,7 @@ public class JsonContent
/**
* Get a property from root object
- * @param key
+ * @param key map key
* @return property value, or null
*/
public Object get(String key)
@@ -133,7 +135,7 @@ public class JsonContent
/**
* Get set of root object keys.
- * @return
+ * @return keys set
*/
public Set<String> keySet()
{
Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonTool.java?rev=1842514&r1=1842513&r2=1842514&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonTool.java (original)
+++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/JsonTool.java Mon Oct 1 16:09:11 2018
@@ -40,7 +40,7 @@ import com.github.cliftonlabs.json_simpl
* <p>Tool which can parse a JSON file.</p>
* <p>Usage:</p>
* <ul>
- * <li>$json.parse(<i>json string</i>)</li>
+ * <li>$json.parse(<i>JSON string</i>)</li>
* <li>$json.read(<i>file or classpath resource</i>)</li>
* <li>$json.fetch(<i>URL</i>)</li>
* </ul>
@@ -77,7 +77,7 @@ public class JsonTool extends ImportSupp
/**
* ImportSupport initialization
- * @param config
+ * @param config configuration values
*/
protected synchronized void initializeImportSupport(ValueParser config)
{
@@ -94,6 +94,7 @@ public class JsonTool extends ImportSupp
* Looks for the "file" parameter and automatically uses
* {@link #initJSON(String)} to parse the file (searched in filesystem current path and classpath) and set the
* resulting JSON object as the root node for this instance.
+ * @param values configuration values
*/
protected void configure(ValueParser values)
{
@@ -120,7 +121,7 @@ public class JsonTool extends ImportSupp
/**
* Initialize JSON content from a string.
- * @param json
+ * @param json JSON string
*/
protected void initJSON(String json)
{
@@ -132,7 +133,7 @@ public class JsonTool extends ImportSupp
/**
* Initialize JSON content from a reader.
- * @param reader
+ * @param reader JSON stream reader
*/
protected void initJSON(Reader reader)
{
@@ -159,6 +160,8 @@ public class JsonTool extends ImportSupp
/**
* Parses the given JSON string and uses the resulting {@link Document}
* as the root {@link Node}.
+ * @param json JSON string
+ * @return new JsonTool
*/
public JsonTool parse(String json)
{
@@ -178,6 +181,8 @@ public class JsonTool extends ImportSupp
/**
* Reads and parses a local JSON resource file
+ * @param resource resource name
+ * @return new JsonTool
*/
public JsonTool read(String resource)
{
@@ -217,6 +222,8 @@ public class JsonTool extends ImportSupp
/**
* Reads and parses a remote or local URL
+ * @param url resource URL
+ * @return new JSonTool
*/
public JsonTool fetch(String url)
{
@@ -275,7 +282,7 @@ public class JsonTool extends ImportSupp
/**
* Get a property from root object
- * @param key
+ * @param key property key
* @return property value, or null
*/
public Object get(String key)
@@ -294,7 +301,7 @@ public class JsonTool extends ImportSupp
/**
* Get set of root object keys.
- * @return
+ * @return keys set
*/
public Set<String> keySet()
{