485486487488489490491492493
} public static Serializer createSerializer() { Style style = new HyphenStyle(); Format format = new Format(style); AnnotationStrategy strategy = new AnnotationStrategy(); Serializer serializer = new Persister(strategy, format); return serializer; }
8384858687888990919293
{ inputStream = new BufferedInputStream(res.open()); try { return PersisterHelpers.createPersister(resourceLookup, new AnnotationStrategy()).read(clazz, inputStream); } catch (IOException e) { throw e; }
7475767778798081828384
this.configEncryptionKey = configEncryptionKey; } public static UserConfigTO load(File file) throws ConfigException { try { return new Persister(new AnnotationStrategy()).read(UserConfigTO.class, file); } catch (Exception e) { throw new ConfigException("User config file cannot be read or is invalid: " + file, e); } }
} } public void save(File file) throws ConfigException { try { new Persister(new AnnotationStrategy()).write(this, file); } catch (Exception e) { throw new ConfigException("Cannot write user config to file " + file, e); } }