01: /*
02: * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
03: *
04: * http://izpack.org/
05: * http://izpack.codehaus.org/
06: *
07: * Copyright 2001 Johannes Lehtinen
08: *
09: * Licensed under the Apache License, Version 2.0 (the "License");
10: * you may not use this file except in compliance with the License.
11: * You may obtain a copy of the License at
12: *
13: * http://www.apache.org/licenses/LICENSE-2.0
14: *
15: * Unless required by applicable law or agreed to in writing, software
16: * distributed under the License is distributed on an "AS IS" BASIS,
17: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18: * See the License for the specific language governing permissions and
19: * limitations under the License.
20: */
21:
22: package com.izforge.izpack;
23:
24: import com.izforge.izpack.util.OsConstraint;
25:
26: import java.io.Serializable;
27: import java.util.List;
28:
29: /**
30: * Encloses information about a parsable file. This class abstracts the way the information is
31: * stored to package.
32: *
33: * @author Johannes Lehtinen <johannes.lehtinen@iki.fi>
34: */
35: public class ParsableFile implements Serializable {
36:
37: static final long serialVersionUID = -7761309341843715721L;
38:
39: /** The file path */
40: public String path = null;
41:
42: /** The file type (or null for default) */
43: public String type = null;
44:
45: /** The file encoding (or null for default) */
46: public String encoding = null;
47:
48: /** The list of OS constraints limiting file installation. */
49: public List<OsConstraint> osConstraints = null;
50:
51: /** condition for this Parsable */
52: private String condition = null;
53:
54: /**
55: * Constructs and initializes a new instance.
56: *
57: * @param path the file path
58: * @param type the file type (or null for default)
59: * @param encoding the file encoding (or null for default)
60: * @param osConstraints the OS constraint (or null for any OS)
61: */
62: public ParsableFile(String path, String type, String encoding,
63: List<OsConstraint> osConstraints) {
64: this .path = path;
65: this .type = type;
66: this .encoding = encoding;
67: this .osConstraints = osConstraints;
68: }
69:
70: /**
71: * @return the condition
72: */
73: public String getCondition() {
74: return this .condition;
75: }
76:
77: /**
78: * @param condition the condition to set
79: */
80: public void setCondition(String condition) {
81: this .condition = condition;
82: }
83:
84: public boolean hasCondition() {
85: return this.condition != null;
86: }
87:
88: }
|