当前位置: 首页>>代码示例>>Java>>正文


Java ModelReference.of方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:17,代码来源:ComponentBinariesRuleDefinitionHandler.java

示例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);
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:18,代码来源:BinaryTasksRuleDefinitionHandler.java

示例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]);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:DefaultMethodRuleDefinition.java

示例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));
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:10,代码来源:ComponentModelRuleDefinitionHandler.java

示例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));
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:11,代码来源:DefaultMethodRuleDefinition.java

示例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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:ComponentBinariesModelRuleExtractor.java

示例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;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:7,代码来源:ComponentBinariesRuleDefinitionHandler.java

示例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;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:6,代码来源:BinaryTasksRuleDefinitionHandler.java


注:本文中的org.gradle.model.internal.core.ModelReference.of方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。