1 24 package org.ofbiz.minilang.operation; 25 26 import java.util.*; 27 28 import org.w3c.dom.*; 29 import org.ofbiz.base.util.*; 30 31 38 public abstract class BaseCompare extends SimpleMapOperation { 39 String operator; 40 String type; 41 String format; 42 43 public BaseCompare(Element element, SimpleMapProcess simpleMapProcess) { 44 super(element, simpleMapProcess); 45 this.operator = element.getAttribute("operator"); 46 this.type = element.getAttribute("type"); 47 this.format = element.getAttribute("format"); 48 49 60 } 61 62 public void doCompare(Object value1, Object value2, List messages, Locale locale, ClassLoader loader) { 63 Boolean success = BaseCompare.doRealCompare(value1, value2, this.operator, this.type, this.format, messages, locale, loader); 64 65 if (success != null && success.booleanValue() == false) { 66 addMessage(messages, loader, locale); 67 } 68 } 69 70 public void exec(Map inMap, Map results, List messages, Locale locale, ClassLoader loader) {} 71 72 public static Boolean doRealCompare(Object value1, Object value2, String operator, String type, String format, 73 List messages, Locale locale, ClassLoader loader) { 74 return ObjectType.doRealCompare(value1, value2, operator, type, format, messages, locale, loader); 75 } 76 } 77 | Popular Tags |