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 |
|
18 |
|
19 package com.nokia.helium.diamonds; |
|
20 |
|
21 /** |
|
22 * Helper class for the target in diamonds config. |
|
23 * |
|
24 */ |
|
25 public class Target { |
|
26 private String targetName; |
|
27 private String source; |
|
28 private boolean reqAntProperties; |
|
29 private boolean defer; |
|
30 private String templatefile; |
|
31 |
|
32 /** |
|
33 * Constructor |
|
34 * |
|
35 * @param target |
|
36 * - name of the target |
|
37 * @param src |
|
38 * - input source location. |
|
39 */ |
|
40 public Target(String target, String src) { |
|
41 this(target, null, src, "false", "false"); |
|
42 } |
|
43 |
|
44 /** |
|
45 * Constructor |
|
46 * |
|
47 * @param target |
|
48 * - name of the target |
|
49 * @param src |
|
50 * - input source location. |
|
51 * @param antProps |
|
52 * - boolean to pass ant properties while conversion. |
|
53 */ |
|
54 public Target(String target, String tplfile, String src, String antProps, |
|
55 String deferSend) { |
|
56 String emptyString = ""; |
|
57 if (!target.equals(emptyString)) { |
|
58 targetName = target; |
|
59 } |
|
60 if (!src.equals(emptyString)) { |
|
61 source = src; |
|
62 } |
|
63 if (!tplfile.equals(emptyString)) { |
|
64 templatefile = tplfile; |
|
65 } |
|
66 if (antProps != null && antProps.equals("true")) { |
|
67 reqAntProperties = true; |
|
68 } |
|
69 if (deferSend != null && deferSend.equals("true")) { |
|
70 defer = true; |
|
71 } |
|
72 } |
|
73 |
|
74 /** |
|
75 * Get the target name of the target to send data |
|
76 * |
|
77 * @return - target name of the target to send data |
|
78 */ |
|
79 public String getTargetName() { |
|
80 return targetName; |
|
81 } |
|
82 |
|
83 /** |
|
84 * Get the input source used for template conversion. |
|
85 * |
|
86 * @return - location of the input source. |
|
87 */ |
|
88 public String getSource() { |
|
89 return source; |
|
90 } |
|
91 |
|
92 public boolean isDefer() { |
|
93 return defer; |
|
94 } |
|
95 |
|
96 public String getTemplateFile() { |
|
97 return templatefile; |
|
98 } |
|
99 |
|
100 /** |
|
101 * returns true if ant properties required for conversion, obtained from |
|
102 * configuration. |
|
103 * |
|
104 * @return - name of the stage |
|
105 */ |
|
106 public boolean isAntPropertiesRequired() { |
|
107 return reqAntProperties; |
|
108 } |
|
109 } |
|