source: trunk/autoquest-plugin-mfc/src/main/java/de/ugoe/cs/autoquest/plugin/mfc/MessageHandler.java @ 1028

Last change on this file since 1028 was 1028, checked in by fglaser, 12 years ago
  • The MFCLogParser has been adapted to the new generic GUIElementTree
File size: 2.6 KB
RevLine 
[927]1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
[922]15package de.ugoe.cs.autoquest.plugin.mfc;
[1]16
[1006]17import de.ugoe.cs.autoquest.eventcore.guimodel.GUIElementTree;
[619]18
[171]19/**
20 * <p>
[619]21 * Base class to define custom message handlers, for messages that shall be handled differently
22 * during the parsing of usage logs. It provides dummy implementations for all required methods,
23 * such that implementations can only overwrite the parts they actually require and ignore the rest.
[171]24 * </p>
25 *
26 * @author Steffen Herbold
[1006]27 * @author Fabian Glaser
[171]28 * @version 1.0
29 */
30public class MessageHandler {
[1]31
[619]32    /**
33     * <p>
34     * during parsing, a tree of GUI elements is created and adapted.
35     * This is the reference to it.
36     * </p>
37     */
[1028]38    private GUIElementTree<Long> guiElementTree;
[171]39
[619]40    /**
41     * <p>
42     * Constructor. Protected to prohibit initialization of the base class itself.
43     * </p>
44     *
[1006]45     * @param guiElementTree the tree of GUI element specifications to be created and adapted during
[619]46     *                   parsing
47     */
[1028]48    protected MessageHandler(GUIElementTree<Long> guiElementTree) {
[1006]49        this.guiElementTree = guiElementTree;
[619]50    }
[171]51
[619]52    /**
53     * <p>
54     * Called in the startElement() method of the {@link MFCLogParser} when a msg-node begins.
55     * </p>
56     */
57    public void onStartElement() {}
[171]58
[619]59    /**
60     * <p>
61     * Called by the {@link MFCLogParser} to handle param-nodes.
62     * </p>
63     *
64     * @param name
65     *            name (type) of the parameter
66     * @param value
67     *            value of the parameter
68     */
69    public void onParameter(String name, String value) {}
70
71    /**
72     * <p>
73     * Called in the endElement() method of {@link MFCLogParser} when a msg-node ends.
74     * </p>
75     */
76    public void onEndElement() {}
77
78    /**
[1006]79     * @return the gui element tree created and adapted during parsing
[619]80     */
[1028]81    protected GUIElementTree<Long> getGUIElementTree() {
[1006]82        return guiElementTree;
[619]83    }
84   
[1]85}
Note: See TracBrowser for help on using the repository browser.