1 /* |
|
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 */ |
|
17 package com.nokia.helium.logger.ant.types; |
|
18 |
|
19 import org.apache.tools.ant.types.DataType; |
|
20 |
|
21 |
|
22 /** |
|
23 * A <code>Stage</code> is a Data type which stores Stage information. |
|
24 * |
|
25 * <p> |
|
26 * A Stage is defined by setting three attributes name, start and end targets, both should be a |
|
27 * valid target name in the project. |
|
28 * |
|
29 * <p> |
|
30 * Usage: |
|
31 * |
|
32 * <pre> |
|
33 * <hlm:stage id="preparation" starttarget="stagetest" endtarget="stagetest"/> |
|
34 * </pre> |
|
35 * |
|
36 * @ant.task name="stage" category="Logging" |
|
37 * |
|
38 */ |
|
39 public class Stage extends DataType { |
|
40 |
|
41 private String startTarget; |
|
42 private String endTarget; |
|
43 |
|
44 public Stage() { |
|
45 |
|
46 } |
|
47 /** |
|
48 * Get the starting point of this {@link Stage}. |
|
49 * |
|
50 * @return the starting point of this {@link Stage}. |
|
51 */ |
|
52 public String getStartTarget() { |
|
53 return this.startTarget; |
|
54 } |
|
55 |
|
56 /** |
|
57 * Set the starting target. |
|
58 * |
|
59 * @param start |
|
60 * is the starting point to set. |
|
61 * @ant.required |
|
62 */ |
|
63 public void setStartTarget(String startTarget) { |
|
64 this.startTarget = startTarget; |
|
65 } |
|
66 |
|
67 /** |
|
68 * Get the end point of this {@link Stage}. |
|
69 * |
|
70 * @return the end point of this {@link Stage}. |
|
71 * |
|
72 */ |
|
73 public String getEndTarget() { |
|
74 return this.endTarget; |
|
75 } |
|
76 |
|
77 /** |
|
78 * Set the end target. |
|
79 * |
|
80 * @param end |
|
81 * is the end point to set. |
|
82 * @ant.required |
|
83 */ |
|
84 public void setEndTarget(String endTarget) { |
|
85 this.endTarget = endTarget; |
|
86 } |
|
87 |
|
88 /** |
|
89 * Check is the start target set to current target. |
|
90 * @param target |
|
91 * @return |
|
92 */ |
|
93 public boolean isStartTarget( String target ) { |
|
94 return this.startTarget.equals( target ); |
|
95 } |
|
96 |
|
97 /** Check is the end target set to current target. |
|
98 * |
|
99 * @param target |
|
100 * @return |
|
101 */ |
|
102 public boolean isEndTarget( String target ) { |
|
103 return this.endTarget.equals( target ); |
|
104 } |
|
105 |
|
106 } |
|