Package com.thoughtworks.xstream

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


                in = new DomReader((Document)source);
            } else if (source instanceof Element) {
                in = new DomReader((Element)source);
            }
            XStream xs = new XStream();
            return (XObject)xs.unmarshal(in);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
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

                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

                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

                DomReader reader = new DomReader(element);
                XStream xstream = XStreamUtil.createXStream();
                //TODO Obviously, totally broken
//                xstream.setClassLoader(bundle);
                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

                in = new DomReader((Document)source);
            } else if (source instanceof Element) {
                in = new DomReader((Element)source);
            }
            XStream xs = new XStream();
            return (XObject)xs.unmarshal(in);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

    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

    auth(request);
    Map<User,Status> usersMap = new HashMap<User,Status>();
    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.getUsers().size());
      for(Iterator<UserStatus> it = s.getUsers().iterator(); it.hasNext();){
        UserStatus u = it.next();
        u.getStatus().setUser(u);
View Full Code Here

    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

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.