1 5 package org.exoplatform.services.communication.sms.encoder.prodat; 6 7 import org.exoplatform.services.communication.sms.encoder.*; 8 9 13 public class ProdatResolverImpl implements Resolver { 14 15 private static ProdatResolverImpl _me; 16 17 20 public Formatter getFormatter(MessageFormat format) { 21 Formatter formatter = null; 22 if (format.equals(MessageFormat.PLAIN_TEXT)) 23 formatter = TextFormatter.getInstance(); 24 else if (format.equals(MessageFormat.RINGTONE)) 25 formatter = RingtoneFormatter.getInstance(); 26 else if (format.equals(MessageFormat.OPERATOR_LOGO)) 27 formatter = OperatorLogoFormatter.getInstance(); 28 else if (format.equals(MessageFormat.CALLER_GROUP_GRAPHIC)) 29 formatter = CallerGroupGraphicFormatter.getInstance(); 30 else if (format.equals(MessageFormat.PICTURE)) 31 formatter = PictureFormatter.getInstance(); 32 else if (format.equals(MessageFormat.VCARD)) 33 formatter = VCardFormatter.getInstance(); 34 else if (format.equals(MessageFormat.VCALENDAR)) 35 formatter = VCalendarFormatter.getInstance(); 36 else if (format.equals(MessageFormat.RAW_BINARY_UDH)) 37 formatter = RawBinaryUDHFormatter.getInstance(); 38 else if (format.equals(MessageFormat.UNICODE_TEXT)) formatter = UnicodeFormatter.getInstance(); 39 return formatter; 40 } 41 42 45 public Object getOperationCode(MessageFormat format) { 46 Object opcode = null; 47 if (format.equals(MessageFormat.PLAIN_TEXT)) 48 opcode = new Integer (1); 49 else if (format.equals(MessageFormat.RINGTONE)) 50 opcode = new Integer (2); 51 else if (format.equals(MessageFormat.OPERATOR_LOGO)) 52 opcode = new Integer (3); 53 else if (format.equals(MessageFormat.CALLER_GROUP_GRAPHIC)) 54 opcode = new Integer (4); 55 else if (format.equals(MessageFormat.PICTURE)) 56 opcode = new Integer (5); 57 else if (format.equals(MessageFormat.VCARD)) 58 opcode = new Integer (6); 59 else if (format.equals(MessageFormat.VCALENDAR)) 60 opcode = new Integer (7); 61 else if (format.equals(MessageFormat.RAW_BINARY_UDH)) 62 opcode = new Integer (8); 63 else if (format.equals(MessageFormat.UNICODE_TEXT)) opcode = new Integer (9); 64 return opcode; 65 } 66 67 public static ProdatResolverImpl getInstance() { 68 if (_me == null) _me = new ProdatResolverImpl(); 69 return _me; 70 } 71 72 } | Popular Tags |