Mercurial > 510Connectbot
comparison src/org/tn5250j/encoding/BuiltInCodePageFactory.java @ 25:5949eb469a79 tn5250
adding tn5250 files, native android logging
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Tue, 03 Jun 2014 12:10:21 -0700 |
parents | cbdff98c45ea |
children | b29b39f386a4 |
comparison
equal
deleted
inserted
replaced
24:d1c549560aff | 25:5949eb469a79 |
---|---|
50 import org.tn5250j.encoding.builtin.CCSID500; | 50 import org.tn5250j.encoding.builtin.CCSID500; |
51 import org.tn5250j.encoding.builtin.CCSID870; | 51 import org.tn5250j.encoding.builtin.CCSID870; |
52 import org.tn5250j.encoding.builtin.CCSID871; | 52 import org.tn5250j.encoding.builtin.CCSID871; |
53 import org.tn5250j.encoding.builtin.CCSID875; | 53 import org.tn5250j.encoding.builtin.CCSID875; |
54 import org.tn5250j.encoding.builtin.ICodepageConverter; | 54 import org.tn5250j.encoding.builtin.ICodepageConverter; |
55 import org.tn5250j.tools.logging.TN5250jLogFactory; | 55 import android.util.Log; |
56 import org.tn5250j.tools.logging.TN5250jLogger; | 56 |
57 | 57 |
58 /** | 58 /** |
59 * Methods for built-in code page support. | 59 * Methods for built-in code page support. |
60 */ | 60 */ |
61 /* package */ class BuiltInCodePageFactory { | 61 /* package */ class BuiltInCodePageFactory { |
62 | 62 |
63 private static BuiltInCodePageFactory singleton; | 63 private static BuiltInCodePageFactory singleton; |
64 | 64 |
65 private final List<Class<?>> clazzes = new ArrayList<Class<?>>(); | 65 private final List<Class<?>> clazzes = new ArrayList<Class<?>>(); |
66 private final TN5250jLogger log = TN5250jLogFactory.getLogger(this.getClass()); | 66 |
67 | 67 |
68 private BuiltInCodePageFactory() { | 68 private BuiltInCodePageFactory() { |
69 register(); | 69 register(); |
70 } | 70 } |
71 | 71 |
139 final Constructor<?> constructor = clazz.getConstructor(new Class[0]); | 139 final Constructor<?> constructor = clazz.getConstructor(new Class[0]); |
140 final ICodepageConverter converter = (ICodepageConverter) constructor.newInstance(); | 140 final ICodepageConverter converter = (ICodepageConverter) constructor.newInstance(); |
141 converter.init(); | 141 converter.init(); |
142 return converter; | 142 return converter; |
143 } catch (Exception e) { | 143 } catch (Exception e) { |
144 log.error("Couldn't load code page converter class:" + clazz.getCanonicalName(), e); | 144 Log.e(TAG,"Couldn't load code page converter class:" + clazz.getCanonicalName(), e); |
145 return null; | 145 return null; |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 } | 149 } |