tracesrv/tracecompiler/src/com.nokia.tracecompiler/src/com/nokia/tracecompiler/engine/rules/TraceFormatRuleBase.java
changeset 56 aa2539c91954
equal deleted inserted replaced
54:a151135b0cf9 56:aa2539c91954
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 * Implementation of formatting rule
       
    17 *
       
    18 */
       
    19 package com.nokia.tracecompiler.engine.rules;
       
    20 
       
    21 import com.nokia.tracecompiler.engine.source.TraceFormattingRule;
       
    22 import com.nokia.tracecompiler.model.Trace;
       
    23 import com.nokia.tracecompiler.project.TraceProjectAPI;
       
    24 
       
    25 /**
       
    26  * Base class for project API's. Instance of this is added to the model and
       
    27  * affect all traces which do not have their own formatter.
       
    28  * 
       
    29  */
       
    30 public abstract class TraceFormatRuleBase extends RuleBase implements
       
    31 		TraceFormattingRule, TraceProjectAPI {
       
    32 
       
    33 	/*
       
    34 	 * (non-Javadoc)
       
    35 	 * 
       
    36 	 * @see com.nokia.tracecompiler.engine.source.TraceFormattingRule#
       
    37 	 *      mapNameToSource(com.nokia.tracecompiler.model.Trace)
       
    38 	 */
       
    39 	public String mapNameToSource(Trace trace) {
       
    40 		return trace.getName();
       
    41 	}
       
    42 
       
    43 	/*
       
    44 	 * (non-Javadoc)
       
    45 	 * 
       
    46 	 * @see com.nokia.tracecompiler.engine.source.TraceFormattingRule#
       
    47 	 *      mapParameterCountToSource(com.nokia.tracecompiler.model.Trace, int)
       
    48 	 */
       
    49 	public String mapParameterCountToSource(Trace trace, int count) {
       
    50 		return String.valueOf(count);
       
    51 	}
       
    52 
       
    53 }