use of org.simpleframework.xml.core.Persister in project retrofit by square.
the class SimpleXmlConverterFactoryTest method setUp.
@Before
public void setUp() {
Format format = new Format(0, null, new HyphenStyle(), Verbosity.HIGH);
Persister persister = new Persister(format);
Retrofit retrofit = new Retrofit.Builder().baseUrl(server.url("/")).addConverterFactory(SimpleXmlConverterFactory.create(persister)).build();
service = retrofit.create(Service.class);
}
use of org.simpleframework.xml.core.Persister in project syncany by syncany.
the class TestCliUtil method fixMachineName.
private static void fixMachineName(Map<String, String> client) throws Exception {
File configFile = new File(client.get("localdir") + "/" + Config.DIR_APPLICATION + "/" + Config.FILE_CONFIG);
Serializer serializer = new Persister();
ConfigTO configTO = serializer.read(ConfigTO.class, configFile);
configTO.setMachineName(client.get("machinename"));
serializer.write(configTO, configFile);
}
use of org.simpleframework.xml.core.Persister in project osm-contributor by jawg.
the class CommonSyncModule method getPersister.
@Provides
Persister getPersister() {
RegistryMatcher matchers = new RegistryMatcher();
matchers.bind(org.joda.time.DateTime.class, JodaTimeDateTimeTransform.class);
Strategy strategy = new AnnotationStrategy();
return new Persister(strategy, matchers);
}
use of org.simpleframework.xml.core.Persister in project openmeetings by apache.
the class BackupExport method exportRoomGroup.
/*
* ##################### Backup Room Groups
*/
private void exportRoomGroup(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
Registry registry = new Registry();
Strategy strategy = new RegistryStrategy(registry);
Serializer serializer = new Persister(strategy);
registry.bind(Group.class, GroupConverter.class);
registry.bind(Room.class, RoomConverter.class);
writeList(serializer, zos, "rooms_organisation.xml", "room_organisations", roomDao.getGroups());
progressHolder.setProgress(17);
}
use of org.simpleframework.xml.core.Persister in project openmeetings by apache.
the class BackupExport method exportContacts.
/*
* ##################### User Contacts
*/
private void exportContacts(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
Registry registry = new Registry();
Strategy strategy = new RegistryStrategy(registry);
Serializer serializer = new Persister(strategy);
registry.bind(User.class, UserConverter.class);
writeList(serializer, zos, "userContacts.xml", "usercontacts", userContactDao.get());
progressHolder.setProgress(60);
}
Aggregations