Package com.thoughtworks.xstream

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


  private List<Report> parseReports(File importFile) throws FileNotFoundException
  {
    FileInputStream input = new FileInputStream(importFile);
   
    XStream xStream = new XStream();       
    return (List<Report>) xStream.fromXML(input);
  }

  public File getImportFile()
  {
    return importFile;
View Full Code Here


               
                try
                {
                    FileInputStream inputStream = new FileInputStream(file);
           
                    DeliveredReport report = (DeliveredReport) xStream.fromXML(inputStream);                   
           
                    deliveredReports.add(report);
           
                    inputStream.close();
                }
View Full Code Here

        System.out.println(xmlFileName);
       
        File file = new File(directoryProvider.getReportGenerationDirectory() + xmlFileName);
        FileInputStream inputStream = new FileInputStream(file);
     
        DeliveredReport info = (DeliveredReport) xStream
          .fromXML(inputStream);       
       
        runDate = dateProvider.formatDate(info.getRunDate());         
        reportName = info.getReportName()
        description = info.getReportDescription();
View Full Code Here

   * @throws IllegalAccessException
   */
  public <T> T deserializeObject(Class<T> clazz, String xmlObject) {
    XStream xStream = new XStream();
    xStream.setClassLoader(getClassLoader());
    return (T) xStream.fromXML(xmlObject);
  }
 
  public <T> T deserializeObject(Class<T> clazz, InputStream inStream) {
    XStream xStream = new XStream();
    xStream.setClassLoader(getClassLoader());
View Full Code Here

  }
 
  public <T> T deserializeObject(Class<T> clazz, InputStream inStream) {
    XStream xStream = new XStream();
    xStream.setClassLoader(getClassLoader());
    return (T) xStream.fromXML(inStream);
  }

}
View Full Code Here

    }

    protected Object serializeWithXStream(Object toSerialize) {
        final XStream xstream = new XStream(new XppDriver());
        final String xml = xstream.toXML(toSerialize);
        Object serialized = xstream.fromXML(xml);
        assertNotNull(serialized);
        return serialized;
    }

    protected Object serializeWithXStreamAndPureReflection(Object toSerialize) {
View Full Code Here

    }

    protected Object serializeWithXStreamAndPureReflection(Object toSerialize) {
        final XStream xstream = new XStream(new PureJavaReflectionProvider(), new XppDriver());
        final String xml = xstream.toXML(toSerialize);
        Object serialized = xstream.fromXML(xml);
        assertNotNull(serialized);
        return serialized;
    }
}
View Full Code Here

          Transformer xformer = TransformerFactory.newInstance().newTransformer();
          xformer.transform(source, result);
          if (c == -1) {
            String versionInfo = writer.toString();
            XStream xstream = new XStream(new DomDriver());
            String serializationVersion = (String)xstream.fromXML(versionInfo);
            if (!serializationVersion.equals(SERIALIZATION_VERSION)) {
              throw new AggDesignerException(Messages.getString("SerializationService.UnrecognizedVersion", SERIALIZATION_VERSION, serializationVersion));
            }
            c++;
          } else {
View Full Code Here

    return xstream.toXML(systemObjects);
  }
 
  public void deserializeConnection(Schema schema, String rdbmsXml, String schemaXml) {
    XStream xstream = getXStream(schema);
    DatabaseMeta databaseMeta = (DatabaseMeta)xstream.fromXML(rdbmsXml);
    SchemaModel schemaModel = (SchemaModel)xstream.fromXML(schemaXml);
   
    //save off cubeName since setSelectedSchemaModel will clear it out
    String cubeName = schemaModel.getCubeName();
   
View Full Code Here

  }
 
  public void deserializeConnection(Schema schema, String rdbmsXml, String schemaXml) {
    XStream xstream = getXStream(schema);
    DatabaseMeta databaseMeta = (DatabaseMeta)xstream.fromXML(rdbmsXml);
    SchemaModel schemaModel = (SchemaModel)xstream.fromXML(schemaXml);
   
    //save off cubeName since setSelectedSchemaModel will clear it out
    String cubeName = schemaModel.getCubeName();
   
    connectionModel.setDatabaseMeta(databaseMeta);
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.