本文整理汇总了Java中org.gradle.model.internal.core.ModelReference.of方法的典型用法代码示例。如果您正苦于以下问题:Java ModelReference.of方法的具体用法?Java ModelReference.of怎么用?Java ModelReference.of使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gradle.model.internal.core.ModelReference
的用法示例。
在下文中一共展示了ModelReference.of方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRegister
import org.gradle.model.internal.core.ModelReference; //导入方法依赖的package包/类
private <R, S extends BinarySpec> void doRegister(MethodRuleDefinition<R> ruleDefinition, ModelRegistry modelRegistry, RuleSourceDependencies dependencies) {
try {
RuleMethodDataCollector dataCollector = new RuleMethodDataCollector();
visitAndVerifyMethodSignature(dataCollector, ruleDefinition);
final Class<S> binaryType = dataCollector.getParameterType(BinarySpec.class);
final Class<? extends ComponentSpec> componentType = dataCollector.getParameterType(ComponentSpec.class);
dependencies.add(ComponentModelBasePlugin.class);
final ModelReference<BinaryContainer> subject = ModelReference.of(ModelPath.path("binaries"), new ModelType<BinaryContainer>() {
});
configureMutationRule(modelRegistry, subject, componentType, binaryType, ruleDefinition);
} catch (InvalidComponentModelException e) {
invalidModelRule(ruleDefinition, e);
}
}
示例2: doRegister
import org.gradle.model.internal.core.ModelReference; //导入方法依赖的package包/类
private <R, S extends BinarySpec> void doRegister(MethodRuleDefinition<R> ruleDefinition, ModelRegistry modelRegistry, RuleSourceDependencies dependencies) {
try {
RuleMethodDataCollector dataCollector = new RuleMethodDataCollector();
verifyMethodSignature(dataCollector, ruleDefinition);
Class<S> binaryType = dataCollector.getParameterType(BinarySpec.class);
dependencies.add(ComponentModelBasePlugin.class);
final ModelReference<TaskContainer> tasks = ModelReference.of(ModelPath.path("tasks"), new ModelType<TaskContainer>() {
});
modelRegistry.mutate(new BinaryTaskRule<R, S>(tasks, binaryType, ruleDefinition, modelRegistry));
} catch (InvalidComponentModelException e) {
invalidModelRule(ruleDefinition, e);
}
}
示例3: reference
import org.gradle.model.internal.core.ModelReference; //导入方法依赖的package包/类
private ModelReference<?> reference(List<Annotation> annotations, int i) {
Path pathAnnotation = (Path) findFirst(annotations, new Spec<Annotation>() {
public boolean isSatisfiedBy(Annotation element) {
return element.annotationType().equals(Path.class);
}
});
ModelPath path = pathAnnotation == null ? null : ModelPath.path(pathAnnotation.value());
ModelType<?> cast = method.getGenericParameterTypes().get(i);
return ModelReference.of(path, cast, PARAMETER_DESC[i]);
}
示例4: RegisterTypeRule
import org.gradle.model.internal.core.ModelReference; //导入方法依赖的package包/类
protected RegisterTypeRule(ModelType<? extends T> type, ModelType<? extends U> implementation, ModelRuleDescriptor descriptor, Action<? super RegistrationContext<T, U>> registerAction) {
this.type = type;
this.implementation = implementation;
this.descriptor = descriptor;
this.registerAction = registerAction;
subject = ModelReference.of("extensions", ExtensionContainer.class);
inputs = ImmutableList.<ModelReference<?>>of(ModelReference.of(ProjectIdentifier.class));
}
示例5: reference
import org.gradle.model.internal.core.ModelReference; //导入方法依赖的package包/类
private ModelReference<?> reference(Type type, Annotation[] annotations, int i) {
Path pathAnnotation = (Path) findFirst(annotations, new Spec<Annotation>() {
public boolean isSatisfiedBy(Annotation element) {
return element.annotationType().equals(Path.class);
}
});
String path = pathAnnotation == null ? null : pathAnnotation.value();
ModelType<?> cast = ModelType.of(type);
return ModelReference.of(path == null ? null : ModelPath.path(path), cast, String.format("parameter %s", i + 1));
}
示例6: apply
import org.gradle.model.internal.core.ModelReference; //导入方法依赖的package包/类
@Override
public void apply(MethodModelRuleApplicationContext context, MutableModelNode target) {
ModelReference<C> subject = ModelReference.of(componentType);
ComponentBinariesRule<S, C> componentBinariesRule = new ComponentBinariesRule<S, C>(subject, componentType, binaryType, getRuleDefinition());
RuleExtractorUtils.configureRuleAction(context, RuleApplicationScope.DESCENDANTS, ModelActionRole.Finalize, componentBinariesRule);
}
示例7: ComponentBinariesRule
import org.gradle.model.internal.core.ModelReference; //导入方法依赖的package包/类
public ComponentBinariesRule(ModelReference<BinaryContainer> subject, final Class<? extends ComponentSpec> componentType, final Class<S> binaryType, MethodRuleDefinition<R> ruleDefinition, ModelRegistry modelRegistry) {
super(subject, componentType, ruleDefinition, ModelReference.of("componentSpecs", ComponentSpecContainer.class));
this.componentType = componentType;
this.binaryType = binaryType;
this.modelRegistry = modelRegistry;
}
示例8: BinaryTaskRule
import org.gradle.model.internal.core.ModelReference; //导入方法依赖的package包/类
public BinaryTaskRule(ModelReference<TaskContainer> subject, final Class<T> binaryType, MethodRuleDefinition<R> ruleDefinition, ModelRegistry modelRegistry) {
super(subject, binaryType, ruleDefinition, ModelReference.of("binaries", BinaryContainer.class));
this.binaryType = binaryType;
this.modelRegistry = modelRegistry;
}