01: /*
02: * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
03: *
04: * http://izpack.org/
05: * http://izpack.codehaus.org/
06: *
07: * Copyright 2007 Dennis Reil
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.rules;
23:
24: import java.io.Serializable;
25:
26: import com.izforge.izpack.installer.AutomatedInstallData;
27: import net.n3.nanoxml.XMLElement;
28:
29: /**
30: * Abstract base class for all conditions
31: *
32: * @author Dennis Reil, <Dennis.Reil@reddot.de>
33: */
34: public abstract class Condition implements Serializable {
35:
36: protected String id;
37: protected AutomatedInstallData installdata;
38:
39: public Condition() {
40: this .id = "UNKNOWN";
41: this .installdata = null;
42: }
43:
44: /**
45: * @return the id
46: */
47: public String getId() {
48: return this .id;
49: }
50:
51: /**
52: * @param id the id to set
53: */
54: public void setId(String id) {
55: this .id = id;
56: }
57:
58: public abstract void readFromXML(XMLElement xmlcondition);
59:
60: public abstract boolean isTrue();
61:
62: public AutomatedInstallData getInstalldata() {
63: return installdata;
64: }
65:
66: public void setInstalldata(AutomatedInstallData installdata) {
67: this .installdata = installdata;
68: }
69:
70: public String getDependenciesDetails() {
71: return "No dependencies for this condition.";
72: }
73: }
|