当前位置: 首页>>代码示例>>Java>>正文


Java Registry类代码示例

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


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


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