Package com.thoughtworks.xstream

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


    auth(request);
    Response response = client.handle(request);
   
    try {
      //System.out.println(response.getStatus()+response.getEntity().getText());
      UserStatus s = (UserStatus)xstream.unmarshal(
          new DomReader(response.getEntityAsDom().getDocument()));
      System.out.println(s.getScreen_name()+"-"+s.getStatus().getText());
      return s;
    } catch (IOException e) {
      // TODO Auto-generated catch block
View Full Code Here


    Request request = new Request(Method.GET, URL);
    auth(request);   
    Response response = client.handle(request);
    try {
      //System.out.println(response.getStatus()+response.getEntity().getText());
      UserStatusList s = (UserStatusList) xstream.unmarshal(
          new DomReader(response.getEntityAsDom().getDocument()));
      System.out.println(s.getUserList().size());
      for(UserStatus it : s.getUserList()){
        System.out.println(it);
      }
View Full Code Here

                Thread.currentThread().setContextClassLoader(classLoader);

                DomReader reader = new DomReader(element);
                XStream xstream = XStreamUtil.createXStream();
                xstream.setClassLoader(classLoader);
                Object o = xstream.unmarshal(reader);
                GBeanData[] gbeanDatas = (GBeanData[]) o;
                return Arrays.asList(gbeanDatas);
            } catch (Exception e) {
                throw new InvalidConfigException("Unable to load gbeans", e);
            } finally {
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  public <T> T fromXml(T object, Element el) throws Exception{
    XStream      s = createSerializer();
    return (T) s.unmarshal(new JDomReader(el), object);
  }

  public String getEnterpriseName(){
    return "Infotechservice";
  }
View Full Code Here

  }
 
  AbstractReportTable fromXml(Element el){
    XStream          xs = ReportTableFactory.initXStream();
    JDomReader        reader = new JDomReader(el);
    AbstractReportTable    target = (AbstractReportTable)xs.unmarshal(reader);
    target.afterLoad();
    return target;
  }
 
  public void toXml(Collection<AbstractReportTable<?>> list, Element target){
View Full Code Here

            ConfigurationException {
        Node rootNode = loadDocument(xmlFile);
        XStream xs = getConfiguredXStreamWithContext(new XStream(), Context.PERSIST);

        GeoWebCacheConfiguration config;
        config = (GeoWebCacheConfiguration) xs.unmarshal(new DomReader((Element) rootNode));
        return config;
    }

    /**
     * @see org.geowebcache.config.Configuration#save()
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.