tracesrv/tracecompiler/src/com.nokia.tracecompiler/src/com/nokia/tracecompiler/decodeplugins/dictionary/encoder/Options.java
changeset 56 aa2539c91954
parent 41 838cdffd57ce
equal deleted inserted replaced
54:a151135b0cf9 56:aa2539c91954
       
     1 /*
       
     2 * Copyright (c) 2008 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 * Options
       
    17 *
       
    18 */
       
    19 package com.nokia.tracecompiler.decodeplugins.dictionary.encoder;
       
    20 
       
    21 /**
       
    22  * Options
       
    23  * 
       
    24  */
       
    25 public class Options {
       
    26 
       
    27 	/**
       
    28 	 * Writes <options>
       
    29 	 * 
       
    30 	 * @param indent
       
    31 	 *            amount of tabs for indent
       
    32 	 */
       
    33 	static void startOptions(int indent) {
       
    34 		TagWriter.write(TagWriter.OPTIONS_START, indent);
       
    35 	}
       
    36 
       
    37 	/**
       
    38 	 * Writes </options>
       
    39 	 * 
       
    40 	 * @param indent
       
    41 	 *            amount of tabs for indent
       
    42 	 */
       
    43 	static void endOptions(int indent) {
       
    44 		TagWriter.write(TagWriter.OPTIONS_END, indent);
       
    45 	}
       
    46 
       
    47 	/**
       
    48 	 * Writes user defined tags <mytagXXX>value</mytagXXX>
       
    49 	 * 
       
    50 	 * @param tag
       
    51 	 *            user defined tag
       
    52 	 * @param value
       
    53 	 *            value of the tag
       
    54 	 * @param indent
       
    55 	 *            amount of tabs for indent
       
    56 	 */
       
    57 	static void writeOptions(String tag, String value, int indent) {
       
    58 		StringBuffer sb = new StringBuffer();
       
    59 		sb.append(TagWriter.START_TAG_OPEN);
       
    60 		sb.append(tag);
       
    61 		sb.append(TagWriter.TAG_CLOSE);
       
    62 		sb.append(XMLDataFilter.changeData(value));
       
    63 		sb.append(TagWriter.END_TAG_OPEN);
       
    64 		sb.append(tag);
       
    65 		sb.append(TagWriter.TAG_CLOSE);
       
    66 		TagWriter.write(sb.toString(), indent);
       
    67 	}
       
    68 
       
    69 }