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.core.ant.types;
|
|
19 |
|
|
20 |
import java.util.Vector;
|
628
|
21 |
|
587
|
22 |
import org.apache.tools.ant.types.DataType;
|
628
|
23 |
|
587
|
24 |
import com.nokia.helium.core.ant.HlmExceptionHandler;
|
628
|
25 |
import com.nokia.helium.core.ant.PostBuildAction;
|
|
26 |
import com.nokia.helium.core.ant.PreBuildAction;
|
587
|
27 |
|
|
28 |
/**
|
628
|
29 |
* HlmDefList is a class used to store the pre/post build events and the
|
|
30 |
* exception handlers.
|
587
|
31 |
*
|
628
|
32 |
* @ant.type name="deflist" category="Core"
|
587
|
33 |
*/
|
|
34 |
public class HlmDefList extends DataType {
|
|
35 |
|
628
|
36 |
private Vector<PreBuildAction> preBuildActions = new Vector<PreBuildAction>();
|
|
37 |
private Vector<PostBuildAction> postBuildActions = new Vector<PostBuildAction>();
|
|
38 |
private Vector<HlmExceptionHandler> exceptionHandlers = new Vector<HlmExceptionHandler>();
|
587
|
39 |
|
|
40 |
/**
|
628
|
41 |
* Method to add a pre/post build action or an exception handler.
|
|
42 |
*
|
|
43 |
* @param type
|
|
44 |
* is the datatype representing a pre/post build action or an
|
|
45 |
* exception handler.
|
587
|
46 |
*/
|
628
|
47 |
public void add(DataType type) {
|
|
48 |
if (type instanceof PreBuildAction) {
|
|
49 |
preBuildActions.add((PreBuildAction) type);
|
|
50 |
}
|
|
51 |
if (type instanceof PostBuildAction) {
|
|
52 |
postBuildActions.add((PostBuildAction) type);
|
|
53 |
}
|
|
54 |
if (type instanceof HlmExceptionHandler) {
|
|
55 |
exceptionHandlers.add((HlmExceptionHandler) type);
|
587
|
56 |
}
|
|
57 |
}
|
|
58 |
|
|
59 |
/**
|
628
|
60 |
* Get the list of pre build actions.
|
|
61 |
*
|
|
62 |
* @return the list of pre build actions.
|
587
|
63 |
*/
|
628
|
64 |
public Vector<PreBuildAction> getPreBuildActions() {
|
|
65 |
return preBuildActions;
|
587
|
66 |
}
|
|
67 |
|
|
68 |
/**
|
628
|
69 |
* Get the list of post build actions.
|
587
|
70 |
*
|
628
|
71 |
* @return the list of post build actions.
|
587
|
72 |
*/
|
628
|
73 |
public Vector<PostBuildAction> getPostBuildActions() {
|
|
74 |
return postBuildActions;
|
587
|
75 |
}
|
|
76 |
|
|
77 |
/**
|
628
|
78 |
* Get the list of exception handlers.
|
587
|
79 |
*
|
628
|
80 |
* @return the list of exception handlers
|
587
|
81 |
*/
|
628
|
82 |
public Vector<HlmExceptionHandler> getExceptionHandlers() {
|
|
83 |
return exceptionHandlers;
|
587
|
84 |
}
|
|
85 |
} |