test_class.file: services/src/test/java/org/keycloak/theme/beans/MessageFormatterMethodTest.java
test_class.identifier: MessageFormatterMethodTest
test_case.body: @Test
      public void test() throws TemplateModelException {
  
          Locale locale = Locale.US;
  
          Properties properties = new Properties();
          properties.setProperty("backToApplication", "Back to application");
          properties.setProperty("backToClient", "Back to {0}");
          properties.setProperty("client_admin-console", "Admin Console");
          properties.setProperty("realm_example-realm", "Example Realm");
  
  
          MessageFormatterMethod fmt = new MessageFormatterMethod(locale, properties);
  
          String msg = (String) fmt.exec(Arrays.asList("backToClient", "${client_admin-console}"));
          Assert.assertEquals("Back to Admin Console", msg);
  
          msg = (String) fmt.exec(Arrays.asList("backToClient", "client_admin-console"));
          Assert.assertEquals("Back to client_admin-console", msg);
  
          msg = (String) fmt.exec(Arrays.asList("backToClient", "client '${client_admin-console}' from '${realm_example-realm}'."));
          Assert.assertEquals("Back to client 'Admin Console' from 'Example Realm'.", msg);
      }
test_case.class_method_signature: MessageFormatterMethodTest.test()
test_case.full_signature: @Test public void test()
test_case.identifier: test
test_case.invocations: setProperty setProperty setProperty setProperty exec asList assertEquals exec asList assertEquals exec asList assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test()
focal_class.declarator: messages
focal_class.modifier: private final
focal_class.original_string: private final Properties messages;
focal_class.type: Properties
focal_class.var_name: messages
focal_class.declarator: locale
focal_class.modifier: private final
focal_class.original_string: private final Locale locale;
focal_class.type: Locale
focal_class.var_name: locale
focal_class.file: services/src/main/java/org/keycloak/theme/beans/MessageFormatterMethod.java
focal_class.identifier: MessageFormatterMethod
focal_class.interfaces: implements TemplateMethodModelEx
focal_class.class_method_signature: MessageFormatterMethod.MessageFormatterMethod(Locale locale, Properties messages)
focal_class.full_signature: public  MessageFormatterMethod(Locale locale, Properties messages)
focal_class.identifier: MessageFormatterMethod
focal_class.modifiers: public
focal_class.parameters: (Locale locale, Properties messages)
focal_class.signature:  MessageFormatterMethod(Locale locale, Properties messages)
focal_class.class_method_signature: MessageFormatterMethod.exec(List list)
focal_class.full_signature: @Override public Object exec(List list)
focal_class.identifier: exec
focal_class.modifiers: @Override public
focal_class.parameters: (List list)
focal_class.return: Object
focal_class.signature: Object exec(List list)
focal_class.class_method_signature: MessageFormatterMethod.resolve(List<Object> list)
focal_class.full_signature: private List<Object> resolve(List<Object> list)
focal_class.identifier: resolve
focal_class.modifiers: private
focal_class.parameters: (List<Object> list)
focal_class.return: List<Object>
focal_class.signature: List<Object> resolve(List<Object> list)
focal_method.body: @Override
      public Object exec(List list) throws TemplateModelException {
          if (list.size() >= 1) {
              // resolve any remaining ${} expressions
              List<Object> resolved = resolve(list.subList(1, list.size()));
              String key = list.get(0).toString();
              return new MessageFormat(messages.getProperty(key,key),locale).format(resolved.toArray());
          } else {
              return null;
          }
      }
focal_method.class_method_signature: MessageFormatterMethod.exec(List list)
focal_method.full_signature: @Override public Object exec(List list)
focal_method.identifier: exec
focal_method.invocations: size resolve subList size toString get format getProperty toArray
focal_method.modifiers: @Override public
focal_method.parameters: (List list)
focal_method.return: Object
focal_method.signature: Object exec(List list)