01: /*
02: * Created on 13.05.2005
03: *
04: */
05: package org.openwfe.gpe.xml;
06:
07: import java.util.HashMap;
08: import java.util.Map;
09:
10: import org.eclipse.gef.editparts.AbstractEditPart;
11: import org.openwfe.gpe.model.AndComposite;
12: import org.openwfe.gpe.model.CaseComposite;
13: import org.openwfe.gpe.model.ConcurrenceComposite;
14: import org.openwfe.gpe.model.ConcurrentIteratorElement;
15: import org.openwfe.gpe.model.DefinedComposite;
16: import org.openwfe.gpe.model.DefinedElement;
17: import org.openwfe.gpe.model.EqualsElement;
18: import org.openwfe.gpe.model.GreaterElement;
19: import org.openwfe.gpe.model.IfComposite;
20: import org.openwfe.gpe.model.IncElement;
21: import org.openwfe.gpe.model.IteratorElement;
22: import org.openwfe.gpe.model.LesserElement;
23: import org.openwfe.gpe.model.LogElement;
24: import org.openwfe.gpe.model.NotElement;
25: import org.openwfe.gpe.model.OrComposite;
26: import org.openwfe.gpe.model.ParticipantElement;
27: import org.openwfe.gpe.model.RestoreElement;
28: import org.openwfe.gpe.model.SaveElement;
29: import org.openwfe.gpe.model.SequenceComposite;
30: import org.openwfe.gpe.model.SetElement;
31: import org.openwfe.gpe.model.SubProcessElement;
32: import org.openwfe.gpe.model.UndefinedElement;
33: import org.openwfe.gpe.model.UnsetElement;
34: import org.openwfe.gpe.model.WhenComposite;
35: import org.openwfe.gpe.model.WorkflowElement;
36:
37: /**
38: * @author Helena
39: *
40: * This Hashtable maps the model classes with the XML element names
41: */
42: public class Hashtable_Creation {
43:
44: public Map map = new HashMap();
45:
46: public Hashtable_Creation() {
47: map.put(DefinedComposite.class, DefinedComposite.name
48: .toLowerCase());
49: map
50: .put(DefinedElement.class, DefinedElement.name
51: .toLowerCase());
52: map.put(SetElement.class, SetElement.name.toLowerCase());
53: map.put(UndefinedElement.class, UndefinedElement.name
54: .toLowerCase());
55: map
56: .put(RestoreElement.class, RestoreElement.name
57: .toLowerCase());
58: map.put(LesserElement.class, LesserElement.name.toLowerCase());
59: map
60: .put(GreaterElement.class, GreaterElement.name
61: .toLowerCase());
62: map.put(EqualsElement.class, EqualsElement.name.toLowerCase());
63: map.put(SubProcessElement.class, SubProcessElement.name
64: .toLowerCase());
65: map.put(LogElement.class, LogElement.name.toLowerCase());
66: map.put(SaveElement.class, SaveElement.name.toLowerCase());
67: map.put(IncElement.class, IncElement.name.toLowerCase());
68: map.put(UnsetElement.class, UnsetElement.name.toLowerCase());
69: map.put(ParticipantElement.class, ParticipantElement.name
70: .toLowerCase());
71: map.put(NotElement.class, NotElement.name.toLowerCase());
72: map.put(IteratorElement.class, IteratorElement.name
73: .toLowerCase());
74: map.put(WhenComposite.class, WhenComposite.name.toLowerCase());
75: map.put(IfComposite.class, IfComposite.name.toLowerCase());
76: map.put(CaseComposite.class, CaseComposite.name.toLowerCase());
77: map.put(SequenceComposite.class, SequenceComposite.name
78: .toLowerCase());
79: map.put(OrComposite.class, OrComposite.name.toLowerCase());
80: map.put(AndComposite.class, AndComposite.name.toLowerCase());
81: map.put(ConcurrenceComposite.class, ConcurrenceComposite.name
82: .toLowerCase());
83: map.put(ConcurrentIteratorElement.class,
84: ConcurrentIteratorElement.name.toLowerCase());
85: map.put(WorkflowElement.class, WorkflowElement.name
86: .toLowerCase());
87: map.put(AbstractEditPart.class, "nonpasbien");
88:
89: }
90:
91: public String findElement(Object obj) {
92: String temp = "No such class in Hashtable_Creation";
93: temp = (String) map.get(obj.getClass());
94: return temp;
95:
96: }
97: }
|