587
|
1 |
/*
|
628
|
2 |
* Copyright (c) 2007-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 the License "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 |
*/
|
587
|
17 |
|
|
18 |
package com.nokia.helium.signal.ant.types;
|
|
19 |
|
628
|
20 |
import java.util.Vector;
|
|
21 |
|
|
22 |
import org.apache.tools.ant.taskdefs.condition.Condition;
|
587
|
23 |
import org.apache.tools.ant.types.DataType;
|
|
24 |
|
|
25 |
/**
|
628
|
26 |
* TargetCondition class which is a type to store the condition for generating Signals..
|
|
27 |
* <targetCondition> <hasSeverity severity="error"
|
|
28 |
* file="${build.cache.log.dir}/signals/prep_work_status.xml" /> </targetCondition>
|
587
|
29 |
*/
|
|
30 |
public class TargetCondition extends DataType {
|
|
31 |
|
|
32 |
private String name;
|
628
|
33 |
|
587
|
34 |
private String errMsg;
|
628
|
35 |
|
587
|
36 |
private Vector<Condition> conditionList = new Vector<Condition>();
|
|
37 |
|
|
38 |
/**
|
628
|
39 |
* Helper function to store the Name of the target for which the signal to be processed.
|
|
40 |
*
|
587
|
41 |
* @param targetName to be stored.
|
628
|
42 |
*/
|
587
|
43 |
public void setName(String targetName) {
|
|
44 |
name = targetName;
|
|
45 |
}
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Helper function to store the error message of
|
628
|
49 |
*
|
587
|
50 |
* @param errorMessage to be displayed after failure.
|
628
|
51 |
*/
|
587
|
52 |
public void setMessage(String errorMessage) {
|
|
53 |
errMsg = errorMessage;
|
|
54 |
}
|
628
|
55 |
|
587
|
56 |
/**
|
628
|
57 |
* Add a given variable to the list
|
|
58 |
*
|
587
|
59 |
* @param condition variable to add
|
|
60 |
*/
|
|
61 |
public void add(Condition condition) {
|
|
62 |
conditionList.add(condition);
|
|
63 |
}
|
|
64 |
|
|
65 |
/**
|
628
|
66 |
* Gets the list of conditions to be checked for the signal config.
|
|
67 |
*
|
587
|
68 |
* @return conditions variable for this configuration.
|
|
69 |
*/
|
|
70 |
public Vector<Condition> getConditions() {
|
|
71 |
return conditionList;
|
628
|
72 |
}
|
|
73 |
|
587
|
74 |
/**
|
628
|
75 |
* Helper function to return the Name of the target for which the signal to be processed.
|
|
76 |
*
|
587
|
77 |
* @return name of the target of this targetcondition.
|
|
78 |
* @deprecated
|
628
|
79 |
*/
|
587
|
80 |
public String getName() {
|
628
|
81 |
return name;
|
587
|
82 |
}
|
|
83 |
|
|
84 |
/**
|
|
85 |
* Helper function to return the error message of this target condition.
|
628
|
86 |
*
|
587
|
87 |
* @return error message of this target condition.
|
|
88 |
* @deprecated
|
628
|
89 |
*/
|
587
|
90 |
public String getMessage() {
|
|
91 |
return errMsg;
|
|
92 |
}
|
628
|
93 |
}
|