当前位置: 首页>>代码示例>>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;未经允许,请勿转载。