Author: doogie
Date: Thu Nov 12 17:12:02 2009 New Revision: 835451 URL: http://svn.apache.org/viewvc?rev=835451&view=rev Log: Remove extraneous blank lines, and trailing whitespace. Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/BooleanConverters.java ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/CollectionConverters.java ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/ConversionException.java ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converter.java ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/ConverterLoader.java ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/LocalizedConverter.java ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/MiscConverters.java ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/NumberConverters.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/Converters.java Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/BooleanConverters.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/BooleanConverters.java?rev=835451&r1=835450&r2=835451&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/BooleanConverters.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/BooleanConverters.java Thu Nov 12 17:12:02 2009 @@ -20,9 +20,7 @@ /** Boolean Converter classes. */ public class BooleanConverters implements ConverterLoader { - public static class BooleanToInteger extends AbstractConverter<Boolean, Integer> { - public BooleanToInteger() { super(Boolean.class, Integer.class); } @@ -30,11 +28,9 @@ public Integer convert(Boolean obj) throws ConversionException { return obj.booleanValue() ? 1 : 0; } - } public static class BooleanToString extends AbstractConverter<Boolean, String> { - public BooleanToString() { super(Boolean.class, String.class); } @@ -42,11 +38,9 @@ public String convert(Boolean obj) throws ConversionException { return obj.booleanValue() ? "true" : "false"; } - } public static class IntegerToBoolean extends AbstractConverter<Integer, Boolean> { - public IntegerToBoolean() { super(Integer.class, Boolean.class); } @@ -57,7 +51,6 @@ } public static class StringToBoolean extends AbstractConverter<String, Boolean> { - public StringToBoolean() { super(String.class, Boolean.class); } @@ -65,11 +58,9 @@ public Boolean convert(String obj) throws ConversionException { return "TRUE".equals(obj.toUpperCase()); } - } public void loadConverters() { Converters.loadContainedConverters(BooleanConverters.class); } - } Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/CollectionConverters.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/CollectionConverters.java?rev=835451&r1=835450&r2=835451&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/CollectionConverters.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/CollectionConverters.java Thu Nov 12 17:12:02 2009 @@ -32,9 +32,7 @@ /** Collection Converter classes. */ public class CollectionConverters implements ConverterLoader { - public static class ArrayToList extends AbstractConverter<Object[], List> { - public ArrayToList() { super(Object[].class, List.class); } @@ -47,11 +45,9 @@ public List<?> convert(Object[] obj) throws ConversionException { return Arrays.asList(obj); } - } public static class ListToString extends AbstractConverter<List, String> { - public ListToString() { super(List.class, String.class); } @@ -59,11 +55,9 @@ public String convert(List obj) throws ConversionException { return obj.toString(); } - } public static class MapToList extends AbstractCollectionConverter<Map, List<Map>> { - public MapToList() { super(Map.class, List.class); } @@ -73,11 +67,9 @@ tempList.add(obj); return tempList; } - } public static class MapToSet extends AbstractCollectionConverter<Map, Set<Map>> { - public MapToSet() { super(Map.class, Set.class); } @@ -87,11 +79,9 @@ tempSet.add(obj); return tempSet; } - } public static class MapToString extends AbstractConverter<Map, String> { - public MapToString() { super(Map.class, String.class); } @@ -99,11 +89,9 @@ public String convert(Map obj) throws ConversionException { return obj.toString(); } - } public static class StringToList extends AbstractCollectionConverter<String, List<String>> { - public StringToList() { super(String.class, List.class); } @@ -117,11 +105,9 @@ return tempList; } } - } public static class StringToMap extends AbstractConverter<String, Map> { - public StringToMap() { super(String.class, Map.class); } @@ -132,11 +118,9 @@ } throw new ConversionException("Could not convert " + obj + " to Map: "); } - } public static class StringToSet extends AbstractCollectionConverter<String, Set<String>> { - public StringToSet() { super(String.class, Set.class); } @@ -150,11 +134,9 @@ return tempSet; } } - } public void loadConverters() { Converters.loadContainedConverters(CollectionConverters.class); } - } Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/ConversionException.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/ConversionException.java?rev=835451&r1=835450&r2=835451&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/ConversionException.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/ConversionException.java Thu Nov 12 17:12:02 2009 @@ -21,7 +21,6 @@ /** ConversionException class. */ @SuppressWarnings("serial") public class ConversionException extends Exception { - public ConversionException(String message, Throwable cause) { super(message, cause); } @@ -33,5 +32,4 @@ public ConversionException(Throwable cause) { super(cause); } - } Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converter.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converter.java?rev=835451&r1=835450&r2=835451&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converter.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converter.java Thu Nov 12 17:12:02 2009 @@ -24,7 +24,6 @@ * @param <T> The target object type */ public interface Converter<S, T> { - /** Returns <code>true</code> if this object can convert * <code>sourceClass</code> to <code>targetClass</code>. * <p>Implementations can accomodate class hierarchy ranges @@ -56,5 +55,4 @@ * @return The target <code>Class</code> for this converter */ public Class<?> getTargetClass(); - } Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/ConverterLoader.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/ConverterLoader.java?rev=835451&r1=835450&r2=835451&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/ConverterLoader.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/ConverterLoader.java Thu Nov 12 17:12:02 2009 @@ -23,7 +23,6 @@ * */ public interface ConverterLoader { - /** Create and register converters with the Java object type * conversion framework. If the converter extends one of the * converter abstract classes, then the converter will register @@ -33,5 +32,4 @@ * */ public void loadConverters(); - } Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java?rev=835451&r1=835450&r2=835451&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/Converters.java Thu Nov 12 17:12:02 2009 @@ -34,10 +34,9 @@ /** A <code>Converter</code> factory and repository. */ public class Converters { - - protected static final String module = Converters.class.getName(); - protected static final String DELIMITER = "->"; - protected static final Map<String, Converter<?, ?>> converterMap = FastMap.newInstance(); + protected static final String module = Converters.class.getName(); + protected static final String DELIMITER = "->"; + protected static final Map<String, Converter<?, ?>> converterMap = FastMap.newInstance(); protected static final Set<String> noConversions = FastSet.newInstance(); protected static final Converter<Object, Object> nullConverter = new NullConverter(); @@ -137,7 +136,6 @@ } protected static class NullConverter implements Converter<Object, Object> { - public NullConverter() { Converters.registerConverter(this); } @@ -160,7 +158,5 @@ public Class<?> getTargetClass() { return Object.class; } - } - } Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java?rev=835451&r1=835450&r2=835451&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/DateTimeConverters.java Thu Nov 12 17:12:02 2009 @@ -30,9 +30,7 @@ /** Date/time Converter classes. */ public class DateTimeConverters implements ConverterLoader { - public static class CalendarToLong extends AbstractConverter<Calendar, Long> { - public CalendarToLong() { super(Calendar.class, Long.class); } @@ -40,11 +38,9 @@ public Long convert(Calendar obj) throws ConversionException { return obj.getTimeInMillis(); } - } public static class CalendarToString extends AbstractConverter<Calendar, String> { - public CalendarToString() { super(Calendar.class, String.class); } @@ -55,11 +51,9 @@ DateFormat df = UtilDateTime.toDateTimeFormat(UtilDateTime.DATE_TIME_FORMAT, timeZone, locale); return df.format(obj); } - } public static class DateToLong extends AbstractConverter<java.util.Date, Long> { - public DateToLong() { super(java.util.Date.class, Long.class); } @@ -67,11 +61,9 @@ public Long convert(java.util.Date obj) throws ConversionException { return obj.getTime(); } - } public static class DateToSqlDate extends AbstractConverter<java.util.Date, java.sql.Date> { - public DateToSqlDate() { super(java.util.Date.class, java.sql.Date.class); } @@ -79,11 +71,9 @@ public java.sql.Date convert(java.util.Date obj) throws ConversionException { return new java.sql.Date(obj.getTime()); } - } public static class DateToString extends GenericLocalizedConverter<java.util.Date, String> { - public DateToString() { super(java.util.Date.class, String.class); } @@ -97,11 +87,9 @@ } return df.format(obj); } - } public static class DateToTimestamp extends AbstractConverter<java.util.Date, java.sql.Timestamp> { - public DateToTimestamp() { super(java.util.Date.class, java.sql.Timestamp.class); } @@ -109,11 +97,9 @@ public java.sql.Timestamp convert(java.util.Date obj) throws ConversionException { return new java.sql.Timestamp(obj.getTime()); } - } public static class DurationToString extends AbstractConverter<TimeDuration, String> { - public DurationToString() { super(TimeDuration.class, String.class); } @@ -121,11 +107,9 @@ public String convert(TimeDuration obj) throws ConversionException { return obj.toString(); } - } public static abstract class GenericLocalizedConverter<S, T> extends AbstractLocalizedConverter<S, T> { - protected GenericLocalizedConverter(Class<S> sourceClass, Class<T> targetClass) { super(sourceClass, targetClass); } @@ -137,11 +121,9 @@ public T convert(S obj, Locale locale, TimeZone timeZone) throws ConversionException { return convert(obj, locale, timeZone, null); } - } public static class LongToCalendar extends AbstractLocalizedConverter<Long, Calendar> { - public LongToCalendar() { super(Long.class, Calendar.class); } @@ -157,11 +139,9 @@ public Calendar convert(Long obj, Locale locale, TimeZone timeZone, String formatString) throws ConversionException { return convert(obj, Locale.getDefault(), TimeZone.getDefault()); } - } public static class NumberToDate extends AbstractConverter<Number, java.util.Date> { - public NumberToDate() { super(Number.class, java.util.Date.class); } @@ -169,11 +149,9 @@ public java.util.Date convert(Number obj) throws ConversionException { return new java.util.Date(obj.longValue()); } - } public static class NumberToDuration extends AbstractConverter<Number, TimeDuration> { - public NumberToDuration() { super(Number.class, TimeDuration.class); } @@ -181,11 +159,9 @@ public TimeDuration convert(Number obj) throws ConversionException { return TimeDuration.fromNumber(obj); } - } public static class NumberToSqlDate extends AbstractConverter<Number, java.sql.Date> { - public NumberToSqlDate() { super(Number.class, java.sql.Date.class); } @@ -193,11 +169,9 @@ public java.sql.Date convert(Number obj) throws ConversionException { return new java.sql.Date(obj.longValue()); } - } public static class NumberToSqlTime extends AbstractConverter<Number, java.sql.Time> { - public NumberToSqlTime() { super(Number.class, java.sql.Time.class); } @@ -205,11 +179,9 @@ public java.sql.Time convert(Number obj) throws ConversionException { return new java.sql.Time(obj.longValue()); } - } public static class NumberToTimestamp extends AbstractConverter<Number, java.sql.Timestamp> { - public NumberToTimestamp() { super(Number.class, java.sql.Timestamp.class); } @@ -217,11 +189,9 @@ public java.sql.Timestamp convert(Number obj) throws ConversionException { return new java.sql.Timestamp(obj.longValue()); } - } public static class SqlDateToDate extends AbstractConverter<java.sql.Date, java.util.Date> { - public SqlDateToDate() { super(java.sql.Date.class, java.util.Date.class); } @@ -229,11 +199,9 @@ public java.util.Date convert(java.sql.Date obj) throws ConversionException { return new java.util.Date(obj.getTime()); } - } public static class SqlDateToString extends GenericLocalizedConverter<java.sql.Date, String> { - public SqlDateToString() { super(java.sql.Date.class, String.class); } @@ -247,11 +215,9 @@ } return df.format(obj); } - } public static class SqlTimeToString extends GenericLocalizedConverter<java.sql.Time, String> { - public SqlTimeToString() { super(java.sql.Time.class, String.class); } @@ -265,11 +231,9 @@ } return df.format(obj); } - } public static class StringToCalendar extends AbstractLocalizedConverter<String, Calendar> { - public Calendar convert(String obj) throws ConversionException { return convert(obj, Locale.getDefault(), TimeZone.getDefault(), null); } @@ -300,11 +264,9 @@ throw new ConversionException(e); } } - } public static class StringToDate extends GenericLocalizedConverter<String, java.util.Date> { - public StringToDate() { super(String.class, java.util.Date.class); } @@ -326,11 +288,9 @@ throw new ConversionException(e); } } - } public static class StringToDuration extends AbstractConverter<String, TimeDuration> { - public StringToDuration() { super(String.class, TimeDuration.class); } @@ -338,11 +298,9 @@ public TimeDuration convert(String obj) throws ConversionException { return TimeDuration.parseDuration(obj); } - } public static class StringToSqlDate extends GenericLocalizedConverter<String, java.sql.Date> { - public StringToSqlDate() { super(String.class, java.sql.Date.class); } @@ -364,11 +322,9 @@ throw new ConversionException(e); } } - } public static class StringToSqlTime extends GenericLocalizedConverter<String, java.sql.Time> { - public StringToSqlTime() { super(String.class, java.sql.Time.class); } @@ -390,11 +346,9 @@ throw new ConversionException(e); } } - } public static class StringToTimestamp extends GenericLocalizedConverter<String, java.sql.Timestamp> { - public StringToTimestamp() { super(String.class, java.sql.Timestamp.class); } @@ -433,11 +387,9 @@ throw new ConversionException(e); } } - } public static class StringToTimeZone extends AbstractConverter<String, TimeZone> { - public StringToTimeZone() { super(String.class, TimeZone.class); } @@ -450,11 +402,9 @@ throw new ConversionException("Could not convert " + obj + " to TimeZone: "); } } - } public static class TimestampToDate extends AbstractConverter<java.sql.Timestamp, java.util.Date> { - public TimestampToDate() { super(java.sql.Timestamp.class, java.util.Date.class); } @@ -462,11 +412,9 @@ public java.util.Date convert(java.sql.Timestamp obj) throws ConversionException { return new java.sql.Timestamp(obj.getTime()); } - } public static class TimestampToSqlDate extends AbstractConverter<java.sql.Timestamp, java.sql.Date> { - public TimestampToSqlDate() { super(java.sql.Timestamp.class, java.sql.Date.class); } @@ -474,11 +422,9 @@ public java.sql.Date convert(java.sql.Timestamp obj) throws ConversionException { return new java.sql.Date(obj.getTime()); } - } public static class TimeZoneToString extends AbstractConverter<TimeZone, String> { - public TimeZoneToString() { super(TimeZone.class, String.class); } @@ -486,11 +432,9 @@ public String convert(TimeZone obj) throws ConversionException { return obj.getID(); } - } public void loadConverters() { Converters.loadContainedConverters(DateTimeConverters.class); } - } Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/LocalizedConverter.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/LocalizedConverter.java?rev=835451&r1=835450&r2=835451&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/LocalizedConverter.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/LocalizedConverter.java Thu Nov 12 17:12:02 2009 @@ -23,7 +23,6 @@ /** Localized converter interface. */ public interface LocalizedConverter<S, T> extends Converter<S, T> { - /** Converts <code>obj</code> to <code>T</code>. * * @param obj The source <code>Object</code> to convert @@ -44,5 +43,4 @@ * @throws ConversionException */ public T convert(S obj, Locale locale, TimeZone timeZone, String formatString) throws ConversionException; - } Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/MiscConverters.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/MiscConverters.java?rev=835451&r1=835450&r2=835451&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/MiscConverters.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/MiscConverters.java Thu Nov 12 17:12:02 2009 @@ -27,11 +27,9 @@ /** Miscellaneous Converter classes. */ public class MiscConverters implements ConverterLoader { - public static final int CHAR_BUFFER_SIZE = 4096; public static class ClobToString extends AbstractConverter<Clob, String> { - public ClobToString() { super(Clob.class, String.class); } @@ -58,11 +56,9 @@ } return strBuf.toString(); } - } public static class LocaleToString extends AbstractConverter<Locale, String> { - public LocaleToString() { super(Locale.class, String.class); } @@ -70,11 +66,9 @@ public String convert(Locale obj) throws ConversionException { return obj.toString(); } - } public static class StringToLocale extends AbstractConverter<String, Locale> { - public StringToLocale() { super(String.class, Locale.class); } @@ -87,11 +81,9 @@ throw new ConversionException("Could not convert " + obj + " to Locale: "); } } - } public void loadConverters() { Converters.loadContainedConverters(MiscConverters.class); } - } Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/NumberConverters.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/NumberConverters.java?rev=835451&r1=835450&r2=835451&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/NumberConverters.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/conversion/NumberConverters.java Thu Nov 12 17:12:02 2009 @@ -33,11 +33,9 @@ /** Number Converter classes. */ public class NumberConverters implements ConverterLoader { - public static final String module = NumberConverters.class.getName(); public static abstract class AbstractToNumberConverter<S, T> extends AbstractUsesLocaleConverter<S, T> { - protected AbstractToNumberConverter(Class<S> sourceClass, Class<T> targetClass) { super(sourceClass, targetClass); } @@ -50,11 +48,9 @@ throw new ConversionException(e); } } - } public static abstract class AbstractUsesLocaleConverter<S, T> extends AbstractLocalizedConverter<S, T> { - protected AbstractUsesLocaleConverter(Class<S> sourceClass, Class<T> targetClass) { super(sourceClass, targetClass); } @@ -66,12 +62,9 @@ public T convert(S obj, Locale locale, TimeZone timeZone, String formatString) throws ConversionException { return convert(obj, locale, null); } - - } public static class BigDecimalToDouble extends AbstractConverter<BigDecimal, Double> { - public BigDecimalToDouble() { super(BigDecimal.class, Double.class); } @@ -79,11 +72,9 @@ public Double convert(BigDecimal obj) throws ConversionException { return Double.valueOf(obj.doubleValue()); } - } public static class BigDecimalToFloat extends AbstractConverter<BigDecimal, Float> { - public BigDecimalToFloat() { super(BigDecimal.class, Float.class); } @@ -91,11 +82,9 @@ public Float convert(BigDecimal obj) throws ConversionException { return Float.valueOf(obj.floatValue()); } - } public static class BigDecimalToInteger extends AbstractConverter<BigDecimal, Integer> { - public BigDecimalToInteger() { super(BigDecimal.class, Integer.class); } @@ -103,11 +92,9 @@ public Integer convert(BigDecimal obj) throws ConversionException { return Integer.valueOf(obj.intValue()); } - } public static class BigDecimalToList extends AbstractCollectionConverter<BigDecimal, List<BigDecimal>> { - public BigDecimalToList() { super(BigDecimal.class, List.class); } @@ -117,11 +104,9 @@ tempList.add(obj); return tempList; } - } public static class BigDecimalToLong extends AbstractConverter<BigDecimal, Long> { - public BigDecimalToLong() { super(BigDecimal.class, Long.class); } @@ -129,11 +114,9 @@ public Long convert(BigDecimal obj) throws ConversionException { return Long.valueOf(obj.longValue()); } - } public static class BigDecimalToSet extends AbstractCollectionConverter<BigDecimal, Set<BigDecimal>> { - public BigDecimalToSet() { super(BigDecimal.class, Set.class); } @@ -143,11 +126,9 @@ tempSet.add(obj); return tempSet; } - } public static class BigDecimalToString extends AbstractUsesLocaleConverter<BigDecimal, String> { - public BigDecimalToString() { super(BigDecimal.class, String.class); } @@ -156,11 +137,9 @@ NumberFormat nf = NumberFormat.getNumberInstance(locale); return nf.format(obj.doubleValue()); } - } public static class DoubleToBigDecimal extends AbstractConverter<Double, BigDecimal> { - public DoubleToBigDecimal() { super(Double.class, BigDecimal.class); } @@ -168,11 +147,9 @@ public BigDecimal convert(Double obj) throws ConversionException { return BigDecimal.valueOf(obj.doubleValue()); } - } public static class DoubleToFloat extends AbstractConverter<Double, Float> { - public DoubleToFloat() { super(Double.class, Float.class); } @@ -180,11 +157,9 @@ public Float convert(Double obj) throws ConversionException { return Float.valueOf(obj.floatValue()); } - } public static class DoubleToInteger extends AbstractConverter<Double, Integer> { - public DoubleToInteger() { super(Double.class, Integer.class); } @@ -192,11 +167,9 @@ public Integer convert(Double obj) throws ConversionException { return Integer.valueOf(obj.intValue()); } - } public static class DoubleToList extends AbstractCollectionConverter<Double, List<Double>> { - public DoubleToList() { super(Double.class, List.class); } @@ -206,11 +179,9 @@ tempList.add(obj); return tempList; } - } public static class DoubleToLong extends AbstractConverter<Double, Long> { - public DoubleToLong() { super(Double.class, Long.class); } @@ -218,11 +189,9 @@ public Long convert(Double obj) throws ConversionException { return Long.valueOf(obj.longValue()); } - } public static class DoubleToSet extends AbstractCollectionConverter<Double, Set<Double>> { - public DoubleToSet() { super(Double.class, Set.class); } @@ -232,11 +201,9 @@ tempSet.add(obj); return tempSet; } - } public static class DoubleToString extends AbstractUsesLocaleConverter<Double, String> { - public DoubleToString() { super(Double.class, String.class); } @@ -245,11 +212,9 @@ NumberFormat nf = NumberFormat.getNumberInstance(locale); return nf.format(obj.doubleValue()); } - } public static class FloatToBigDecimal extends AbstractConverter<Float, BigDecimal> { - public FloatToBigDecimal() { super(Float.class, BigDecimal.class); } @@ -257,11 +222,9 @@ public BigDecimal convert(Float obj) throws ConversionException { return BigDecimal.valueOf(obj.doubleValue()); } - } public static class FloatToDouble extends AbstractConverter<Float, Double> { - public FloatToDouble() { super(Float.class, Double.class); } @@ -269,11 +232,9 @@ public Double convert(Float obj) throws ConversionException { return Double.valueOf(obj.doubleValue()); } - } public static class FloatToInteger extends AbstractConverter<Float, Integer> { - public FloatToInteger() { super(Float.class, Integer.class); } @@ -281,11 +242,9 @@ public Integer convert(Float obj) throws ConversionException { return Integer.valueOf(obj.intValue()); } - } public static class FloatToList extends AbstractCollectionConverter<Float, List<Float>> { - public FloatToList() { super(Float.class, List.class); } @@ -295,11 +254,9 @@ tempList.add(obj); return tempList; } - } public static class FloatToLong extends AbstractConverter<Float, Long> { - public FloatToLong() { super(Float.class, Long.class); } @@ -307,11 +264,9 @@ public Long convert(Float obj) throws ConversionException { return Long.valueOf(obj.longValue()); } - } public static class FloatToSet extends AbstractCollectionConverter<Float, Set<Float>> { - public FloatToSet() { super(Float.class, Set.class); } @@ -321,11 +276,9 @@ tempSet.add(obj); return tempSet; } - } public static class FloatToString extends AbstractUsesLocaleConverter<Float, String> { - public FloatToString() { super(Float.class, String.class); } @@ -334,11 +287,9 @@ NumberFormat nf = NumberFormat.getNumberInstance(locale); return nf.format(obj.floatValue()); } - } public static class IntegerToBigDecimal extends AbstractConverter<Integer, BigDecimal> { - public IntegerToBigDecimal() { super(Integer.class, BigDecimal.class); } @@ -346,11 +297,9 @@ public BigDecimal convert(Integer obj) throws ConversionException { return BigDecimal.valueOf(obj.doubleValue()); } - } public static class IntegerToDouble extends AbstractConverter<Integer, Double> { - public IntegerToDouble() { super(Integer.class, Double.class); } @@ -358,11 +307,9 @@ public Double convert(Integer obj) throws ConversionException { return Double.valueOf(obj.doubleValue()); } - } public static class IntegerToFloat extends AbstractConverter<Integer, Float> { - public IntegerToFloat() { super(Integer.class, Float.class); } @@ -370,11 +317,9 @@ public Float convert(Integer obj) throws ConversionException { return Float.valueOf(obj.floatValue()); } - } public static class IntegerToList extends AbstractCollectionConverter<Integer, List<Integer>> { - public IntegerToList() { super(Integer.class, List.class); } @@ -384,11 +329,9 @@ tempList.add(obj); return tempList; } - } public static class IntegerToLong extends AbstractConverter<Integer, Long> { - public IntegerToLong() { super(Integer.class, Long.class); } @@ -396,11 +339,9 @@ public Long convert(Integer obj) throws ConversionException { return Long.valueOf(obj.longValue()); } - } public static class IntegerToSet extends AbstractCollectionConverter<Integer, Set<Integer>> { - public IntegerToSet() { super(Integer.class, Set.class); } @@ -410,11 +351,9 @@ tempSet.add(obj); return tempSet; } - } public static class IntegerToString extends AbstractUsesLocaleConverter<Integer, String> { - public IntegerToString() { super(Integer.class, String.class); } @@ -423,11 +362,9 @@ NumberFormat nf = NumberFormat.getNumberInstance(locale); return nf.format(obj.intValue()); } - } public static class LongToBigDecimal extends AbstractConverter<Long, BigDecimal> { - public LongToBigDecimal() { super(Long.class, BigDecimal.class); } @@ -435,11 +372,9 @@ public BigDecimal convert(Long obj) throws ConversionException { return BigDecimal.valueOf(obj.doubleValue()); } - } public static class LongToDouble extends AbstractConverter<Long, Double> { - public LongToDouble() { super(Long.class, Double.class); } @@ -447,11 +382,9 @@ public Double convert(Long obj) throws ConversionException { return Double.valueOf(obj.doubleValue()); } - } public static class LongToFloat extends AbstractConverter<Long, Float> { - public LongToFloat() { super(Long.class, Float.class); } @@ -459,11 +392,9 @@ public Float convert(Long obj) throws ConversionException { return Float.valueOf(obj.floatValue()); } - } public static class LongToInteger extends AbstractConverter<Long, Integer> { - public LongToInteger() { super(Long.class, Integer.class); } @@ -471,11 +402,9 @@ public Integer convert(Long obj) throws ConversionException { return Integer.valueOf(obj.intValue()); } - } public static class LongToList extends AbstractCollectionConverter<Long, List<Long>> { - public LongToList() { super(Long.class, List.class); } @@ -485,11 +414,9 @@ tempList.add(obj); return tempList; } - } public static class LongToSet extends AbstractCollectionConverter<Long, Set<Long>> { - public LongToSet() { super(Long.class, Set.class); } @@ -499,11 +426,9 @@ tempSet.add(obj); return tempSet; } - } public static class LongToString extends AbstractUsesLocaleConverter<Long, String> { - public LongToString() { super(Long.class, String.class); } @@ -512,11 +437,9 @@ NumberFormat nf = NumberFormat.getNumberInstance(locale); return nf.format(obj.longValue()); } - } public static class StringToBigDecimal extends AbstractToNumberConverter<String, BigDecimal> { - public StringToBigDecimal() { super(String.class, BigDecimal.class); } @@ -528,11 +451,9 @@ } return BigDecimal.valueOf(this.fromString(trimStr, locale).doubleValue()); } - } public static class StringToDouble extends AbstractToNumberConverter<String, Double> { - public StringToDouble() { super(String.class, Double.class); } @@ -544,11 +465,9 @@ } return this.fromString(trimStr, locale).doubleValue(); } - } public static class StringToFloat extends AbstractToNumberConverter<String, Float> { - public StringToFloat() { super(String.class, Float.class); } @@ -560,11 +479,9 @@ } return this.fromString(trimStr, locale).floatValue(); } - } public static class StringToInteger extends AbstractToNumberConverter<String, Integer> { - public StringToInteger() { super(String.class, Integer.class); } @@ -576,11 +493,9 @@ } return this.fromString(trimStr, locale).intValue(); } - } public static class StringToLong extends AbstractToNumberConverter<String, Long> { - public StringToLong() { super(String.class, Long.class); } @@ -592,11 +507,9 @@ } return this.fromString(trimStr, locale).longValue(); } - } public void loadConverters() { Converters.loadContainedConverters(NumberConverters.class); } - } Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/Converters.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/Converters.java?rev=835451&r1=835450&r2=835451&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/Converters.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/Converters.java Thu Nov 12 17:12:02 2009 @@ -33,9 +33,7 @@ /** Entity Engine <code>Converter</code> classes. */ public class Converters implements ConverterLoader { - public static class GenericValueToList extends AbstractCollectionConverter<GenericValue, List<GenericValue>> { - public GenericValueToList() { super(GenericValue.class, List.class); } @@ -45,11 +43,9 @@ tempList.add(obj); return tempList; } - - } + } public static class GenericValueToSet extends AbstractCollectionConverter<GenericValue, Set<GenericValue>> { - public GenericValueToSet() { super(GenericValue.class, Set.class); } @@ -59,11 +55,9 @@ tempSet.add(obj); return tempSet; } - } public static class GenericValueToString extends AbstractConverter<GenericValue, String> { - public GenericValueToString() { super(GenericValue.class, String.class); } @@ -71,11 +65,9 @@ public String convert(GenericValue obj) throws ConversionException { return obj.toString(); } - } public static class NullFieldToObject extends AbstractConverter<GenericEntity.NullField, Object> { - public NullFieldToObject() { super(GenericEntity.NullField.class, Object.class); } @@ -83,11 +75,9 @@ public Object convert(GenericEntity.NullField obj) throws ConversionException { return null; } - } public static class ObjectToNullField extends AbstractConverter<Object, GenericEntity.NullField> { - public ObjectToNullField() { super(Object.class, GenericEntity.NullField.class); } @@ -95,11 +85,9 @@ public GenericEntity.NullField convert(Object obj) throws ConversionException { return GenericEntity.NULL_FIELD; } - } public void loadConverters() { org.ofbiz.base.conversion.Converters.loadContainedConverters(Converters.class); } - } |
Free forum by Nabble | Edit this page |