KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > izforge > izpack > rules > Condition


1 /*
2  * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
3  *
4  * http://www.izforge.com/izpack/
5  * http://developer.berlios.de/projects/izpack/
6  *
7  * Copyright 2007 Dennis Reil
8  *
9  * 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 com.izforge.izpack.installer.AutomatedInstallData;
25 import net.n3.nanoxml.XMLElement;
26
27 /**
28  * Abstract base class for all conditions
29  *
30  * @author Dennis Reil, <Dennis.Reil@reddot.de>
31  */

32 public abstract class Condition
33 {
34
35     protected String JavaDoc id;
36     protected AutomatedInstallData installdata;
37
38     public Condition()
39     {
40         this.id = "UNKNOWN";
41         this.installdata = null;
42     }
43
44     /**
45      * @return the id
46      */

47     public String JavaDoc getId()
48     {
49         return this.id;
50     }
51
52
53     /**
54      * @param id the id to set
55      */

56     public void setId(String JavaDoc id)
57     {
58         this.id = id;
59     }
60
61     public abstract void readFromXML(XMLElement xmlcondition);
62
63     public abstract boolean isTrue();
64
65     public AutomatedInstallData getInstalldata()
66     {
67         return installdata;
68     }
69
70
71     public void setInstalldata(AutomatedInstallData installdata)
72     {
73         this.installdata = installdata;
74     }
75 }
76
Popular Tags