Tried to fix EDKT149. Since the issue happened randomly, only long time test can...
[mirror_edk2.git] / Tools / Source / FrameworkTasks / org / tianocore / framework / tasks / IncludePath.java
CommitLineData
878ddf1f 1/** @file\r
2This file is used to nest elements which is meant for include path name\r
3\r
4Copyright (c) 2006, Intel Corporation\r
5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15package org.tianocore.framework.tasks;\r
16\r
17import java.io.File;\r
18import java.util.ArrayList;\r
19import java.util.List;\r
20import java.util.StringTokenizer;\r
21\r
22public class IncludePath implements NestElement {\r
23 /**\r
24 IncludePath nested element Class\r
25 class member\r
26 -name : name of include path \r
27 -file : name of file including include path\r
28 **/\r
29 private String path = "";\r
30 private File file;\r
31 private List<String> nameList = new ArrayList<String>();\r
32 \r
33 /**\r
34 get class member "file"\r
35\r
36 @returns The File object\r
37 **/\r
38 public File getFile() {\r
39 return this.file;\r
40 }\r
41\r
42 /**\r
43 set class member "file"\r
44\r
45 @param file The name of include path\r
46 **/\r
47 public void setFile(File file) {\r
48 this.file = file;\r
49 }\r
50 \r
51 /**\r
52 get class member "file"\r
53\r
54 @returns The name of include path\r
55 **/\r
56 public String getPath() {\r
57 return this.path;\r
58 }\r
59 \r
60 /**\r
61 get class member "name"\r
62\r
63 @returns The name of include path\r
64 **/\r
65 public String getName() {\r
66 return this.path;\r
67 }\r
68 \r
69 /**\r
70 set class member "name"\r
71\r
72 @param name The name of include path\r
73 **/\r
74 public void setName(String name){\r
f496b9b5 75 this.path = " -I " + name;\r
878ddf1f 76 }\r
77\r
78 /**\r
79 set class member "path"\r
80\r
81 @param name name of file including include paths \r
82 **/\r
83 public void setPath(String name) {\r
84 this.path = " -I " + name;\r
85 }\r
86\r
87 /**\r
88 override Object.toString()\r
89\r
90 @returns name of file including include paths \r
91 **/\r
92 public String toString() {\r
93 return getPath();\r
94 }\r
95 \r
96 /**\r
97 set class member "list"\r
98\r
99 @param fileNameList name list of include paths, sperated by space, tab,\r
100 comma or semi-comma\r
101 **/\r
102 public void setList(String fileNameList) {\r
103 if (fileNameList != null && fileNameList.length() > 0) {\r
104 StringTokenizer tokens = new StringTokenizer(fileNameList, " \t,;", false);\r
105 while (tokens.hasMoreTokens()) {\r
106 String fileName = tokens.nextToken().trim();\r
107 if (fileName.length() > 0) {\r
108 this.nameList.add(fileName);\r
109 }\r
110 }\r
111 }\r
112 }\r
113\r
114 /**\r
115 get class member "list"\r
116\r
117 @returns The include paths list.\r
118 **/\r
119 public List<String> getList() {\r
120 return nameList;\r
121 }\r
122}\r
123\r