• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Registry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.simpleframework.xml.convert.Registry的典型用法代码示例。如果您正苦于以下问题:Java Registry类的具体用法?Java Registry怎么用?Java Registry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Registry类属于org.simpleframework.xml.convert包,在下文中一共展示了Registry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getReadSerializer

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private static Serializer getReadSerializer() throws Exception {
	if (readSerializer == null) {
	Log.d("hv", "Begin Creating Serializer");
       RegistryMatcher matcher = new RegistryMatcher();
       matcher.bind(Date.class, new DateFormatTransformer());

       Registry registry = new Registry();
       registry.bind(String.class, SimpleXMLStringConverter.class);
       Strategy strategy = new RegistryStrategy(registry);

       Serializer s = new Persister(strategy, matcher);
	Log.d("hv", "Done Creating Serializer");
	
	readSerializer = s;
	}
       return readSerializer;
}
 
开发者ID:Microsoft,项目名称:healthvault-java-sdk,代码行数:18,代码来源:XmlSerializer.java


示例2: importRoomGroups

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void importRoomGroups(File f) throws Exception {
	log.info("Room import complete, starting room groups import");
	Registry registry = new Registry();
	Strategy strategy = new RegistryStrategy(registry);
	Serializer serializer = new Persister(strategy);

	registry.bind(Group.class, new GroupConverter(groupDao, groupMap));
	registry.bind(Room.class, new RoomConverter(roomDao, roomMap));

	List<RoomGroup> list = readList(serializer, f, "rooms_organisation.xml", "room_organisations", RoomGroup.class);
	for (RoomGroup ro : list) {
		Room r = roomDao.get(ro.getRoom().getId());
		if (r == null || ro.getGroup() == null || ro.getGroup().getId() == null) {
			continue;
		}
		if (r.getGroups() == null) {
			r.setGroups(new ArrayList<>());
		}
		ro.setId(null);
		ro.setRoom(r);
		r.getGroups().add(ro);
		roomDao.update(r, null);
	}
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:25,代码来源:BackupImport.java


示例3: importChat

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void importChat(File f) throws Exception {
	log.info("Room groups import complete, starting chat messages import");
	Registry registry = new Registry();
	Strategy strategy = new RegistryStrategy(registry);
	Serializer serializer = new Persister(strategy);

	registry.bind(User.class, new UserConverter(userDao, userMap));
	registry.bind(Room.class, new RoomConverter(roomDao, roomMap));
	registry.bind(Date.class, DateConverter.class);

	List<ChatMessage> list = readList(serializer, f, "chat_messages.xml", "chat_messages", ChatMessage.class);
	for (ChatMessage m : list) {
		m.setId(null);
		if (m.getFromUser() == null || m.getFromUser().getId() == null) {
			continue;
		}
		chatDao.update(m, m.getSent());
	}
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:20,代码来源:BackupImport.java


示例4: importContacts

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void importContacts(File f) throws Exception {
	log.info("Private message folder import complete, starting user contacts import");
	Registry registry = new Registry();
	Strategy strategy = new RegistryStrategy(registry);
	Serializer serializer = new Persister(strategy);

	registry.bind(User.class, new UserConverter(userDao, userMap));

	List<UserContact> list = readList(serializer, f, "userContacts.xml", "usercontacts", UserContact.class);
	for (UserContact uc : list) {
		Long ucId = uc.getId();
		UserContact storedUC = userContactDao.get(ucId);

		if (storedUC == null && uc.getContact() != null && uc.getContact().getId() != null) {
			uc.setId(null);
			if (uc.getOwner() != null && uc.getOwner().getId() == null) {
				uc.setOwner(null);
			}
			uc = userContactDao.update(uc);
			userContactMap.put(ucId, uc.getId());
		}
	}
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:24,代码来源:BackupImport.java


示例5: importRoomFiles

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void importRoomFiles(File f) throws Exception {
	log.info("Poll import complete, starting room files import");
	Registry registry = new Registry();
	Strategy strategy = new RegistryStrategy(registry);
	Serializer serializer = new Persister(strategy);

	registry.bind(BaseFileItem.class, new BaseFileItemConverter(fileItemDao, fileItemMap));

	List<RoomFile> list = readList(serializer, f, "roomFiles.xml", "RoomFiles", RoomFile.class, true);
	for (RoomFile rf : list) {
		Room r = roomDao.get(roomMap.get(rf.getRoomId()));
		if (r == null || rf.getFile() == null || rf.getFile().getId() == null) {
			continue;
		}
		if (r.getFiles() == null) {
			r.setFiles(new ArrayList<>());
		}
		rf.setId(null);
		rf.setRoomId(r.getId());
		r.getFiles().add(rf);
		roomDao.update(r, null);
	}
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:24,代码来源:BackupImport.java


示例6: getSerializer

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private Serializer getSerializer() throws AETException {
  Registry registry = new Registry();
  Serializer serializer = new Persister(new RegistryStrategy(registry));
  try {
    registry.bind(Collect.class, new CollectConverter());
    registry.bind(Compare.class, new CompareConverter());
  } catch (Exception e) {
    throw new AETException("Error while serializing test suite.", e);
  }
  return serializer;
}
 
开发者ID:Cognifide,项目名称:aet,代码行数:12,代码来源:XmlTestSuiteParser.java


示例7: getSerializer

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
/**
 * Utility to get a simple framework persister
 * @return a persister
 * @throws Exception when things get tough
 */
private static Serializer getSerializer() throws Exception {
    Registry registry = new Registry();
    registry.bind(String.class, EmptyStringConverter.class);
    Strategy strategy = new AnnotationStrategy(new RegistryStrategy(registry));
    return new Persister(strategy);

}
 
开发者ID:jorabin,项目名称:KeePassJava2,代码行数:13,代码来源:SimpleDatabase.java


示例8: createSerializer

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
public Serializer createSerializer() {
    Registry registry = new Registry();

    try {
        registry.bind(Vector2.class, VectorConverter.class);
    } catch (Exception e) {
        throw new RuntimeException("Error binding converters!");
    }

    Strategy strategy = new RegistryStrategy(registry);
    return new Persister(strategy);
}
 
开发者ID:reloZid,项目名称:android-anuto,代码行数:13,代码来源:SerializerFactory.java


示例9: bindDate

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private static <T> void bindDate(Registry registry, List<T> list, Function<T, ?> func) throws Exception {
	if (list != null) {
		for (T e : list) {
			Object d = func.apply(e);
			if (d != null) {
				Class<?> dateClass = d.getClass();
				registry.bind(dateClass, DateConverter.class);
				break;
			}
		}
	}
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:13,代码来源:BackupExport.java


示例10: exportGroups

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void exportGroups(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
	Registry registry = new Registry();
	Strategy strategy = new RegistryStrategy(registry);
	Serializer ser = new Persister(strategy);
	List<Group> list = groupDao.get(0, Integer.MAX_VALUE);
	bindDate(registry, list);
	writeList(ser, zos, "organizations.xml", "organisations", list);
	progressHolder.setProgress(5);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:10,代码来源:BackupExport.java


示例11: exportUsers

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void exportUsers(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
	Registry registry = new Registry();
	Strategy strategy = new RegistryStrategy(registry);
	Serializer ser = new Persister(strategy);

	registry.bind(Group.class, GroupConverter.class);
	registry.bind(Salutation.class, SalutationConverter.class);
	List<User> list = userDao.getAllBackupUsers();
	bindDate(registry, list);

	writeList(ser, zos, "users.xml", "users", list);
	progressHolder.setProgress(10);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:14,代码来源:BackupExport.java


示例12: exportRoom

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void exportRoom(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);
	registry.bind(Room.Type.class, RoomTypeConverter.class);
	List<Room> list = roomDao.get();
	bindDate(registry, list);
	writeList(serializer, zos, "rooms.xml", "rooms", list);
	progressHolder.setProgress(15);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:13,代码来源:BackupExport.java


示例13: exportRoomGroup

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
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);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:12,代码来源:BackupExport.java


示例14: exportRoomFile

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void exportRoomFile(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
	Registry registry = new Registry();
	Strategy strategy = new RegistryStrategy(registry);
	Serializer serializer = new Persister(strategy);

	registry.bind(FileItem.class, BaseFileItemConverter.class);
	registry.bind(Recording.class, BaseFileItemConverter.class);

	writeList(serializer, zos, "roomFiles.xml", "RoomFiles", roomDao.getFiles());
	progressHolder.setProgress(17);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:12,代码来源:BackupExport.java


示例15: exportCalendar

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void exportCalendar(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
	List<OmCalendar> list = calendarDao.get();
	Registry registry = new Registry();
	Strategy strategy = new RegistryStrategy(registry);
	Serializer serializer = new Persister(strategy);
	registry.bind(User.class, UserConverter.class);

	writeList(serializer, zos, "calendars.xml", "calendars", list);
	progressHolder.setProgress(22);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:11,代码来源:BackupExport.java


示例16: exportAppointment

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void exportAppointment(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
	List<Appointment> list = appointmentDao.get();
	Registry registry = new Registry();
	Strategy strategy = new RegistryStrategy(registry);
	Serializer serializer = new Persister(strategy);

	registry.bind(User.class, UserConverter.class);
	registry.bind(Appointment.Reminder.class, AppointmentReminderTypeConverter.class);
	registry.bind(Room.class, RoomConverter.class);
	bindDate(registry, list);

	writeList(serializer, zos, "appointements.xml", "appointments", list);
	progressHolder.setProgress(25);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:15,代码来源:BackupExport.java


示例17: exportMeetingMember

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void exportMeetingMember(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);
	registry.bind(Appointment.class, AppointmentConverter.class);

	writeList(serializer, zos, "meetingmembers.xml",
			"meetingmembers", meetingMemberDao.getMeetingMembers());
	progressHolder.setProgress(30);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:13,代码来源:BackupExport.java


示例18: exportOauth

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void exportOauth(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
	Registry registry = new Registry();
	Strategy strategy = new RegistryStrategy(registry);
	Serializer serializer = new Persister(strategy);
	List<OAuthServer> list = auth2Dao.get(0, Integer.MAX_VALUE);
	bindDate(registry, list);
	writeList(serializer, zos, "oauth2servers.xml", "oauth2servers", list);
	progressHolder.setProgress(45);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:10,代码来源:BackupExport.java


示例19: exportPrivateMsg

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
private void exportPrivateMsg(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
	List<PrivateMessage> list = privateMessageDao.get(0, Integer.MAX_VALUE);
	Registry registry = new Registry();
	Strategy strategy = new RegistryStrategy(registry);
	Serializer serializer = new Persister(strategy);

	registry.bind(User.class, UserConverter.class);
	registry.bind(Room.class, RoomConverter.class);
	bindDate(registry, list, PrivateMessage::getInserted);
	writeList(serializer, zos, "privateMessages.xml", "privatemessages", list);
	progressHolder.setProgress(50);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:13,代码来源:BackupExport.java


示例20: exportContacts

import org.simpleframework.xml.convert.Registry; //导入依赖的package包/类
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);
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:11,代码来源:BackupExport.java



注:本文中的org.simpleframework.xml.convert.Registry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DDMTemplateConstants类代码示例发布时间:2022-05-22
下一篇:
Java WaitForQueue类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap