19 package org.turro.parser.processor;
22 import org.turro.parser.Macro;
23 import org.turro.string.Strings;
24 import org.turro.util.Converter;
32 private final Macro macro;
33 private final Map<String, String> parameters;
37 this.parameters = parameters;
41 return macro.getName();
45 return parameters.get(
"void");
48 public String
get(String name) {
49 return parameters.getOrDefault(name, macro.getDefault(name));
52 public <R> R
get(Class<R> type, String name) {
53 return Converter.STANDARD.convert(
get(name), type);
56 public <R> R
get(Class<R> type, String name, R defaultValue) {
57 String value =
get(name);
58 return Strings.isBlank(value) ? defaultValue : Converter.STANDARD.convert(value, type);
MacroAdapter(Macro macro, Map< String, String > parameters)