Package com.thoughtworks.xstream

Examples of com.thoughtworks.xstream.XStream.fromXML()


        try {
          if(!_metadataFile.isSynchronized(IResource.DEPTH_ZERO)){
            _metadataFile.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
          }
          reader = new InputStreamReader(_metadataFile.getContents(), _fileEncoding);
          TMLMetadataInfo metaData = (TMLMetadataInfo) xstream.fromXML(reader);
          directAccess = metaData.isDirectAccess();
          cacheable = metaData.isCacheable();
          description = metaData.getDescription();
          category = metaData.getCategory();
        } catch (CoreException e) {
View Full Code Here


    return new XStream().toXML(ts);
  }
 
  public static DesignTemplateStore fromXML(String xml){
    XStream xstream = new XStream(new Dom4JDriver());
    return (DesignTemplateStore)xstream.fromXML(xml);
  }
 
 
 
}
View Full Code Here

        handler.flush();
        String result1 = sw.toString();

        System.err.println(result1);

        Author author1 = (Author) xstream.fromXML(result1);
        Assert.assertEquals("anonymous", author1.getName());
    }

    //@Test
    public void addingRendezvousMessages2() throws DbException, XQueryException {
View Full Code Here

    try {
      if (new File(filename).exists()) {
        XStream xstream = new XStream(new DomDriver());
        xstream.setMode(XStream.ID_REFERENCES);
        FileReader reader = new FileReader(filename);
        objects = (Set) xstream.fromXML(reader);
        reader.close();
      }
      return objects;
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  public Collection read() {
    try {
      XStream xstream = new XStream(new DomDriver());
      xstream.setMode(XStream.ID_REFERENCES);
      FileReader reader = new FileReader(filename);
      List objects = (List) xstream.fromXML(reader);
      reader.close();
      return objects;
    } catch (IOException e) {
      e.printStackTrace();
      throw new RuntimeException(e);
View Full Code Here

    xstream.alias("component", Component.class);
    Enumeration<URL> urls = Registry.class.getClassLoader().getResources(
        resource);
    while (urls.hasMoreElements()) {
      InputStream url = urls.nextElement().openStream();
      for (Component component : (List<Component>) xstream.fromXML(url)) {
        registerComponent(component);
      }
      url.close();
    }
    initDomainTypes(editors.keySet());
View Full Code Here

    if(importContent == null || importContent.isEmpty()) {
      return null;
    }
   
    XStream xstream = new XStream();
    Checklist checklist = (Checklist) xstream.fromXML(importContent);
    if(checklist != null) {
      checklist = ChecklistManager.getInstance().copyChecklist(checklist);
      setChecklistKey(cpm, checklist.getKey());
    }
   
View Full Code Here

    RegistrationManager rm = RegistrationManager.getInstance();
    List<TemporaryKey> tk = rm.loadTemporaryKeyByAction(RegistrationManager.EMAIL_CHANGE);
    if (tk != null) {
      for (TemporaryKey temporaryKey : tk) {
        XStream xml = new XStream();
        HashMap<String, String> mails = (HashMap<String, String>) xml.fromXML(temporaryKey.getEmailAddress());
        if (login.equals(mails.get("changedEMail"))) {
          return ManagerFactory.getManager().findIdentityByName(mails.get("currentEMail"));
        }
      }
    }
View Full Code Here

        RegistrationManager rm = RegistrationManager.getInstance();
        String key = this.identity.getUser().getProperty("emchangeKey", null);
        TemporaryKeyImpl tempKey = rm.loadTemporaryKeyByRegistrationKey(key);
        if (tempKey != null) {
          XStream xml = new XStream();
          HashMap<String, String> mails = (HashMap<String, String>) xml.fromXML(tempKey.getEmailAddress());
          formItem.setExampleKey("email.change.form.info", new String[] {mails.get("changedEMail")});
        }
      }
    }
   
View Full Code Here

   */
  private TemporaryKey loadCleanTemporaryKey(String serMailMap) {
    TemporaryKey tk = rm.loadTemporaryKeyByEmail(serMailMap);
    if (tk == null) {
      XStream xml = new XStream();
      HashMap<String, String> mails = (HashMap<String, String>) xml.fromXML(serMailMap);
      String currentEMail = mails.get("currentEMail");
      List<TemporaryKey> tks = rm.loadTemporaryKeyByAction(RegistrationManager.EMAIL_CHANGE);
      if (tks != null) {
        synchronized (tks) {
          tks = rm.loadTemporaryKeyByAction(RegistrationManager.EMAIL_CHANGE);
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.