buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/TargetCondition.java
author wbernard
Fri, 13 Aug 2010 14:59:05 +0300
changeset 628 7c4a911dc066
parent 587 85df38eb4012
child 645 b8d81fa19e7d
permissions -rw-r--r--
helium_11.0.0-e00f171ca185
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
/*
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
     2
 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
     3
 * All rights reserved.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
     4
 * This component and the accompanying materials are made available
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
     6
 * which accompanies this distribution, and is available
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
     8
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
     9
 * Initial Contributors:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    10
 * Nokia Corporation - initial contribution.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    11
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    12
 * Contributors:
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    13
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    14
 * Description:  
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    15
 *
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    16
 */
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
package com.nokia.helium.signal.ant.types;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    20
import java.util.Vector;
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    21
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    22
import org.apache.tools.ant.taskdefs.condition.Condition;
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
import org.apache.tools.ant.types.DataType;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
/**
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    26
 * TargetCondition class which is a type to store the condition for generating Signals..
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    27
 * <targetCondition> <hasSeverity severity="error"
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    28
 * file="${build.cache.log.dir}/signals/prep_work_status.xml" /> </targetCondition>
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
 */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
public class TargetCondition extends DataType {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
    private String name;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    33
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
    private String errMsg;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    35
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
    private Vector<Condition> conditionList = new Vector<Condition>();
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
    /**
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    39
     * Helper function to store the Name of the target for which the signal to be processed.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    40
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
     * @param targetName to be stored.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    42
     */
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
    public void setName(String targetName) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
        name = targetName;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
    /**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
     * Helper function to store the error message of
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    49
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
     * @param errorMessage to be displayed after failure.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    51
     */
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
    public void setMessage(String errorMessage) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
        errMsg = errorMessage;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    55
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
    /**
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    57
     * Add a given variable to the list
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    58
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
     * @param condition variable to add
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
     */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
    public void add(Condition condition) {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
        conditionList.add(condition);
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
    /**
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    66
     * Gets the list of conditions to be checked for the signal config.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    67
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
     * @return conditions variable for this configuration.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
     */
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
    public Vector<Condition> getConditions() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
        return conditionList;
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    72
    }
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    73
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
    /**
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    75
     * Helper function to return the Name of the target for which the signal to be processed.
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    76
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    77
     * @return name of the target of this targetcondition.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    78
     * @deprecated
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    79
     */
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
    public String getName() {
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    81
        return name;        
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
    }
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    84
    /**
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    85
     * Helper function to return the error message of this target condition.
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    86
     * 
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    87
     * @return error message of this target condition.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    88
     * @deprecated
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    89
     */
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    90
    public String getMessage() {
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
        return errMsg;
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
    }
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 587
diff changeset
    93
}