use of org.eclipse.winery.yaml.common.writer.yaml.support.Printer in project winery by eclipse.
the class Writer method printMapObject.
private Printer printMapObject(String keyValue, Map<String, ? extends Object> map, Parameter parameter) {
Printer printer = new Printer(parameter.getIndent());
if (!map.isEmpty()) {
printer.printCheckNewLine().printKey(keyValue).indent(INDENT_SIZE);
map.forEach(printer::printKeyObject);
printer.indent(-INDENT_SIZE);
}
return printer;
}
use of org.eclipse.winery.yaml.common.writer.yaml.support.Printer in project winery by eclipse.
the class Writer method visit.
public Printer visit(Metadata node, Parameter parameter) {
Printer printer = new Printer(parameter.getIndent());
if (!node.isEmpty()) {
printer.printKey("metadata").indent(INDENT_SIZE);
node.forEach(printer::printKeyValue);
printer.indent(-INDENT_SIZE);
}
return printer;
}
use of org.eclipse.winery.yaml.common.writer.yaml.support.Printer in project winery by eclipse.
the class Writer method visit.
public Printer visit(TRepositoryDefinition node, Parameter parameter) {
Printer printer = new Printer(parameter.getIndent()).printKeyValue("description", node.getDescription()).printKeyValue("url", node.getUrl());
if (Objects.nonNull(node.getCredential())) {
Credential credential = node.getCredential();
printer.printKey("credential").indent(INDENT_SIZE).printKeyValue("protocol", credential.getProtocol()).printKeyValue("token_type", credential.getTokenType()).printKeyValue("token", credential.getToken()).printKeyObject("keys", credential.getKeys()).printKeyValue("user", credential.getUser()).indent(-INDENT_SIZE);
}
return printer;
}
Aggregations