KickJava   Java API By Example, From Geeks To Geeks.

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


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 <CTType> tag in the SyncML devinf DTD
26  *
27  * @see CTCap
28  * @author Stefano Fornari @ Funambol
29  *
30  * @version $Id: CTType.java,v 1.1 2005/05/16 17:32:54 nichele Exp $
31  */

32 public final class CTType
33 implements java.io.Serializable JavaDoc {
34     
35     // ------------------------------------------------------------ Private data
36
private String JavaDoc ctType;
37
38     // ------------------------------------------------------------ Constructors
39
/** For serialization purposes */
40     protected CTType() {}
41
42     /**
43      * Creates a new CTType object with the given content type and an array
44      * of content type properties
45      *
46      * @param ctType the content type - NOT NULL
47      *
48      */

49     public CTType(final String JavaDoc ctType) {
50         setCTType(ctType);
51     }
52
53     // ---------------------------------------------------------- Public methods
54

55     /**
56      * Gets the content type property
57      *
58      * @return the content type property
59      */

60     public String JavaDoc getCTType(){
61         return ctType;
62     }
63     
64     /**
65      * Sets an array of CTType object
66      *
67      * @param ctTypes an array of CTType object
68      */

69     public void setCTType(String JavaDoc ctType) {
70         if (ctType == null || ctType.length() == 0) {
71             throw new IllegalArgumentException JavaDoc("ctType cannot be null");
72         }
73         this.ctType = ctType;
74     }
75 }
Popular Tags