diff --git a/proposal/myrmidon/src/java/org/apache/aut/converter/AbstractConverter.java b/proposal/myrmidon/src/java/org/apache/aut/converter/AbstractConverter.java index 038c81e52..4cb019023 100644 --- a/proposal/myrmidon/src/java/org/apache/aut/converter/AbstractConverter.java +++ b/proposal/myrmidon/src/java/org/apache/aut/converter/AbstractConverter.java @@ -7,7 +7,6 @@ */ package org.apache.aut.converter; -import java.util.Map; import org.apache.avalon.excalibur.i18n.ResourceManager; import org.apache.avalon.excalibur.i18n.Resources; @@ -49,7 +48,7 @@ public abstract class AbstractConverter */ public Object convert( final Class destination, final Object original, - final Map context ) + final ConverterContext context ) throws ConverterException { if( m_destination != destination ) @@ -77,7 +76,7 @@ public abstract class AbstractConverter * @return the converted object * @exception ConverterException if an error occurs */ - protected abstract Object convert( Object original, Map context ) + protected abstract Object convert( Object original, ConverterContext context ) throws ConverterException; } diff --git a/proposal/myrmidon/src/java/org/apache/aut/converter/Converter.java b/proposal/myrmidon/src/java/org/apache/aut/converter/Converter.java index 166da6c50..ac2b7b52d 100644 --- a/proposal/myrmidon/src/java/org/apache/aut/converter/Converter.java +++ b/proposal/myrmidon/src/java/org/apache/aut/converter/Converter.java @@ -32,6 +32,6 @@ public interface Converter * @return the converted object * @exception ConverterException if an error occurs */ - Object convert( Class destination, Object original, Map context ) + Object convert( Class destination, Object original, ConverterContext context ) throws ConverterException; } diff --git a/proposal/myrmidon/src/java/org/apache/aut/converter/ConverterContext.java b/proposal/myrmidon/src/java/org/apache/aut/converter/ConverterContext.java new file mode 100644 index 000000000..c0369d127 --- /dev/null +++ b/proposal/myrmidon/src/java/org/apache/aut/converter/ConverterContext.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) The Apache Software Foundation. All rights reserved. + * + * This software is published under the terms of the Apache Software License + * version 1.1, a copy of which has been included with this distribution in + * the LICENSE.txt file. + */ +package org.apache.aut.converter; + +/** + * The context in which objects can be converted from one type to another type. + * + * @author Peter Donald + * @version $Revision$ $Date$ + * @ant:role shorthand="converter" + */ +public interface ConverterContext +{ + /** + * Retrieve a vlaue from the context with the specified key. + * Will return null if no such value exists. + */ + Object get( Object key ); +}