[619] | 1 |
|
---|
[434] | 2 | package de.ugoe.cs.quest.plugin.mfc;
|
---|
[1] | 3 |
|
---|
[619] | 4 | import de.ugoe.cs.quest.plugin.mfc.guimodel.WindowTree;
|
---|
| 5 |
|
---|
[171] | 6 | /**
|
---|
| 7 | * <p>
|
---|
[619] | 8 | * Base class to define custom message handlers, for messages that shall be handled differently
|
---|
| 9 | * during the parsing of usage logs. It provides dummy implementations for all required methods,
|
---|
| 10 | * such that implementations can only overwrite the parts they actually require and ignore the rest.
|
---|
[171] | 11 | * </p>
|
---|
| 12 | *
|
---|
| 13 | * @author Steffen Herbold
|
---|
| 14 | * @version 1.0
|
---|
| 15 | */
|
---|
| 16 | public class MessageHandler {
|
---|
[1] | 17 |
|
---|
[619] | 18 | /**
|
---|
| 19 | * <p>
|
---|
| 20 | * during parsing, a tree of GUI elements is created and adapted.
|
---|
| 21 | * This is the reference to it.
|
---|
| 22 | * </p>
|
---|
| 23 | */
|
---|
| 24 | private WindowTree windowTree;
|
---|
[171] | 25 |
|
---|
[619] | 26 | /**
|
---|
| 27 | * <p>
|
---|
| 28 | * Constructor. Protected to prohibit initialization of the base class itself.
|
---|
| 29 | * </p>
|
---|
| 30 | *
|
---|
| 31 | * @param windowTree the tree of GUI element specifications to be created and adapted during
|
---|
| 32 | * parsing
|
---|
| 33 | */
|
---|
| 34 | protected MessageHandler(WindowTree windowTree) {
|
---|
| 35 | this.windowTree = windowTree;
|
---|
| 36 | }
|
---|
[171] | 37 |
|
---|
[619] | 38 | /**
|
---|
| 39 | * <p>
|
---|
| 40 | * Called in the startElement() method of the {@link MFCLogParser} when a msg-node begins.
|
---|
| 41 | * </p>
|
---|
| 42 | */
|
---|
| 43 | public void onStartElement() {}
|
---|
[171] | 44 |
|
---|
[619] | 45 | /**
|
---|
| 46 | * <p>
|
---|
| 47 | * Called by the {@link MFCLogParser} to handle param-nodes.
|
---|
| 48 | * </p>
|
---|
| 49 | *
|
---|
| 50 | * @param name
|
---|
| 51 | * name (type) of the parameter
|
---|
| 52 | * @param value
|
---|
| 53 | * value of the parameter
|
---|
| 54 | */
|
---|
| 55 | public void onParameter(String name, String value) {}
|
---|
| 56 |
|
---|
| 57 | /**
|
---|
| 58 | * <p>
|
---|
| 59 | * Called in the endElement() method of {@link MFCLogParser} when a msg-node ends.
|
---|
| 60 | * </p>
|
---|
| 61 | */
|
---|
| 62 | public void onEndElement() {}
|
---|
| 63 |
|
---|
| 64 | /**
|
---|
| 65 | * @return the window tree created and adapted during parsing
|
---|
| 66 | */
|
---|
| 67 | protected WindowTree getWindowTree() {
|
---|
| 68 | return windowTree;
|
---|
| 69 | }
|
---|
| 70 |
|
---|
[1] | 71 | }
|
---|