use of cz.habarta.typescript.generator.emitter.TsTemplateLiteral in project typescript-generator by vojtechhabarta.
the class ModelCompiler method processPathTemplate.
private static TsTemplateLiteral processPathTemplate(PathTemplate pathTemplate) {
final List<TsExpression> spans = new ArrayList<>();
for (PathTemplate.Part part : pathTemplate.getParts()) {
if (part instanceof PathTemplate.Literal) {
final PathTemplate.Literal literal = (PathTemplate.Literal) part;
spans.add(new TsStringLiteral(literal.getLiteral()));
}
if (part instanceof PathTemplate.Parameter) {
final PathTemplate.Parameter parameter = (PathTemplate.Parameter) part;
spans.add(new TsIdentifierReference(parameter.getValidName()));
}
}
return new TsTaggedTemplateLiteral(new TsIdentifierReference("uriEncoding"), spans);
}
Aggregations