Thus converters are now independent of ant and avalon git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271465 13f79535-47bb-0310-9956-ffa450edef68master
@@ -30,7 +30,7 @@ public class StringToBooleanConverter | |||||
super( String.class, Boolean.class ); | super( String.class, Boolean.class ); | ||||
} | } | ||||
public Object convert( final Object object, final Context context ) | |||||
public Object convert( final Object object, final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
final String string = (String)object; | final String string = (String)object; | ||||
@@ -30,7 +30,7 @@ public class StringToByteConverter | |||||
super( String.class, Byte.class ); | super( String.class, Byte.class ); | ||||
} | } | ||||
public Object convert( final Object object, final Context context ) | |||||
public Object convert( final Object object, final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
try | try | ||||
@@ -30,7 +30,7 @@ public class StringToClassConverter | |||||
super( String.class, Class.class ); | super( String.class, Class.class ); | ||||
} | } | ||||
public Object convert( final Object object, final Context context ) | |||||
public Object convert( final Object object, final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
//TODO: Should we use ContextClassLoader here??? | //TODO: Should we use ContextClassLoader here??? | ||||
@@ -30,7 +30,7 @@ public class StringToDoubleConverter | |||||
super( String.class, Double.class ); | super( String.class, Double.class ); | ||||
} | } | ||||
public Object convert( final Object object, final Context context ) | |||||
public Object convert( final Object object, final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
try | try | ||||
@@ -30,7 +30,7 @@ public class StringToEnumConverter | |||||
public Object convert( final Class destination, | public Object convert( final Class destination, | ||||
final Object original, | final Object original, | ||||
final Context context ) | |||||
final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
final Object object = getEnum( destination, original ); | final Object object = getEnum( destination, original ); | ||||
@@ -10,7 +10,6 @@ package org.apache.antlib.core; | |||||
import java.io.File; | import java.io.File; | ||||
import org.apache.avalon.excalibur.i18n.ResourceManager; | import org.apache.avalon.excalibur.i18n.ResourceManager; | ||||
import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
import org.apache.avalon.framework.context.Context; | |||||
import org.apache.myrmidon.api.TaskContext; | import org.apache.myrmidon.api.TaskContext; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.myrmidon.converter.AbstractConverter; | import org.apache.myrmidon.converter.AbstractConverter; | ||||
@@ -33,7 +32,7 @@ public class StringToFileConverter | |||||
super( String.class, File.class ); | super( String.class, File.class ); | ||||
} | } | ||||
public Object convert( final Object object, final Context context ) | |||||
public Object convert( final Object object, final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
try | try | ||||
@@ -30,7 +30,7 @@ public class StringToFloatConverter | |||||
super( String.class, Float.class ); | super( String.class, Float.class ); | ||||
} | } | ||||
public Object convert( final Object object, final Context context ) | |||||
public Object convert( final Object object, final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
try | try | ||||
@@ -30,7 +30,7 @@ public class StringToIntegerConverter | |||||
super( String.class, Integer.class ); | super( String.class, Integer.class ); | ||||
} | } | ||||
public Object convert( final Object object, final Context context ) | |||||
public Object convert( final Object object, final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
try | try | ||||
@@ -30,7 +30,7 @@ public class StringToLongConverter | |||||
super( String.class, Long.class ); | super( String.class, Long.class ); | ||||
} | } | ||||
public Object convert( final Object object, final Context context ) | |||||
public Object convert( final Object object, final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
try | try | ||||
@@ -30,7 +30,7 @@ public class StringToShortConverter | |||||
super( String.class, Short.class ); | super( String.class, Short.class ); | ||||
} | } | ||||
public Object convert( final Object object, final Context context ) | |||||
public Object convert( final Object object, final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
try | try | ||||
@@ -32,7 +32,7 @@ public class StringToURLConverter | |||||
super( String.class, URL.class ); | super( String.class, URL.class ); | ||||
} | } | ||||
public Object convert( final Object object, final Context context ) | |||||
public Object convert( final Object object, final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
try | try | ||||
@@ -74,7 +74,7 @@ public class DefaultMasterConverter | |||||
*/ | */ | ||||
public Object convert( final Class destination, | public Object convert( final Class destination, | ||||
final Object original, | final Object original, | ||||
final Context context ) | |||||
final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
final Class originalClass = original.getClass(); | final Class originalClass = original.getClass(); | ||||
@@ -9,7 +9,6 @@ package org.apache.myrmidon.converter; | |||||
import org.apache.avalon.excalibur.i18n.ResourceManager; | import org.apache.avalon.excalibur.i18n.ResourceManager; | ||||
import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
import org.apache.avalon.framework.context.Context; | |||||
/** | /** | ||||
* Instances of this interface are used to convert between different types. | * Instances of this interface are used to convert between different types. | ||||
@@ -45,11 +44,11 @@ public abstract class AbstractConverter | |||||
* @param original the original Object | * @param original the original Object | ||||
* @param context the context in which to convert | * @param context the context in which to convert | ||||
* @return the converted object | * @return the converted object | ||||
* @exception Exception if an error occurs | |||||
* @exception ConverterException if an error occurs | |||||
*/ | */ | ||||
public Object convert( final Class destination, | public Object convert( final Class destination, | ||||
final Object original, | final Object original, | ||||
final Context context ) | |||||
final Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
if( m_destination != destination ) | if( m_destination != destination ) | ||||
@@ -75,9 +74,9 @@ public abstract class AbstractConverter | |||||
* @param original the original Object | * @param original the original Object | ||||
* @param context the context in which to convert | * @param context the context in which to convert | ||||
* @return the converted object | * @return the converted object | ||||
* @exception Exception if an error occurs | |||||
* @exception ConverterException if an error occurs | |||||
*/ | */ | ||||
protected abstract Object convert( Object original, Context context ) | |||||
protected abstract Object convert( Object original, Object context ) | |||||
throws ConverterException; | throws ConverterException; | ||||
} | } | ||||
@@ -7,8 +7,6 @@ | |||||
*/ | */ | ||||
package org.apache.myrmidon.converter; | package org.apache.myrmidon.converter; | ||||
import org.apache.avalon.framework.context.Context; | |||||
/** | /** | ||||
* Instances of this interface are used to convert between different types. | * Instances of this interface are used to convert between different types. | ||||
* | * | ||||
@@ -31,6 +29,6 @@ public interface Converter | |||||
* @return the converted object | * @return the converted object | ||||
* @exception ConverterException if an error occurs | * @exception ConverterException if an error occurs | ||||
*/ | */ | ||||
Object convert( Class destination, Object original, Context context ) | |||||
Object convert( Class destination, Object original, Object context ) | |||||
throws ConverterException; | throws ConverterException; | ||||
} | } |
@@ -36,7 +36,7 @@ public class StringToPathConverter | |||||
* @return the converted object | * @return the converted object | ||||
* @exception Exception if an error occurs | * @exception Exception if an error occurs | ||||
*/ | */ | ||||
protected Object convert( Object original, Context context ) | |||||
protected Object convert( Object original, Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
/* | /* | ||||
@@ -36,7 +36,7 @@ public class StringToPathConverter | |||||
* @return the converted object | * @return the converted object | ||||
* @exception Exception if an error occurs | * @exception Exception if an error occurs | ||||
*/ | */ | ||||
protected Object convert( Object original, Context context ) | |||||
protected Object convert( Object original, Object context ) | |||||
throws ConverterException | throws ConverterException | ||||
{ | { | ||||
/* | /* | ||||