Package com.thoughtworks.xstream.io.xml

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


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


    auth(request);   
    Response response = client.handle(request);
    try {
      //System.out.println(response.getStatus()+response.getEntity().getText());
      StatusList s = (StatusList) xstream.unmarshal(
          new DomReader(response.getEntityAsDom().getDocument()));
      System.out.println(s.getStatuses().size());
      for(Status it : s.getStatuses()){
        System.out.println(it);
      }
      return s.getStatuses();
View Full Code Here

    auth(request);
    Response response = client.handle(request);
   
    try {
      //System.out.println(response.getStatus()+response.getEntity().getText());
      Status s = (Status)xstream.unmarshal(new DomReader(response.getEntityAsDom().getDocument()));
      if(response.getStatus().equals(org.restlet.data.Status.SUCCESS_OK)){
        //TwipsePlugin.getDefault().getStatusList().add(s);
        //TwipsePlugin.getDefault().getStatusList().notifyObservers();       
      }
    } catch (IOException e) {
View Full Code Here

        //System.out.println("No updates");
        return null;
      }

      StatusList s = (StatusList) xstream.unmarshal(
          new DomReader(response.getEntityAsDom().getDocument()));
     
      for(Status it:s.getStatuses()){
        System.out.println(it);
      }
      return s.getStatuses();
View Full Code Here

    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

                } catch (TransformerException e) {
                    throw new MessagingException("Failed to transform content: " + content + " to DOMResult: " + e, e);
                }
                document = (Document) result.getNode();
            }
            return getXStream().unmarshal(new DomReader(document));
        }
        return super.unmarshal(exchange, message);
    }
View Full Code Here

                catch (TransformerException e) {
                    throw new MessagingException("Failed to transform content: " + content + " to DOMResult: " + e, e);
                }
                document = (Document) result.getNode();
            }
            return getXStream().unmarshal(new DomReader(document));
        }
        return super.unmarshal(exchange, message);
    }
View Full Code Here

  @Override
  protected Object unmarshalDomNode(Node node) throws XmlMappingException {
    HierarchicalStreamReader streamReader;
    if (node instanceof Document) {
      streamReader = new DomReader((Document) node, this.nameCoder);
    }
    else if (node instanceof Element) {
      streamReader = new DomReader((Element) node, this.nameCoder);
    }
    else {
      throw new IllegalArgumentException("DOMSource contains neither Document nor Element");
    }
        return doUnmarshal(streamReader, null);
View Full Code Here

            // Set the thread context classloader so deserializing classes can grab the cl from the thread
            ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
            try {
                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);
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;
    }
View Full Code Here

TOP

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

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.