]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/InputFile.java
Fixed EDKT102;
[mirror_edk2.git] / Tools / Source / FrameworkTasks / org / tianocore / framework / tasks / InputFile.java
1 /** @file
2 This file is used to nest elements which is meant for specifying files
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14 package org.tianocore.framework.tasks;
15
16 import java.io.File;
17 import java.util.ArrayList;
18 import java.util.List;
19 import java.util.StringTokenizer;
20
21 public class InputFile implements NestElement {
22 /**
23 InputFile nested element Class
24 class member
25 -name : name of input file
26 -file : name of file including input files
27 **/
28 private String name = "";
29 private File file;
30 private List<String> nameList = new ArrayList<String>();
31
32 /**
33 get class member "name"
34 @returns name parameter
35 **/
36 public String getName() {
37 return this.name;
38 }
39
40 /**
41 set class member "name"
42 @param name name of input file
43 **/
44 public void setName(String name) {
45 this.name = " " + name;
46 }
47
48 public String toString() {
49 return getName();
50 }
51
52 /**
53 get class member "file"
54 @returns file parameter
55 **/
56 public File getFile() {
57 return this.file;
58 }
59
60 /**
61 set class member "file"
62 @param ext name of file including input files
63 **/
64 public void setFile(File file) {
65 this.file = file;
66 }
67
68 /**
69 set class member "list"
70
71 @param fileNameList name list of include paths, sperated by space, tab,
72 comma or semi-comma
73 **/
74 public void setList(String fileNameList) {
75 if (fileNameList != null && fileNameList.length() > 0) {
76 StringTokenizer tokens = new StringTokenizer(fileNameList, " \t,;", false);
77 while (tokens.hasMoreTokens()) {
78 String fileName = tokens.nextToken().trim();
79 if (fileName.length() > 0) {
80 this.nameList.add(fileName);
81 }
82 }
83 }
84 }
85
86 /**
87 get class member "list"
88
89 @returns The include paths list.
90 **/
91 public List<String> getList() {
92 return nameList;
93 }
94 }
95