public Instantiator invoke() { // Force the creation of the class (and the transformation of the class). This will first // trigger transformations of any base classes. final ClassInstantiator<Component> plasticInstantiator = manager.getClassInstantiator(className); final ComponentModel model = classToModel.get(className); return new Instantiator() { public Component newInstance(InternalComponentResources resources) { return plasticInstantiator.with(ComponentResources.class, resources) .with(InternalComponentResources.class, resources).newInstance(); } public ComponentModel getModel() { return model; } @Override public String toString() { return String.format("[Instantiator[%s]", className); } }; } });