01: /*
02: * Created on Jul 14, 2003
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.xdev.base.xssl.bpm.compare;
08:
09: import java.util.ArrayList;
10: import java.util.HashMap;
11:
12: /**
13: * @author AYegorov
14: *
15: * To change the template for this generated type comment go to
16: * Window>Preferences>Java>Code Generation>Code and Comments
17: */
18: public class EqualsComparison extends AbstractComparison {
19:
20: /**
21: * @param id
22: */
23: public EqualsComparison(String id) {
24: super (id);
25: // TODO Auto-generated constructor stub
26: }
27:
28: /**
29: * @param id
30: * @param properties
31: */
32: public EqualsComparison(String id, HashMap properties) {
33: super (id, properties);
34: // TODO Auto-generated constructor stub
35: }
36:
37: /* (non-Javadoc)
38: * @see org.xdev.base.transaction.flow.TemplateFlowComparison#compare(java.lang.Object, java.lang.Object)
39: */
40: protected boolean compare(Object source, Object target) {
41: boolean flag = false;
42:
43: this .logDebug("Comparing source: " + source + " vs target: "
44: + target);
45:
46: if (source != null) {
47: if (this .getBooleanProperty("ignore-case")) {
48: flag = ((String) source)
49: .equalsIgnoreCase((String) target);
50: } else {
51: flag = source.equals(target);
52:
53: }
54: } else if (target == null) {
55: flag = true;
56: }
57:
58: this .logDebug("Equals: " + flag);
59:
60: return flag;
61: }
62:
63: }
|