Package com.thoughtworks.xstream

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


        while (reader.ready()) {
          xmlString += reader.readLine();
        }
     
        //lMap = (LinkedHashMap) xStream.fromXML(xmlString);
       ArrayList lMapList = (ArrayList) xStream.fromXML(xmlString);
     
      return lMapList;
    } catch (Exception err){
      log.error("loadWmlFile",err);
    }
View Full Code Here


            while (reader.ready()) {
                xmlString += reader.readLine();
            }

            // lMap = (LinkedHashMap) xStream.fromXML(xmlString);
            ArrayList lMapList = (ArrayList) xStream.fromXML(xmlString);

            return lMapList;
        } catch (Exception err) {
            log.error(err);
        }
View Full Code Here

          // XStream xStream = new XStream(new XppDriver());
          XStream xStream = new XStream(new DomDriver("UTF-8"));
          xStream.setMode(XStream.NO_REFERENCES);

          String xmlString = sd.getSessionXml();
          RemoteSessionObject userObject = (RemoteSessionObject) xStream
              .fromXML(xmlString);

          log.debug("userObject.getUsername(), userObject.getFirstname(), userObject.getLastname() "
              + userObject.getUsername()
              + ", "
View Full Code Here

      BufferedReader reader = new BufferedReader(new FileReader(fileName));
        String xmlString = "";
        while (reader.ready()) {
          xmlString += reader.readLine();
        }
        emotfilesList = (LinkedList<LinkedList<String>>) xStream.fromXML(xmlString);
        ChatString.getInstance().replaceAllRegExp();
       
        log.debug("##### loadEmot completed");
       
    } catch (Exception err) {
View Full Code Here

        return xStream.toXML(task);
    }

    private Object deserialize(String serializedRunnable) {
        XStream xStream = new XStream();
        return xStream.fromXML(serializedRunnable);
    }

    private void execSQL(String sql) throws SQLException {
        Connection c = dataSource.getConnection();
        try {
View Full Code Here

        T result = null;

        XStream xstream = new XStream();
        xstream.registerConverter(new GuardedStringConverter());
        try {
            result = (T) xstream.fromXML(URLDecoder.decode(serialized, SyncopeConstants.DEFAULT_ENCODING));
        } catch (UnsupportedEncodingException e) {
            LOG.error("During deserialization", e);
        }

        return result;
View Full Code Here

    }

    public Page loadRootPage(String baseUrl, String spaceKey, String pageName) {
        String searchResult = client.get(format(SEARCH_PAGE, baseUrl, spaceKey, pageName));
        XStream parse = configureXStream();
        Results results = (Results) parse.fromXML(searchResult);
        return results.getGroup().getResult();
    }

    public Page loadPage(String pageUrl, boolean expanded) {
        String pattern = expanded ? EXPAND_PAGE : REGULAR_PAGE;
View Full Code Here

    public Page loadPage(String pageUrl, boolean expanded) {
        String pattern = expanded ? EXPAND_PAGE : REGULAR_PAGE;
        String content = client.get(format(pattern, pageUrl));
        XStream parse = configureXStream();
        Page page = (Page) parse.fromXML(content);
        return page;
    }

    protected XStream configureXStream() {
        XStream stream = new XStream();
View Full Code Here

      return gson.fromJson(entity, Page.class).content;
    case XML:
      XStream xstream = new XStream();
      xstream.alias("page", Page.class);
      xstream.ignoreUnknownElements();
      return ((Page) xstream.fromXML(entity)).content;
    default:
      return entity;
    }
  }
View Full Code Here

          WikiPage.class).text;
    case XML:
      XStream xstream = new XStream();
      xstream.alias("wiki_page", WikiPage.class);
      xstream.ignoreUnknownElements();
      return ((WikiPage) xstream.fromXML(entity)).text;
    default:
      return entity;
    }
  }
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.