KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > configurator > SitePolicy


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.update.internal.configurator;
12
13 import org.eclipse.update.configurator.*;
14 import org.eclipse.update.configurator.IPlatformConfiguration.*;
15
16
17 public class SitePolicy implements IPlatformConfiguration.ISitePolicy {
18
19     private int type;
20     private String JavaDoc[] list;
21
22     public SitePolicy() {
23     }
24     public SitePolicy(int type, String JavaDoc[] list) {
25         if (type != ISitePolicy.USER_INCLUDE && type != ISitePolicy.USER_EXCLUDE && type != ISitePolicy.MANAGED_ONLY)
26             throw new IllegalArgumentException JavaDoc();
27         this.type = type;
28
29         if (list == null)
30             this.list = new String JavaDoc[0];
31         else
32             this.list = list;
33     }
34
35     /*
36      * @see ISitePolicy#getType()
37      */

38     public int getType() {
39         return type;
40     }
41
42     /*
43     * @see ISitePolicy#getList()
44     */

45     public String JavaDoc[] getList() {
46         return list;
47     }
48
49     /*
50      * @see ISitePolicy#setList(String[])
51      */

52     public synchronized void setList(String JavaDoc[] list) {
53         if (list == null)
54             this.list = new String JavaDoc[0];
55         else
56             this.list = list;
57     }
58
59 }
60
Popular Tags