Search in sources :

Example 1 with ModelReferenceNode

use of org.gradle.model.internal.registry.ModelReferenceNode in project gradle by gradle.

the class ModelNodeRenderer method render.

@Override
public void render(ModelNode model, TextReportBuilder output) {
    if (model.isHidden() && !showHidden) {
        return;
    }
    StyledTextOutput styledTextoutput = output.getOutput();
    if (!model.getPath().equals(ModelPath.ROOT)) {
        printNodeName(model, styledTextoutput);
        maybePrintType(model, styledTextoutput);
        maybePrintValue(model, styledTextoutput);
        printCreator(model, styledTextoutput);
        maybePrintRules(model, styledTextoutput);
    }
    if (model instanceof ModelReferenceNode) {
        return;
    }
    Map<String, ModelNode> links = new TreeMap<String, ModelNode>();
    for (ModelNode node : model.getLinks(ModelType.untyped())) {
        links.put(node.getPath().getName(), node);
    }
    output.collection(links.values(), this);
}
Also used : ModelReferenceNode(org.gradle.model.internal.registry.ModelReferenceNode) StyledTextOutput(org.gradle.internal.logging.text.StyledTextOutput) TreeMap(java.util.TreeMap) ModelNode(org.gradle.model.internal.core.ModelNode)

Aggregations

TreeMap (java.util.TreeMap)1 StyledTextOutput (org.gradle.internal.logging.text.StyledTextOutput)1 ModelNode (org.gradle.model.internal.core.ModelNode)1 ModelReferenceNode (org.gradle.model.internal.registry.ModelReferenceNode)1