donaldp 02/03/22 20:20:40
Modified:
proposal/myrmidon/src/java/org/apache/myrmidon/components/converter
DefaultMasterConverter.java
Log:
Move creation to new method so easy to overide in the future.
Revision Changes Path
1.23 +16 -3
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/converter/DefaultMasterConverter.java
Index: DefaultMasterConverter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/converter/DefaultMasterConverter.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- DefaultMasterConverter.java 15 Mar 2002 02:48:20 -0000 1.22
+++ DefaultMasterConverter.java 23 Mar 2002 04:20:40 -0000 1.23
@@ -26,7 +26,7 @@
* Converter engine to handle converting between types.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.22 $ $Date: 2002/03/15 02:48:20 $
+ * @version $Revision: 1.23 $ $Date: 2002/03/23 04:20:40 $
*/
public class DefaultMasterConverter
extends AbstractLogEnabled
@@ -84,8 +84,7 @@
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 );
}
@@ -109,6 +108,20 @@
destination.getName() );
throw new ConverterException( message, e );
}
+ }
+
+ /**
+ * 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 );
}
/**
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>