KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > core > CTCap


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19
20 package sync4j.framework.core;
21
22 import java.util.*;
23
24 /**
25  * This class corresponds to the <CTCap> tag in the SyncML devinf DTD
26  *
27  * @author Stefano Fornari @ Funambol
28  *
29  * @version $Id: CTCap.java,v 1.4 2005/03/02 20:57:37 harrie Exp $
30  */

31 public final class CTCap
32 implements java.io.Serializable JavaDoc {
33
34     // ------------------------------------------------------------ Private data
35
private ArrayList ctTypeSupported = new ArrayList();
36
37     // ------------------------------------------------------------ Constructors
38
/**
39      * In order to expose the server configuration like WS this constructor
40      * must be public
41      */

42     public CTCap() {}
43
44     /**
45      * Creates a new CTCap object with the given array of information
46      *
47      * @param ctTypeSupported the array of information on content type
48      * capabilities - NOT NULL
49      *
50      */

51     public CTCap(final CTTypeSupported[] ctTypeSupported) {
52         setCTTypeSupported(ctTypeSupported);
53     }
54
55     // ---------------------------------------------------------- Public methods
56

57     /**
58      * Get an array of content type information objects
59      *
60      * @return an array of content type information objects
61      */

62     public ArrayList getCTTypeSupported() {
63         return this.ctTypeSupported;
64     }
65
66     /**
67      * Sets an array of content type information objects
68      *
69      * @param ctTypeSupported an array of content type information objects
70      */

71     public void setCTTypeSupported(CTTypeSupported[] ctTypeSupported) {
72
73         if (ctTypeSupported == null || ctTypeSupported.length == 0) {
74             throw new IllegalArgumentException JavaDoc("ctTypeSupported cannot be null");
75         }
76         this.ctTypeSupported.clear();
77         this.ctTypeSupported.addAll(Arrays.asList(ctTypeSupported));
78     }
79 }
Popular Tags