1 24 package org.ofbiz.minilang.method.envops; 25 26 import org.ofbiz.minilang.SimpleMethod; 27 import org.ofbiz.minilang.method.ContextAccessor; 28 import org.ofbiz.minilang.method.MethodContext; 29 import org.ofbiz.minilang.method.MethodOperation; 30 import org.w3c.dom.Element ; 31 32 39 public class EnvToEnv extends MethodOperation { 40 41 public static final String module = EnvToEnv.class.getName(); 42 43 protected ContextAccessor envAcsr; 44 protected ContextAccessor toEnvAcsr; 45 46 public EnvToEnv(Element element, SimpleMethod simpleMethod) { 47 super(element, simpleMethod); 48 envAcsr = new ContextAccessor(element.getAttribute("env-name")); 49 toEnvAcsr = new ContextAccessor(element.getAttribute("to-env-name")); 50 } 51 52 public boolean exec(MethodContext methodContext) { 53 toEnvAcsr.put(methodContext, envAcsr.get(methodContext)); 54 return true; 55 } 56 57 public String rawString() { 58 return "<env-to-env env-name=\"" + this.envAcsr + "\" to-env-name=\"" + this.toEnvAcsr + "\"/>"; 59 } 60 public String expandedString(MethodContext methodContext) { 61 return this.rawString(); 63 } 64 } 65 | Popular Tags |