KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ivata > groupware > business > addressbook > telecomaddress > TelecomAddressConstants


1 /*
2  * Copyright (c) 2001 - 2005 ivata limited.
3  * All rights reserved.
4  * -----------------------------------------------------------------------------
5  * ivata groupware may be redistributed under the GNU General Public
6  * License as published by the Free Software Foundation;
7  * version 2 of the License.
8  *
9  * These programs are free software; you can redistribute them and/or
10  * modify them under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; version 2 of the License.
12  *
13  * These programs are distributed in the hope that they will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License in the file LICENSE.txt for more
18  * details.
19  *
20  * If you would like a copy of the GNU General Public License write to
21  *
22  * Free Software Foundation, Inc.
23  * 59 Temple Place - Suite 330
24  * Boston, MA 02111-1307, USA.
25  *
26  *
27  * To arrange commercial support and licensing, contact ivata at
28  * http://www.ivata.com/contact.jsp
29  * -----------------------------------------------------------------------------
30  * $Log: TelecomAddressConstants.java,v $
31  * Revision 1.2 2005/04/09 17:19:09 colinmacleod
32  * Changed copyright text to GPL v2 explicitly.
33  *
34  * Revision 1.1.1.1 2005/03/10 17:50:19 colinmacleod
35  * Restructured ivata op around Hibernate/PicoContainer.
36  * Renamed ivata groupware.
37  *
38  * Revision 1.4 2004/07/13 19:41:14 colinmacleod
39  * Moved project to POJOs from EJBs.
40  * Applied PicoContainer to services layer (replacing session EJBs).
41  * Applied Hibernate to persistence layer (replacing entity EJBs).
42  *
43  * Revision 1.3 2004/03/21 21:16:08 colinmacleod
44  * Shortened name to ivata op.
45  *
46  * Revision 1.2 2004/02/01 22:00:33 colinmacleod
47  * Added full names to author tags
48  *
49  * Revision 1.1.1.1 2004/01/27 20:57:54 colinmacleod
50  * Moved ivata openportal to SourceForge..
51  *
52  * Revision 1.3 2003/10/17 12:36:12 jano
53  * fixing problems with building
54  * converting intranet -> portal
55  * Eclipse building
56  *
57  * Revision 1.2 2003/10/15 13:18:02 colin
58  * fixing for XDoclet
59  *
60  * Revision 1.1 2003/02/24 19:09:21 colin
61  * moved to business
62  *
63  * Revision 1.3 2003/02/04 17:43:45 colin
64  * copyright notice
65  *
66  * Revision 1.2 2002/06/28 13:15:23 colin
67  * first addressbook release
68  *
69  * Revision 1.1 2002/06/17 07:28:30 colin
70  * improved and extended javadoc documentation
71  * -----------------------------------------------------------------------------
72  */

73 package com.ivata.groupware.business.addressbook.telecomaddress;
74
75
76 /**
77  * <p>Contains all constants and constant conversion in use for telecom addresses.
78  * Use these constats to get the clear text name of the telecom address type, or
79  * to find the correct type to store in the EJB.</p>
80  *
81  * @since 2002-05-14
82  * @author Colin MacLeod
83  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
84  * @version $Revision: 1.2 $
85  */

86 public class TelecomAddressConstants {
87
88     /**
89      * <p>Represents a home telephone number.</p>
90      */

91     public final static int TYPE_HOME = 0;
92
93     /**
94      * <p>Represents a work telephone number.</p>
95      */

96     public final static int TYPE_WORK = 1;
97
98     /**
99      * <p>Represents a mobile telephone number.</p>
100      */

101     public final static int TYPE_MOBILE = 2;
102
103     /**
104      * <p>Represents a fax telephone number.</p>
105      */

106     public final static int TYPE_FAX = 3;
107
108     /**
109      * <p>Represents an email address.</p>
110      */

111     public final static int TYPE_EMAIL = 4;
112
113     /**
114      * <p>Represents a web site address.</p>
115      */

116     public final static int TYPE_URL = 5;
117
118     /**
119      * <p>This is used to translate the different address types.</p>
120      *
121      * @see #getTelecomAddressTypeName( int telecomAddressType )
122      */

123     private final static String JavaDoc[ ] typeNames = {
124         "person.label.telecomaddress.home",
125         "person.label.telecomaddress.work",
126         "person.label.telecomaddress.mobile",
127         "person.label.telecomaddress.fax",
128         "person.label.telecomaddress.email",
129         "person.label.telecomaddress.uRL"};
130
131     /**
132      * <p>Tell client routines how many telecom address types there are.</p>
133      *
134      * @return the number of telecom address types.
135      */

136     public static int countTypes() {
137         return typeNames.length;
138     }
139
140     /**
141      * <p>Translates the code assigned to a a telecom address type into a text
142      * representing it.<p>
143      *
144      * @param type the numeric type to be converted into a text.
145      * @return the code assigned to a a telecom address type translated into a
146      * text representing it.
147      */

148     public final static String JavaDoc getTypeName(int type) {
149         return typeNames[type];
150     }
151 }
152
Popular Tags