commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adri...@apache.org
Subject svn commit: r1042430 - in /commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert: GenericSingletonToList.java GenericSingletonToSet.java GenericToStringConverter.java MiscConverters.java NetConverters.java NumberConverters.java Util.java
Date Sun, 05 Dec 2010 19:54:41 GMT
Author: adrianc
Date: Sun Dec  5 19:54:41 2010
New Revision: 1042430

URL: http://svn.apache.org/viewvc?rev=1042430&view=rev
Log:
Second pass at building out JavaDocs.

Modified:
    commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericSingletonToList.java
    commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericSingletonToSet.java
    commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericToStringConverter.java
    commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/MiscConverters.java
    commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/NetConverters.java
    commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/NumberConverters.java
    commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Util.java

Modified: commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericSingletonToList.java
URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericSingletonToList.java?rev=1042430&r1=1042429&r2=1042430&view=diff
==============================================================================
--- commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericSingletonToList.java
(original)
+++ commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericSingletonToList.java
Sun Dec  5 19:54:41 2010
@@ -21,6 +21,10 @@ package org.apache.commons.convert;
 import java.util.ArrayList;
 import java.util.List;
 
+/**
+ * An object that creates a <code>List</code> and adds an object to the
+ * <code>List</code>.
+ */
 public class GenericSingletonToList<T> extends AbstractConverter<T, List<T>>
{
     public GenericSingletonToList(Class<T> sourceClass) {
         super(sourceClass, List.class);

Modified: commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericSingletonToSet.java
URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericSingletonToSet.java?rev=1042430&r1=1042429&r2=1042430&view=diff
==============================================================================
--- commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericSingletonToSet.java
(original)
+++ commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericSingletonToSet.java
Sun Dec  5 19:54:41 2010
@@ -21,6 +21,10 @@ package org.apache.commons.convert;
 import java.util.HashSet;
 import java.util.Set;
 
+/**
+ * An object that creates a <code>Set</code> and adds an object to the
+ * <code>Set</code>.
+ */
 public class GenericSingletonToSet<T> extends AbstractConverter<T, Set<T>>
{
     public GenericSingletonToSet(Class<T> sourceClass) {
         super(sourceClass, Set.class);

Modified: commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericToStringConverter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericToStringConverter.java?rev=1042430&r1=1042429&r2=1042430&view=diff
==============================================================================
--- commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericToStringConverter.java
(original)
+++ commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/GenericToStringConverter.java
Sun Dec  5 19:54:41 2010
@@ -18,7 +18,10 @@
  *******************************************************************************/
 package org.apache.commons.convert;
 
-/** Generic object-to-string converter class. */
+/**
+ * An object that converts any object to a <code>String</code>
+ * by calling the object's <code>toString</code> method..
+ */
 public class GenericToStringConverter<S> extends AbstractConverter<S, String>
{
 
     public GenericToStringConverter(Class<S> sourceClass) {

Modified: commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/MiscConverters.java
URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/MiscConverters.java?rev=1042430&r1=1042429&r2=1042430&view=diff
==============================================================================
--- commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/MiscConverters.java
(original)
+++ commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/MiscConverters.java
Sun Dec  5 19:54:41 2010
@@ -41,6 +41,10 @@ public class MiscConverters implements C
         Converters.registerConverter(new GenericToStringConverter<Pattern>(Pattern.class));
     }
 
+    /**
+     * An object that converts a <code>java.sql.Blob</code> to a
+     * byte array.
+     */
     public static class BlobToByteArray extends AbstractConverter<Blob, byte[]> {
         public BlobToByteArray() {
             super(Blob.class, byte[].class);
@@ -86,6 +90,10 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * An object that converts a byte array to a
+     * <code>ByteBuffer</code>.
+     */
     public static class ByteArrayToByteBuffer extends AbstractConverter<byte[], ByteBuffer>
{
         public ByteArrayToByteBuffer() {
             super(byte[].class, ByteBuffer.class);
@@ -100,6 +108,10 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * An object that converts a <code>ByteBuffer</code> to a
+     * byte array.
+     */
     public static class ByteBufferToByteArray extends AbstractConverter<ByteBuffer, byte[]>
{
         public ByteBufferToByteArray() {
             super(ByteBuffer.class, byte[].class);
@@ -114,6 +126,10 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * An object that converts a <code>Charset</code> to a
+     * character set name <code>String</code>.
+     */
     public static class CharsetToString extends AbstractConverter<Charset, String>
{
         public CharsetToString() {
             super(Charset.class, String.class);
@@ -124,6 +140,10 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * An object that converts a <code>java.sql.Clob</code> to a
+     * <code>String</code>.
+     */
     public static class ClobToString extends AbstractConverter<Clob, String> {
         public ClobToString() {
             super(Clob.class, String.class);
@@ -155,6 +175,10 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * An object that converts a <code>DecimalFormat</code> to a
+     * format pattern <code>String</code>.
+     */
     public static class DecimalFormatToString extends AbstractConverter<DecimalFormat,
String> {
         public DecimalFormatToString() {
             super(DecimalFormat.class, String.class);
@@ -187,12 +211,20 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * A class used for testing <code>ConverterLoader</code>
+     * implementations.
+     */
     public static class NotAConverter {
         protected NotAConverter() {
             throw new Error("Should not be loaded");
         }
     }
 
+    /**
+     * An object that converts a <code>SimpleDateFormat</code> to a
+     * format pattern <code>String</code>.
+     */
     public static class SimpleDateFormatToString extends AbstractConverter<SimpleDateFormat,
String> {
         public SimpleDateFormatToString() {
             super(SimpleDateFormat.class, String.class);
@@ -203,6 +235,10 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * An object that converts a character set name <code>String</code> to a
+     * <code>Charset</code>.
+     */
     public static class StringToCharset extends AbstractConverter<String, Charset>
{
         public StringToCharset() {
             super(String.class, Charset.class);
@@ -227,6 +263,10 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * An object that converts a format pattern <code>String</code> to a
+     * <code>DecimalFormat</code>.
+     */
     public static class StringToDecimalFormat extends AbstractConverter<String, DecimalFormat>
{
         public StringToDecimalFormat() {
             super(String.class, DecimalFormat.class);
@@ -273,6 +313,10 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * An object that converts a <code>Locale</code> ID
+     * <code>String</code> to a <code>Locale</code>.
+     */
     public static class StringToLocale extends AbstractConverter<String, Locale> {
         public StringToLocale() {
             super(String.class, Locale.class);
@@ -283,6 +327,10 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * An object that converts a pattern <code>String</code> to a
+     * <code>Pattern</code>.
+     */
     public static class StringToRegexPattern extends AbstractConverter<String, Pattern>
{
         public StringToRegexPattern() {
             super(String.class, Pattern.class);
@@ -293,6 +341,10 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * An object that converts a format <code>String</code> to a
+     * <code>SimpleDateFormat</code>.
+     */
     public static class StringToSimpleDateFormat extends AbstractConverter<String, SimpleDateFormat>
{
         public StringToSimpleDateFormat() {
             super(String.class, SimpleDateFormat.class);
@@ -303,6 +355,10 @@ public class MiscConverters implements C
         }
     }
 
+    /**
+     * An object that converts a UUID <code>String</code> to a
+     * <code>UUID</code>.
+     */
     public static class StringToUUID extends AbstractConverter<String, UUID> {
         public StringToUUID() {
             super(String.class, UUID.class);

Modified: commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/NetConverters.java
URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/NetConverters.java?rev=1042430&r1=1042429&r2=1042430&view=diff
==============================================================================
--- commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/NetConverters.java
(original)
+++ commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/NetConverters.java
Sun Dec  5 19:54:41 2010
@@ -25,7 +25,7 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 
-/** Net Converter classes. */
+/** java.net Converter classes. */
 public class NetConverters implements ConverterLoader {
 
     public void loadConverters() {
@@ -40,6 +40,10 @@ public class NetConverters implements Co
         Converters.registerConverter(new GenericSingletonToSet<URL>(URL.class));
     }
 
+    /**
+     * An object that converts an <code>InetAddress</code> to a
+     * <code>String</code>.
+     */
     public static class InetAddressToString extends AbstractConverter<InetAddress, String>
{
         public InetAddressToString() {
             super(InetAddress.class, String.class);
@@ -52,6 +56,10 @@ public class NetConverters implements Co
         }
     }
 
+    /**
+     * An object that converts a <code>String</code> to an
+     * <code>InetAddress</code>.
+     */
     public static class StringToInetAddress extends AbstractConverter<String, InetAddress>
{
         public StringToInetAddress() {
             super(String.class, InetAddress.class);
@@ -66,6 +74,10 @@ public class NetConverters implements Co
         }
     }
 
+    /**
+     * An object that converts a <code>String</code> to a
+     * <code>URI</code>.
+     */
     public static class StringToURI extends AbstractConverter<String, URI> {
         public StringToURI() {
             super(String.class, URI.class);
@@ -80,6 +92,10 @@ public class NetConverters implements Co
         }
     }
 
+    /**
+     * An object that converts a <code>String</code> to a
+     * <code>URL</code>.
+     */
     public static class StringToURL extends AbstractConverter<String, URL> {
         public StringToURL() {
             super(String.class, URL.class);
@@ -94,6 +110,10 @@ public class NetConverters implements Co
         }
     }
 
+    /**
+     * An object that converts a <code>URI</code> to a
+     * <code>URL</code>.
+     */
     public static class URIToURL extends AbstractConverter<URI, URL> {
         public URIToURL() {
             super(URI.class, URL.class);
@@ -108,6 +128,10 @@ public class NetConverters implements Co
         }
     }
 
+    /**
+     * An object that converts a <code>URL</code> to a
+     * <code>URI</code>.
+     */
     public static class URLToURI extends AbstractConverter<URL, URI> {
         public URLToURI() {
             super(URL.class, URI.class);

Modified: commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/NumberConverters.java
URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/NumberConverters.java?rev=1042430&r1=1042429&r2=1042430&view=diff
==============================================================================
--- commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/NumberConverters.java
(original)
+++ commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/NumberConverters.java
Sun Dec  5 19:54:41 2010
@@ -72,6 +72,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An abstract <code>Number</code> to <code>String</code> converter
class
+     * that implements some of the <code>LocalizedConverter</code> methods. 
+     */
     public static abstract class AbstractNumberToStringConverter<N extends Number>
extends AbstractNumberConverter<N, String> {
         public AbstractNumberToStringConverter(Class<N> sourceClass) {
             super(sourceClass, String.class);
@@ -88,6 +92,10 @@ public class NumberConverters implements
         protected abstract String format(N obj, NumberFormat nf) throws ConversionException;
     }
 
+    /**
+     * An abstract <code>String</code> to <code>Number</code> converter
class
+     * that implements some of the <code>LocalizedConverter</code> methods. 
+     */
     public static abstract class AbstractStringToNumberConverter<N extends Number>
extends AbstractNumberConverter<String, N> {
         public AbstractStringToNumberConverter(Class<N> targetClass) {
             super(String.class, targetClass);
@@ -100,6 +108,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>BigDecimal</code> to a
+     * <code>String</code>.
+     */
     public static class BigDecimalToString extends AbstractNumberToStringConverter<BigDecimal>
{
         public BigDecimalToString() {
             super(BigDecimal.class);
@@ -110,6 +122,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>BigInteger</code> to a
+     * <code>String</code>.
+     */
     public static class BigIntegerToString extends AbstractNumberToStringConverter<BigInteger>
{
         public BigIntegerToString() {
             super(BigInteger.class);
@@ -120,6 +136,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Byte</code> to a
+     * <code>String</code>.
+     */
     public static class ByteToString extends AbstractNumberToStringConverter<Byte>
{
         public ByteToString() {
             super(Byte.class);
@@ -140,6 +160,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Double</code> to a
+     * <code>String</code>.
+     */
     public static class DoubleToString extends AbstractNumberToStringConverter<Double>
{
         public DoubleToString() {
             super(Double.class);
@@ -160,6 +184,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Float</code> to a
+     * <code>String</code>.
+     */
     public static class FloatToString extends AbstractNumberToStringConverter<Float>
{
         public FloatToString() {
             super(Float.class);
@@ -170,6 +198,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Number</code> to a
+     * <code>BigDecimal</code>.
+     */
     public static class GenericNumberToBigDecimal<N extends Number> extends AbstractConverter<N,
BigDecimal> {
         public GenericNumberToBigDecimal(Class<N> sourceClass) {
             super(sourceClass, BigDecimal.class);
@@ -180,6 +212,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Number</code> to a
+     * <code>BigInteger</code>.
+     */
     public static class GenericNumberToBigInteger<N extends Number> extends AbstractConverter<N,
BigInteger> {
         public GenericNumberToBigInteger(Class<N> sourceClass) {
             super(sourceClass, BigInteger.class);
@@ -190,6 +226,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Number</code> to a
+     * <code>Byte</code>.
+     */
     public static class GenericNumberToByte<N extends Number> extends AbstractConverter<N,
Byte> {
         public GenericNumberToByte(Class<N> sourceClass) {
             super(sourceClass, Byte.class);
@@ -200,6 +240,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Number</code> to a
+     * <code>Double</code>.
+     */
     public static class GenericNumberToDouble<N extends Number> extends AbstractConverter<N,
Double> {
         public GenericNumberToDouble(Class<N> sourceClass) {
             super(sourceClass, Double.class);
@@ -210,6 +254,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Number</code> to a
+     * <code>Float</code>.
+     */
     public static class GenericNumberToFloat<N extends Number> extends AbstractConverter<N,
Float> {
         public GenericNumberToFloat(Class<N> sourceClass) {
             super(sourceClass, Float.class);
@@ -220,6 +268,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Number</code> to an
+     * <code>Integer</code>.
+     */
     public static class GenericNumberToInteger<N extends Number> extends AbstractConverter<N,
Integer> {
         public GenericNumberToInteger(Class<N> sourceClass) {
             super(sourceClass, Integer.class);
@@ -230,6 +282,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Number</code> to a
+     * <code>Long</code>.
+     */
     public static class GenericNumberToLong<N extends Number> extends AbstractConverter<N,
Long> {
         public GenericNumberToLong(Class<N> sourceClass) {
             super(sourceClass, Long.class);
@@ -240,6 +296,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Number</code> to a
+     * <code>Short</code>.
+     */
     public static class GenericNumberToShort<N extends Number> extends AbstractConverter<N,
Short> {
         public GenericNumberToShort(Class<N> sourceClass) {
             super(sourceClass, Short.class);
@@ -270,6 +330,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts an <code>Integer</code> to a
+     * <code>String</code>.
+     */
     public static class IntegerToString extends AbstractNumberToStringConverter<Integer>
{
         public IntegerToString() {
             super(Integer.class);
@@ -280,6 +344,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Long</code> to a
+     * <code>BigDecimal</code>.
+     */
     public static class LongToBigDecimal extends AbstractConverter<Long, BigDecimal>
{
         public LongToBigDecimal() {
             super(Long.class, BigDecimal.class);
@@ -300,6 +368,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Long</code> to a
+     * <code>String</code>.
+     */
     public static class LongToString extends AbstractNumberToStringConverter<Long>
{
         public LongToString() {
             super(Long.class);
@@ -310,6 +382,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>Short</code> to a
+     * <code>String</code>.
+     */
     public static class ShortToString extends AbstractNumberToStringConverter<Short>
{
         public ShortToString() {
             super(Short.class);
@@ -320,6 +396,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>String</code> to a
+     * <code>BigDecimal</code>.
+     */
     public static class StringToBigDecimal extends AbstractStringToNumberConverter<BigDecimal>
{
         public StringToBigDecimal() {
             super(BigDecimal.class);
@@ -334,6 +414,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>String</code> to a
+     * <code>BigInteger</code>.
+     */
     public static class StringToBigInteger extends AbstractStringToNumberConverter<BigInteger>
{
         public StringToBigInteger() {
             super(BigInteger.class);
@@ -348,6 +432,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>String</code> to a
+     * <code>Byte</code>.
+     */
     public static class StringToByte extends AbstractConverter<String, Byte> {
         public StringToByte() {
             super(String.class, Byte.class);
@@ -358,6 +446,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>String</code> to a
+     * <code>Double</code>.
+     */
     public static class StringToDouble extends AbstractStringToNumberConverter<Double>
{
         public StringToDouble() {
             super(Double.class);
@@ -372,6 +464,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>String</code> to a
+     * <code>Float</code>.
+     */
     public static class StringToFloat extends AbstractStringToNumberConverter<Float>
{
         public StringToFloat() {
             super(Float.class);
@@ -386,6 +482,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>String</code> to an
+     * <code>Integer</code>.
+     */
     public static class StringToInteger extends AbstractStringToNumberConverter<Integer>
{
         public StringToInteger() {
             super(Integer.class);
@@ -400,6 +500,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>String</code> to a
+     * <code>Long</code>.
+     */
     public static class StringToLong extends AbstractStringToNumberConverter<Long>
{
         public StringToLong() {
             super(Long.class);
@@ -414,6 +518,10 @@ public class NumberConverters implements
         }
     }
 
+    /**
+     * An object that converts a <code>String</code> to a
+     * <code>Short</code>.
+     */
     public static class StringToShort extends AbstractConverter<String, Short> {
         public StringToShort() {
             super(String.class, Short.class);

Modified: commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Util.java
URL: http://svn.apache.org/viewvc/commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Util.java?rev=1042430&r1=1042429&r2=1042430&view=diff
==============================================================================
--- commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Util.java (original)
+++ commons/sandbox/convert/trunk/src/main/java/org/apache/commons/convert/Util.java Sun Dec
 5 19:54:41 2010
@@ -33,7 +33,8 @@ public class Util {
     }
 
     /**
-     * Tests if a class is a class of a sub-class of or properly implements an interface.
+     * Tests if a class is a sub-class of <code>typeClass</code> or
+     * if a class properly implements an interface.
      * @param objectClass Class to test
      * @param typeClass Class to test against
      * @return true if objectClass is a class or sub-class of, or implements typeClass



Mime
View raw message