1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Patrick Tassé - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.parsers
.custom
;
15 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfEventField
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfEventField
;
17 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfEventType
;
20 * Event type for custom text parsers.
22 * @author Patrick Tassé
25 public abstract class CustomEventType
extends TmfEventType
{
27 private static String CONTEXT_ID
= "CustomEventType"; //$NON-NLS-1$
35 public CustomEventType(CustomTraceDefinition definition
) {
36 super(CONTEXT_ID
, definition
.definitionName
, getRootField(definition
));
39 private static ITmfEventField
getRootField(CustomTraceDefinition definition
) {
40 ITmfEventField
[] fields
= new ITmfEventField
[definition
.outputs
.size()];
41 for (int i
= 0; i
< fields
.length
; i
++) {
42 fields
[i
] = new TmfEventField(definition
.outputs
.get(i
).name
, null, null);
44 ITmfEventField rootField
= new TmfEventField(ITmfEventField
.ROOT_FIELD_ID
, null, fields
);