當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。