*/
public Object create( String type, Parameter[] parameters )
throws Throwable {
Object result = null;
Class clazz = null;
Class[] types = null;
Object[] values = null;
clazz = Class.forName( type );
if( parameters == null ) {
result = clazz.newInstance();
} else {
if( parameters!=null && parameters.length > 0 ) {
types = new Class[ parameters.length ];
values = new Object[ parameters.length ];
ParameterMapping mapping = null;
for( int i = 0; i < parameters.length; i++ ) {
mapping = parameters[ i ].getMapping();
types[ i ] = Class.forName( mapping.getType() );
values[ i ] = parameters[ i ].getValue();
}
}
Constructor constructor = clazz.getConstructor( types );
result = constructor.newInstance( values );
}
return result;
}