Map all types to interfaces.
final Map<String,Class> m = new HashMap<String,Class>();
for( int i = 0; i < interfaces.length; ++i )
{
final Class theInterface = interfaces[ i ];
try
{
final Field field = theInterface.getField( "J2EE_TYPE" );
final String value = (String)field.get( theInterface );
if ( m.containsKey( value ) )
{
final String msg =
"TypesMapper: key already present: " +
value + " for " + theInterface.getName();
assert( false ): msg;
throw new RuntimeException( msg );
}
m.put( value, theInterface );
}
catch( Exception e )
{
e.printStackTrace();
assert( false );
throw new IllegalArgumentException( theInterface.getName() );
}
}
return( m );