doCreate(name, ModelType.of(type), configAction, new CustomTypeFactory<S>(name, type));
}
private <S extends T> void doCreate(final String name, ModelType<S> type, Action<? super S> configAction, Factory<? extends S> factory) {
ModelReference<S> modelReference = ModelReference.of(collectionPath.child(name), type);
ModelRuleDescriptor descriptor = new NestedModelRuleDescriptor(sourceDescriptor, ActionModelRuleDescriptor.from(new ErroringAction<Appendable>() {
@Override
protected void doExecute(Appendable thing) throws Exception {
thing.append("create(").append(name).append(")");
}
}));