// TODO extract common general method reusable by all AnnotationRuleDefinitionHandler protected InvalidModelRuleDeclarationException invalidModelRule( MethodRuleDefinition<?, ?> ruleDefinition, InvalidModelException e) { StringBuilder sb = new StringBuilder(); ruleDefinition.getDescriptor().describeTo(sb); sb.append(" is not a valid BinaryTask model rule method."); return new InvalidModelRuleDeclarationException(sb.toString(), e); }
@Override protected <R, S> ExtractedModelRule createRegistration( MethodRuleDefinition<R, S> ruleDefinition, ModelType<? extends ComponentSpec> type, TypeBuilderInternal<ComponentSpec> builder) { List<Class<?>> dependencies = ImmutableList.<Class<?>>of(ComponentModelBasePlugin.class); ModelType<? extends BaseComponentSpec> implementation = determineImplementationType(type, builder); ModelAction mutator = new RegistrationAction( type, implementation, builder.getInternalViews(), ruleDefinition.getDescriptor()); return new ExtractedModelAction(ModelActionRole.Defaults, dependencies, mutator); }