Package org.simpleframework.xml.transform

Examples of org.simpleframework.xml.transform.RegistryMatcher.bind()


  private void check(char[] chars) throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
   
    RegistryMatcher rm = new RegistryMatcher();
    rm.bind(String.class, XmlStringTransformerAccess.getInstance());
    Persister persister = new Persister(rm);
    persister.write(new Model(new String(chars)), baos);

    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
View Full Code Here


    }
   
    try {
      File reportFile = new File(dir, "TEST-" + displayName + ".xml");
      RegistryMatcher rm = new RegistryMatcher();
      rm.bind(String.class, new XmlStringTransformer());
      Persister persister = new Persister(rm);
      persister.write(buildModel(e), reportFile);
    } catch (Exception x) {
      junit4.log("Could not serialize report for suite "
          + displayName + ": " + x.toString(), Project.MSG_WARN);
View Full Code Here

    }
   
    try {
      File reportFile = new File(dir, "TEST-" + displayName + ".xml");
      RegistryMatcher rm = new RegistryMatcher();
      rm.bind(String.class, new XmlStringTransformer());
      Persister persister = new Persister(rm);
      persister.write(buildModel(e), reportFile);
    } catch (Exception x) {
      junit4.log("Could not serialize report for suite "
          + displayName + ": " + x.toString(), Project.MSG_WARN);
View Full Code Here

      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);

      matcher.bind(Long.class, LongTransform.class);
      matcher.bind(Integer.class, IntegerTransform.class);
      registry.bind(User.class, new UserConverter(usersDao, usersMap));
      registry.bind(RoomType.class, new RoomTypeConverter(roomManager));
     
      List<Room> list = readList(serializer, f, "rooms.xml", "rooms", Room.class);
View Full Code Here

      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);

      matcher.bind(Long.class, LongTransform.class);
      matcher.bind(Integer.class, IntegerTransform.class);
      registry.bind(User.class, new UserConverter(usersDao, usersMap));
      registry.bind(RoomType.class, new RoomTypeConverter(roomManager));
     
      List<Room> list = readList(serializer, f, "rooms.xml", "rooms", Room.class);
      for (Room r : list) {
View Full Code Here

      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);

      matcher.bind(Long.class, LongTransform.class);
      matcher.bind(Integer.class, IntegerTransform.class);
      registry.bind(Date.class, DateConverter.class);
     
      List<FlvRecording> list = readList(serializer, f, "flvRecordings.xml", "flvrecordings", FlvRecording.class, true);
      for (FlvRecording fr : list) {
View Full Code Here

      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);

      matcher.bind(Long.class, LongTransform.class);
      matcher.bind(Integer.class, IntegerTransform.class);
      registry.bind(Date.class, DateConverter.class);
     
      List<FlvRecording> list = readList(serializer, f, "flvRecordings.xml", "flvrecordings", FlvRecording.class, true);
      for (FlvRecording fr : list) {
        fr.setFlvRecordingId(0);
View Full Code Here

      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);

      matcher.bind(Long.class, LongTransform.class);
      matcher.bind(Integer.class, IntegerTransform.class);
      registry.bind(Date.class, DateConverter.class);
     
      List<FileExplorerItem> list = readList(serializer, f, "fileExplorerItems.xml", "fileExplorerItems", FileExplorerItem.class, true);
      for (FileExplorerItem file : list) {
View Full Code Here

      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);

      matcher.bind(Long.class, LongTransform.class);
      matcher.bind(Integer.class, IntegerTransform.class);
      registry.bind(Date.class, DateConverter.class);
     
      List<FileExplorerItem> list = readList(serializer, f, "fileExplorerItems.xml", "fileExplorerItems", FileExplorerItem.class, true);
      for (FileExplorerItem file : list) {
        // We need to reset this as openJPA reject to store them otherwise
View Full Code Here

      Registry registry = new Registry();
      Strategy strategy = new RegistryStrategy(registry);
      RegistryMatcher matcher = new RegistryMatcher(); //TODO need to be removed in the later versions
      Serializer serializer = new Persister(strategy, matcher);
 
      matcher.bind(Integer.class, IntegerTransform.class);
      registry.bind(User.class, new UserConverter(usersDao, usersMap));
      registry.bind(Room.class, new RoomConverter(roomDao, roomsMap));
      registry.bind(PollType.class, new PollTypeConverter(pollManager));
      registry.bind(Date.class, DateConverter.class);
     
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.