protected Object createObject(Class<?> clazz) throws InstantiationException {
return ReflectionsUtils.instantiate(clazz);
}
protected Collection spawnCollection (Invocable invocable) throws InstantiationException {
PreferredType preferredType = invocable.getAnnotation(PreferredType.class);
if (preferredType == null)
throw new RuntimeException("Cannot instantiate the property " + invocable.getMessageName() + ". It requires a @PreferredType describing what the actual type is.");
Collection collection = (Collection)ReflectionsUtils.instantiate(preferredType.value());
return collection;
}