]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Java/Source/PcdTools/org/tianocore/pcd/action/BuildAction.java
Restructuring for better separation of Tool packages.
[mirror_edk2.git] / Tools / Java / Source / PcdTools / org / tianocore / pcd / action / BuildAction.java
1 /** @file
2 BuildAction class.
3
4 BuildAction is the parent class for all action related to ant Task. This class will
5 define some common utility functionality, such as logMsg, warningMsg..etc.
6
7 Copyright (c) 2006, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 **/
17 package org.tianocore.pcd.action;
18
19 import org.apache.tools.ant.Task;
20 import org.apache.tools.ant.Project;
21 import org.tianocore.pcd.exception.BuildActionException;
22
23 /** BuildAction is the parent class for all action related to ant Task. This class will
24 define some common utility functionality, such as logMsg, warningMsg..etc.
25 **/
26 public abstract class BuildAction extends Task {
27 ///
28 /// Original message level before this action. This value will
29 /// be restored when quit this action.
30 ///
31 private int originalMessageLevel;
32
33 /**
34 checkParameter function check all parameter valid.
35
36 This function will be overrided by child class.
37 **/
38 public abstract void checkParameter() throws BuildActionException;
39
40 /**
41 performAction is to execute the detail action.
42
43 This function will be overrided by child class.
44 **/
45 public abstract void performAction() throws BuildActionException;
46
47 /**
48 execute function is the main flow for all build action class.
49
50 This workflow will be:
51 1) Check paramet of this action.
52 2) Perform the child class action function.
53 3) Restore the message level.
54
55 @throws BuildActionException
56 **/
57 public void execute() throws BuildActionException {
58 checkParameter();
59 performAction();
60 }
61 }