/** * Adds the specified {@link CompositeModelBuilder} and its children to the * manager. * @param builder The builder to add. * @return This, as per the builder pattern. */ public Builder add(CompositeModelBuilder<?, ?> builder) { doAdd(builder); for (final ModelBuilder<?, ?> mb : builder.getChildren()) { add(mb); } return this; }
/** * Adds the specified {@link ModelBuilder} to the manager. The * {@link ModelBuilder} will be used to obtain a {@link Model} instance. * @param builder The builder to add. * @return This, as per the builder pattern. */ public Builder add(ModelBuilder<?, ?> builder) { if (builder instanceof CompositeModelBuilder<?, ?>) { return add((CompositeModelBuilder<?, ?>) builder); } doAdd(builder); return this; }