Examples of fromXML()


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

      XStream xstream = new XStream(new DomDriver("UTF-8"));

      BufferedInputStream input = null;
    try {
      input = new BufferedInputStream(new FileInputStream(f));
      Object ret = xstream.fromXML(input);
      return ret;
    } catch (FileNotFoundException e) {
      Logger.error(BundlerUtil.class,e.getMessage(),e);
      return null;
    }finally{
View Full Code Here

Examples of com.stanfy.gsonxml.GsonXml.fromXml()

    GsonXml gsonXml = new GsonXmlBuilder()
        .setSameNameLists(true)
        .setXmlParserCreator(parserCreator)
        .create();

    A a = gsonXml.fromXml("<A><B value=\"23.5\" /><C>Test</C></A>", A.class);
    assertEquals("{\"B\":[{\"@value\":23.5}],\"C\":[{\"$\":\"Test\"}]}", gsonXml.getGson().toJson(a));
  }

}
View Full Code Here

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

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

    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

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

        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

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

    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

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

  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

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

    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

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

    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

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

    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
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.