ScriptableObject.defineClass(scope, clazz);
if (SlingWrapper.class.isAssignableFrom(clazz)) {
// SlingWrappers can map to several classes if needed
final SlingWrapper hostWrapper = (SlingWrapper) clazz.newInstance();;
for (Class<?> c : hostWrapper.getWrappedClasses()) {
getWrapFactory().registerWrapper(c,
hostWrapper.getClassName());
}
} else {
// but other Scriptable host objects need to be