Browse Source

Map --> ConverterContext

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271328 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
109578bc56
3 changed files with 27 additions and 4 deletions
  1. +2
    -3
      proposal/myrmidon/src/java/org/apache/aut/converter/AbstractConverter.java
  2. +1
    -1
      proposal/myrmidon/src/java/org/apache/aut/converter/Converter.java
  3. +24
    -0
      proposal/myrmidon/src/java/org/apache/aut/converter/ConverterContext.java

+ 2
- 3
proposal/myrmidon/src/java/org/apache/aut/converter/AbstractConverter.java View File

@@ -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;
}


+ 1
- 1
proposal/myrmidon/src/java/org/apache/aut/converter/Converter.java View File

@@ -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;
}

+ 24
- 0
proposal/myrmidon/src/java/org/apache/aut/converter/ConverterContext.java View File

@@ -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 <a href="mailto:peter@apache.org">Peter Donald</a>
* @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 );
}

Loading…
Cancel
Save