Browse Source

Move creation to new method so easy to overide in the future.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271969 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
c0ad96ab6e
1 changed files with 15 additions and 2 deletions
  1. +15
    -2
      proposal/myrmidon/src/java/org/apache/myrmidon/components/converter/DefaultMasterConverter.java

+ 15
- 2
proposal/myrmidon/src/java/org/apache/myrmidon/components/converter/DefaultMasterConverter.java View File

@@ -84,8 +84,7 @@ public class DefaultMasterConverter
Converter converter = (Converter)m_converters.get( name );
if( converter == null )
{
final TypeFactory factory = m_typeManager.getFactory( Converter.ROLE );
converter = (Converter)factory.create( name );
converter = createConverter( name );
m_converters.put( name, converter );
}

@@ -111,6 +110,20 @@ public class DefaultMasterConverter
}
}

/**
* Create an instance of converter with specified name.
*
* @param name the name of converter
* @return the created converter instance
* @throws Exception if converter can not be created.
*/
private Converter createConverter( final String name )
throws Exception
{
final TypeFactory factory = m_typeManager.getFactory( Converter.ROLE );
return (Converter)factory.create( name );
}

/**
* Determine the name of the converter to use to convert between
* original and destination classes.


Loading…
Cancel
Save