當前位置: 首頁>>代碼示例>>Java>>正文


Java ModelReference.getPath方法代碼示例

本文整理匯總了Java中org.gradle.model.internal.core.ModelReference.getPath方法的典型用法代碼示例。如果您正苦於以下問題:Java ModelReference.getPath方法的具體用法?Java ModelReference.getPath怎麽用?Java ModelReference.getPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.gradle.model.internal.core.ModelReference的用法示例。


在下文中一共展示了ModelReference.getPath方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: toInputBuilder

import org.gradle.model.internal.core.ModelReference; //導入方法依賴的package包/類
private UnboundRuleInput.Builder toInputBuilder(ModelBinding binding) {
    ModelReference<?> reference = binding.getPredicate().getReference();
    UnboundRuleInput.Builder builder = UnboundRuleInput.type(reference.getType());
    ModelPath path;
    if (binding.isBound()) {
        builder.bound();
        path = binding.getNode().getPath();
    } else {
        path = reference.getPath();
        if (path != null) {
            builder.suggestions(CollectionUtils.stringize(suggestionsProvider.transform(path)));
        }
        ModelPath scope = reference.getScope();
        if (scope != null && !scope.equals(ModelPath.ROOT)) {
            builder.scope(scope.toString());
        }
    }
    if (path != null) {
        builder.path(path);
    }
    builder.description(reference.getDescription());
    return builder;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:24,代碼來源:UnboundRulesProcessor.java

示例2: toInputBuilder

import org.gradle.model.internal.core.ModelReference; //導入方法依賴的package包/類
private UnboundRuleInput.Builder toInputBuilder(ModelBinding<?> binding, ModelReference<?> reference) {
    UnboundRuleInput.Builder builder = UnboundRuleInput.type(reference.getType());
    ModelPath path;
    if (binding != null) {
        builder.bound();
        path = binding.getPath();
    } else {
        path = reference.getPath();
        if (path != null) {
            builder.suggestions(CollectionUtils.stringize(suggestionsProvider.transform(path)));
        }
    }
    if (path != null) {
        builder.path(path);
    }
    builder.description(reference.getDescription());
    return builder;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:19,代碼來源:UnboundRulesProcessor.java

示例3: validateRuleMethod

import org.gradle.model.internal.core.ModelReference; //導入方法依賴的package包/類
private void validateRuleMethod(MethodRuleDefinition<?, ?> ruleDefinition, Method ruleMethod, RuleSourceValidationProblemCollector problems) {
    if (Modifier.isPrivate(ruleMethod.getModifiers())) {
        problems.add(ruleMethod, "A rule method cannot be private");
    }
    if (Modifier.isAbstract(ruleMethod.getModifiers())) {
        problems.add(ruleMethod, "A rule method cannot be abstract");
    }

    if (ruleMethod.getTypeParameters().length > 0) {
        problems.add(ruleMethod, "Cannot have type variables (i.e. cannot be a generic method)");
    }

    // TODO validations on method: synthetic, bridge methods, varargs, abstract, native
    ModelType<?> returnType = ModelType.returnType(ruleMethod);
    if (returnType.isRawClassOfParameterizedType()) {
        problems.add(ruleMethod, "Raw type " + returnType + " used for return type (all type parameters must be specified of parameterized type)");
    }

    for (int i = 0; i < ruleDefinition.getReferences().size(); i++) {
        ModelReference<?> reference = ruleDefinition.getReferences().get(i);
        if (reference.getType().isRawClassOfParameterizedType()) {
            problems.add(ruleMethod, "Raw type " + reference.getType() + " used for parameter " + (i + 1) + " (all type parameters must be specified of parameterized type)");
        }
        if (reference.getPath() != null) {
            try {
                ModelPath.validatePath(reference.getPath().getPath());
            } catch (Exception e) {
                problems.add(ruleDefinition, "The declared model element path '" + reference.getPath().getPath() + "' used for parameter " + (i + 1) + " is not a valid path", e);
            }
        }
    }
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:33,代碼來源:ModelRuleExtractor.java

示例4: mapInputs

import org.gradle.model.internal.core.ModelReference; //導入方法依賴的package包/類
private void mapInputs(List<ModelReference<?>> inputs, ModelPath targetPath) {
    for (int i = 0; i < inputs.size(); i++) {
        ModelReference<?> input = inputs.get(i);
        if (input.getPath() != null) {
            inputs.set(i, input.withPath(targetPath.descendant(input.getPath())));
        } else {
            inputs.set(i, input.inScope(ModelPath.ROOT));
        }
    }
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:11,代碼來源:ModelRuleExtractor.java

示例5: mapSubject

import org.gradle.model.internal.core.ModelReference; //導入方法依賴的package包/類
private ModelReference<?> mapSubject(ModelReference<?> subject, ModelPath targetPath) {
    if (subject.getPath() == null) {
        return subject.inScope(targetPath);
    } else {
        return subject.withPath(targetPath.descendant(subject.getPath()));
    }
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:8,代碼來源:ModelRuleExtractor.java

示例6: pathStringOrNull

import org.gradle.model.internal.core.ModelReference; //導入方法依賴的package包/類
private String pathStringOrNull(ModelReference<?> reference) {
    return reference.getPath() == null ? null : reference.getPath().toString();
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:4,代碼來源:RuleBinder.java


注:本文中的org.gradle.model.internal.core.ModelReference.getPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。