19 package org.turro.parser.processor;
21 import java.util.Optional;
22 import org.turro.parser.MacroMap;
23 import org.turro.parser.MacroParameter;
24 import org.turro.plugin.contacts.IContact;
40 case "user-name" -> context.
write(
42 .map(u -> userName(u, context.
getMacro().
get(
"mode")))
44 case "user-mail" -> context.
write(
46 .map(u -> u.getEmail())
48 case "user-lang" -> context.
write(
50 .map(u -> u.getLocale())
51 .map(l -> l.getLanguage())
58 macros.addMacro(
"user-name")
59 .addParameter(MacroParameter.strict(
"mode",
"formal",
"as-is",
"full",
"friendly"));
60 macros.addMacro(
"user-mail");
61 macros.addMacro(
"user-lang");
66 private String userName(
IContact contact, String mode) {
70 case "as-is" -> contact.
getName();
void explainMacros(MacroMap macros)
void doProcess(MacroProcessorContext context)