Package com.thoughtworks.xstream.io.xml

Examples of com.thoughtworks.xstream.io.xml.DomDriver


    // stats in asynch aggregates. If the service is asynch, just return an empty list
    if ( serializedComponentStats == null || serializedComponentStats.trim().length() == 0 ) {
      // return an empty list
      return new ArrayList<AnalysisEnginePerformanceMetrics>();
    }
    XStream xstream = new XStream(new DomDriver());
    return (List<AnalysisEnginePerformanceMetrics>)xstream.fromXML(serializedComponentStats);
  }
View Full Code Here


    }
    return sb.toString();
  }

  public static String convertToXML(MyLibrary ml) {
    XStream xstream = new XStream(new DomDriver());
    xstream.setMode(XStream.ID_REFERENCES);
    xstream.alias("person", Person.class);
    xstream.alias("book", Book.class);
    xstream.alias("mylibrary", MyLibrary.class);
    return xstream.toXML(ml);
View Full Code Here

    return xstream.toXML(ml);
  }

  public static MyLibrary convertFromXML(String XMLString) {
    MyLibrary ml = null;
    XStream xstream = new XStream(new DomDriver());
    xstream.setMode(XStream.ID_REFERENCES);
    xstream.alias("person", Person.class);
    xstream.alias("book", Book.class);
    xstream.alias("mylibrary", MyLibrary.class);
    Object obj = xstream.fromXML(XMLString);
View Full Code Here

    }

    private static XStream initializeXStream() {
        // This constructor prevents underscores from being replaced with double
        // underscores
        XStream xStream = new XStream(new DomDriver("UTF-8", new XmlFriendlyReplacer("|", "_")));

        //if you use annotated xstream POJOs register them here
//      xStream.processAnnotations(CssParameter.class);
        return xStream;
    }
View Full Code Here

    private RedoLog loadFile() {
        RedoLog log = null;
        String filename = "redolog.xml";
        if (filename != null) {
            try {
                XStream xstream = new XStream(new DomDriver());
                ObjectInputStream in = xstream.createObjectInputStream(new FileReader(filename));
                log = (RedoLog) in.readObject();
                in.close();
            } catch (Exception e) {
                //debugging
View Full Code Here

    private DataDictionary loadDataDictionaryFile() {
        DataDictionary dict = null;
        String filename = "datadict.xml";
        if (filename != null) {
            try {
                XStream xstream = new XStream(new DomDriver());
                ObjectInputStream in = xstream.createObjectInputStream(new FileReader(filename));
                dict = (DataDictionary) in.readObject();
                in.close();
            } catch (Exception e) {
                //debugging
View Full Code Here

   * @return the deserialised Additional code
   * @throws FileNotFoundException
   */
  public static AdditionalCode readFromFile(String filePath) throws FileNotFoundException
  {
    XStream xstream = new XStream(new DomDriver());
   
  //  Alias
  //
    xstream.alias("additionalCode", AdditionalCode.class);
    xstream.alias("attribute", Attribute.class);
View Full Code Here

    // DEBUG
    logger.debug(xmlValidationString);     

    // Defining all the rules to parse the XML
    XStream xstream = new XStream(new DomDriver()); // To parse XML using DOM
    // XStream xstream = new XStream(new StaxDriver()); // To parse XML using Stax

    xstream.alias("validation-results", SBMLErrorLog.class);
    xstream.alias("option", Option.class);
    xstream.alias("problem", SBMLError.class);
View Full Code Here

                 * @param moduleNode
                 */
                @Override
                public void notifyParseResult(ModuleNode moduleNode) {
                    if (opts.showAST) {
                        System.err.println(new XStream(new DomDriver()).toXML(moduleNode));
                    }
                }

                private StringBuilder appendPrettyPlan(StringBuilder sb, Module module) {
                    try {
View Full Code Here

   
    public URIConverterTest() {
    }

    public void setUp() throws Exception{
        xstream = new XStream(new DomDriver("UTF-8"));
        xstream.registerConverter(new URIConverter());
        TEST_URI = new URI(TEST_URI_STRING);
        assertNotNull(xstream);
        assertNotNull(TEST_URI);
    }
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.xml.DomDriver

Copyright © 2018 www.massapicom. 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.