KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
23  * This class represents the <Target> element as defined by the SyncML
24  * representation specifications
25  *
26  * @author Stefano Fornari @ Funambol
27  *
28  * @version $Id: Target.java,v 1.3 2005/03/02 20:57:37 harrie Exp $
29  */

30 public final class Target
31 implements java.io.Serializable JavaDoc {
32     
33     // ------------------------------------------------------------ Private data
34

35     private String JavaDoc locURI;
36     private String JavaDoc locName;
37
38     // ------------------------------------------------------------ Constructors
39

40     /**
41      * For serialization purposes
42      */

43     protected Target() {}
44
45     /**
46      * Creates a new Target object with the given locURI and locName
47      *
48      * @param locURI the locURI - NOT NULL
49      * @param locName the locName - NULL
50      *
51      */

52     public Target( final String JavaDoc locURI, final String JavaDoc locName) {
53         setLocURI(locURI);
54         this.locName = locName;
55     }
56
57     /**
58      * Creates a new Target object with the given locURI
59      *
60      * @param locURI the locURI - NOT NULL
61      *
62      */

63     public Target(final String JavaDoc locURI) {
64         this(locURI, null);
65     }
66
67     // ---------------------------------------------------------- Public methods
68

69     /** Gets locURI properties
70      * @return locURI properties
71      */

72     public String JavaDoc getLocURI() {
73         return locURI;
74     }
75
76     /**
77      * Sets locURI property
78      * @param locURI the locURI
79      */

80     public void setLocURI(String JavaDoc locURI) {
81         if (locURI == null) {
82             throw new IllegalArgumentException JavaDoc("locURI cannot be null");
83         }
84         this.locURI = locURI;
85     }
86
87     /**
88      * Gets locName properties
89      * @return locName properties
90      */

91     public String JavaDoc getLocName() {
92         return locName;
93     }
94
95     /**
96      * Sets locName property
97      * @param locName the locURI
98      */

99     public void setLocName(String JavaDoc locName) {
100         this.locName = locName;
101     }
102 }
Popular Tags