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