From 4e9af51307806f21fcb25be71ecaaeaa707919d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Alcarraz?= Date: Fri, 26 Jul 2024 20:09:10 -0500 Subject: [PATCH] Sugar for Configuration in Groovy --- .../org/jpos/groovy/JPOSGroovyDefaults.groovy | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/groovy/src/main/resources/org/jpos/groovy/JPOSGroovyDefaults.groovy b/modules/groovy/src/main/resources/org/jpos/groovy/JPOSGroovyDefaults.groovy index 2a61f883a9..62e7f6860f 100644 --- a/modules/groovy/src/main/resources/org/jpos/groovy/JPOSGroovyDefaults.groovy +++ b/modules/groovy/src/main/resources/org/jpos/groovy/JPOSGroovyDefaults.groovy @@ -23,6 +23,7 @@ import groovy.transform.Field import org.jpos.transaction.Context import org.jpos.util.Caller +import org.jpos.core.Configuration // ### Groovy initialization to spice up Context object @@ -46,6 +47,17 @@ ctxmc.putAt= { Object key, Object val -> delegate.put(key, val) } +// ### Groovy initialization to spice up Configuration. + +def cfgmc = Configuration.metaClass + +cfgmc.getProperty = { String name -> + return delegate.get(name) +} + +cfgmc.getAt= { Object key -> + return delegate.get(key) +} // ### Groovy alternatives for org.jpos.util.Caller#info() methods