Source Code Cross Referenced for Utils.java in  » 6.0-JDK-Modules » j2me » com » sun » j2me » payment » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.j2me.payment 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *   
003:         *
004:         * Copyright  1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006:         * 
007:         * This program is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU General Public License version
009:         * 2 only, as published by the Free Software Foundation.
010:         * 
011:         * This program is distributed in the hope that it will be useful, but
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * General Public License version 2 for more details (a copy is
015:         * included at /legal/license.txt).
016:         * 
017:         * You should have received a copy of the GNU General Public License
018:         * version 2 along with this work; if not, write to the Free Software
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA
021:         * 
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023:         * Clara, CA 95054 or visit www.sun.com if you need additional
024:         * information or have any questions.
025:         */
026:
027:        package com.sun.j2me.payment;
028:
029:        import java.io.InputStream;
030:        import java.io.IOException;
031:        import java.io.UnsupportedEncodingException;
032:
033:        import com.sun.midp.util.Properties;
034:
035:        /**
036:         * This class provides utility methods. They are implemented in a subclass
037:         * of this class. An instance of it can be obtained from the payment module.
038:         * <p>
039:         * This approach allows the <code>com.sun.j2me.payment</code> package to be 
040:         * more independent on MIDP classes.
041:         *
042:         * @version 1.2
043:         */
044:        public abstract class Utils {
045:            /** The starting value of the resource keys. */
046:            public static final int PAYMENT_ID_BASE = 0x02290000;
047:
048:            // JSR229 Payment resource strings 0x02290000 - 0x02290021
049:            /** Resource string. never */
050:            public static final int PAYMENT_PROV_SEL_DLG_NEVER = PAYMENT_ID_BASE + 0;
051:            /** Resource string. No */
052:            public static final int PAYMENT_PROV_SEL_DLG_NO = PAYMENT_ID_BASE + 1;
053:            /** Resource string. Yes */
054:            public static final int PAYMENT_PROV_SEL_DLG_YES = PAYMENT_ID_BASE + 2;
055:            /** Resource string. Update */
056:            public static final int PAYMENT_PROV_SEL_DLG_UPDATE = PAYMENT_ID_BASE + 3;
057:            /** Resource string. Stop */
058:            public static final int PAYMENT_UPDATE_DLG_STOP = PAYMENT_ID_BASE + 4;
059:            /** Resource string. Updating payment information... */
060:            public static final int PAYMENT_UPDATE_DLG_CAPTION = PAYMENT_ID_BASE + 5;
061:            /** Resource string. Pay by */
062:            public static final int PAYMENT_PROV_SEL_DLG_PAY_BY = PAYMENT_ID_BASE + 6;
063:            /** Resource string. Update date: */
064:            public static final int PAYMENT_PROV_SEL_DLG_UPDATE_DATE = PAYMENT_ID_BASE + 7;
065:            /** Resource string. Update stamp: */
066:            public static final int PAYMENT_PROV_SEL_DLG_UPDATE_STAMP = PAYMENT_ID_BASE + 8;
067:            /** Resource string. Cancelling... */
068:            public static final int PAYMENT_UPDATE_DLG_CANCELLING = PAYMENT_ID_BASE + 9;
069:            /** Resource string. Connecting... */
070:            public static final int PAYMENT_UPDATE_DLG_CONNECTING = PAYMENT_ID_BASE + 10;
071:            /** Resource string. Sending request... */
072:            public static final int PAYMENT_UPDATE_DLG_SENDING = PAYMENT_ID_BASE + 11;
073:            /** Resource string. Waiting for server... */
074:            public static final int PAYMENT_UPDATE_DLG_WAITING = PAYMENT_ID_BASE + 12;
075:            /** Resource string. Downloading... */
076:            public static final int PAYMENT_UPDATE_DLG_DOWNLOADING = PAYMENT_ID_BASE + 13;
077:            /** Resource string. Verifying... */
078:            public static final int PAYMENT_UPDATE_DLG_VERIFYING = PAYMENT_ID_BASE + 14;
079:            /** Resource string. (Retry %1/%2) */
080:            public static final int PAYMENT_UPDATE_DLG_RETRY = PAYMENT_ID_BASE + 15;
081:            /** Resource string. Update Error */
082:            public static final int PAYMENT_ERROR_DLG_CAPTION = PAYMENT_ID_BASE + 16;
083:            /** Resource string. Can not update. */
084:            public static final int PAYMENT_ERROR_PREFIX = PAYMENT_ID_BASE + 17;
085:            /** 
086:             * Resource string. 
087:             * Contact your application provider to correct this situation. 
088:             */
089:            public static final int PAYMENT_ERROR_SUFFIX = PAYMENT_ID_BASE + 18;
090:            /** 
091:             * Resource string. 
092:             * The application has not got permission to download the update file from 
093:             * the server.
094:             */
095:            public static final int PAYMENT_ERROR_PERMISSIONS = PAYMENT_ID_BASE + 19;
096:            /** Resource string. Failed to download the update file from the server. */
097:            public static final int PAYMENT_ERROR_DOWNLOAD_FAILED = PAYMENT_ID_BASE + 20;
098:            /** 
099:             * Resource string. 
100:             * The payment information on the server is not supported. 
101:             */
102:            public static final int PAYMENT_ERROR_UPDATE_NOT_SUPPORTED = PAYMENT_ID_BASE + 21;
103:            /** 
104:             * Resource string. 
105:             * The payment information on the server is not yet valid. 
106:             */
107:            public static final int PAYMENT_ERROR_UPDATE_NOT_YET_VALID = PAYMENT_ID_BASE + 22;
108:            /** Resource string. The payment information on the server is expired. */
109:            public static final int PAYMENT_ERROR_UPDATE_EXPIRED = PAYMENT_ID_BASE + 23;
110:            /** Resource string. The payment information on the server is invalid. */
111:            public static final int PAYMENT_ERROR_UPDATE_INVALID = PAYMENT_ID_BASE + 24;
112:            /** Resource string. The payment information on the server is incomplete. */
113:            public static final int PAYMENT_ERROR_UPDATE_INCOMPLETE = PAYMENT_ID_BASE + 25;
114:            /** 
115:             * Resource string. 
116:             * The payment update file has not been found at its URL. 
117:             */
118:            public static final int PAYMENT_ERROR_UPDATE_NOT_FOUND = PAYMENT_ID_BASE + 26;
119:            /** Resource string. Connection with the server failed. */
120:            public static final int PAYMENT_ERROR_CONNECTION_FAILED = PAYMENT_ID_BASE + 27;
121:            /** 
122:             * Resource string. 
123:             * The payment information on the server is of an invalid type. 
124:             */
125:            public static final int PAYMENT_ERROR_UPDATE_INVALID_TYPE = PAYMENT_ID_BASE + 28;
126:            /** 
127:             * Resource string. 
128:             * The certificate used to sign the update file on the server is expired or
129:             * not yet valid.
130:             */
131:            public static final int PAYMENT_ERROR_CERTIFICATE_EXPIRED = PAYMENT_ID_BASE + 29;
132:            /** 
133:             * Resource string. 
134:             * The certificate used to sign the update file on the server is incorrect 
135:             * or unsupported. 
136:             */
137:            public static final int PAYMENT_ERROR_CERTIFICATE_INCORRECT = PAYMENT_ID_BASE + 30;
138:            /** 
139:             * Resource string. 
140:             * The certificate used to sign the update file on the server is not 
141:             * trusted. 
142:             */
143:            public static final int PAYMENT_ERROR_CERTIFICATE_UNTRUSTED = PAYMENT_ID_BASE + 31;
144:            /** 
145:             * Resource string. 
146:             * The verification of the update file signature failed. 
147:             */
148:            public static final int PAYMENT_ERROR_VERIFICATION_FAILED = PAYMENT_ID_BASE + 32;
149:            /**
150:             * Resource string.
151:             * Are you sure, you want to buy this feature for %1 %2.%3 using %4 
152:             * provided by %5?
153:             */
154:            public static final int PAYMENT_UPDATE_DLG_QUESTION = PAYMENT_ID_BASE + 33;
155:
156:            /** Creates a new instance of <code>Utils</code>. */
157:            protected Utils() {
158:            }
159:
160:            /**
161:             * Parses properties from the given input stream and returns them as an
162:             * instance of the <code>Properties</code> class. The <code>charset</code>
163:             * parameter contains the actual character encoding of the input stream.
164:             *
165:             * @param is the input stream which contains properties
166:             * @param charset the character set of the input stream
167:             * @return the properties read from the stream
168:             * @throws UnsupportedEncodingException if <code>charset</code> is not 
169:             *      supported by the implementation
170:             * @throws IOException if the input stream doesn't have properties in the
171:             *      correct format
172:             */
173:            public abstract Properties loadProperties(InputStream is,
174:                    String charset) throws UnsupportedEncodingException,
175:                    IOException;
176:
177:            /**
178:             * Returns a resource string for the given key.
179:             *
180:             * @param key the key
181:             * @return the string assigned to the key
182:             */
183:            public abstract String getString(int key);
184:
185:            /**
186:             * Returns a modified resource string for the given key. It replaces any
187:             * occurence of %1, %2, ... in the original resource string with the first, 
188:             * second, ... string from <code>values</code>.
189:             *
190:             * @param key the key
191:             * @param values the replacement strings
192:             * @return the modified resource string
193:             */
194:            public abstract String getString(int key, String[] values);
195:
196:            /**
197:             * Parses a date string according to the ISO 8601 standard.
198:             *
199:             * @param date the date string in the format YYYY-MM-DDTHH:MM[:SS][[+|-]
200:             *      HH[MM]]
201:             * @return the number of milliseconds elapsed since 1970-1-1 GMT to this
202:             *      date
203:             * @throws IllegalArgumentException if the format of the date string is
204:             *      incorrect or the date is invalid
205:             */
206:            public abstract long parseISODate(String date);
207:
208:            /**
209:             * Converts the given date to the string formatted according to the 
210:             * ISO 8601 standard.
211:             *
212:             * @param date the date as the number of milliseconds elapsed since 
213:             *      1970-1-1 GMT
214:             * @return the date string
215:             */
216:            public abstract String formatISODate(long date);
217:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.