KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > izforge > izpack > CustomData


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 2004 Klaus Bartz
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;
23
24 import java.io.Serializable JavaDoc;
25 import java.util.List JavaDoc;
26
27 /**
28  * Container for serialized custom data.
29  *
30  * @author Klaus Bartz
31  */

32 public class CustomData implements Serializable JavaDoc
33 {
34
35     static final long serialVersionUID = 5504496325961965576L;
36
37     /** Identifier for custom data type "installer listener". */
38     public static final int INSTALLER_LISTENER = 0;
39
40     /** Identifier for custom data typ "uninstaller listener". */
41     public static final int UNINSTALLER_LISTENER = 1;
42
43     /**
44      * Identifier for custom data typ "uninstaller lib". This is used for binary libs (DLLs or SHLs
45      * or SOs or ...) which will be needed from the uninstaller.
46      */

47     public static final int UNINSTALLER_LIB = 2;
48
49     /** Identifier for custom data typ "uninstaller jar files". */
50     public static final int UNINSTALLER_JAR = 3;
51
52     /**
53      * The contens of the managed custom data. If it is a listener or a uninstaller jar, all
54      * contained files are listed with it complete sub path. If it is a uninstaller native library,
55      * this value is the path in the installer jar.
56      */

57     public List JavaDoc contents;
58
59     /**
60      * Full qualified name of the managed listener. If type is not a listener, this value is
61      * undefined.
62      */

63     public String JavaDoc listenerName;
64
65     /** The target operation system of this custom action */
66     public List JavaDoc osConstraints = null;
67
68     /**
69      * Type of this custom action data; possible are INSTALLER_LISTENER, UNINSTALLER_LISTENER,
70      * UNINSTALLER_LIB and UNINSTALLER_JAR.
71      */

72     public int type = 0;
73
74     /**
75      * Constructs an CustomData object with the needed values. If a listener will be managed with
76      * this object, the full qualified name of the listener self must be set as listener name. If a
77      * listener or a jar file for uninstall will be managed, all needed files (class, properties and
78      * so on) must be referenced in the contents with the path which they have in the installer jar
79      * file.
80      *
81      * @param listenerName path of the listener
82      * @param contents also needed objects referenced with the path in install.jar
83      * @param osConstraints target operation system of this custom action
84      * @param type type of this custom data
85      */

86     public CustomData(String JavaDoc listenerName, List JavaDoc contents, List JavaDoc osConstraints, int type)
87     {
88         this.listenerName = listenerName;
89         this.contents = contents;
90         this.osConstraints = osConstraints;
91         this.type = type;
92     }
93
94 }
95
Popular Tags