Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: bcc275c4a8b4ab2acf5fb89bd414add815249f44 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*******************************************************************************
 * Copyright (c) 2004 Red Hat, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Keith Seitz <keiths@redhat.com> - initial API and implementation
 *******************************************************************************/ 
package org.eclipse.linuxtools.internal.oprofile.core.opxml.info;

import java.util.HashMap;

import org.eclipse.linuxtools.internal.oprofile.core.daemon.OpInfo;
import org.eclipse.linuxtools.internal.oprofile.core.opxml.OprofileSAXHandler;
import org.eclipse.linuxtools.internal.oprofile.core.opxml.XMLProcessor;

/**
 * XML handler class for opxml's "defaults".
 * @see org.eclipse.linuxtools.internal.oprofile.core.opxml.OpxmlRunner
 */
public class DefaultsProcessor extends XMLProcessor {
	// XML tags reconize by this processor (public)
	public static final String SAMPLE_DIR = "sample-dir"; //$NON-NLS-1$
	public static final String LOCK_FILE = "lock-file"; //$NON-NLS-1$
	public static final String LOG_FILE = "log-file"; //$NON-NLS-1$
	public static final String DUMP_STATUS = "dump-status"; //$NON-NLS-1$
	protected HashMap<String,String> _map = new HashMap<String,String>();

	/**
	 * @see org.eclipse.linuxtools.internal.oprofile.core.XMLProcessor#reset()
	 */
	public void reset(Object callData) {
		_map.clear();
	}

	/* (non-Javadoc)
	 * @see org.eclipse.linuxtools.internal.oprofile.core.opxml.XMLProcessor#endElement(java.lang.String, java.lang.Object)
	 */
	public void endElement(String name, Object callData) {
		if (name.equals(OpInfoProcessor.DEFAULTS_TAG)) {
			OpInfo info = (OpInfo) callData;
			info.setDefaults(_map);
			OprofileSAXHandler.getInstance(callData).pop(name);
		} else {
			_map.put(name, characters);
		}
	}
}

Back to the top