Package com.thoughtworks.xstream

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


        XQueryModule compiled1 = proc.parse(query1);
        Sequence<? extends Item> items = proc.execute(compiled1);
        INodeSequence<DTMElement> nodes = ProxyNodeSequence.wrap(items, DynamicContext.DUMMY);

        for(DTMElement node : nodes) {
            Object unmarshalled = xstream.unmarshal(new DTMReader(node));
            Author author = (Author) unmarshalled;
            System.out.println("author: " + author.getName());
        }
    }
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

                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

                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

                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

          addAliases( aliases, xstream );
            XStreamConfigurator.addFieldAliases(fieldAliases, xstream);
          addAttributeAliases( attributeAliases, xstream );
          addConverters( converters, xstream );
            XStreamConfigurator.addImplicitCollections(implicitCollections, xstream);
      return xstream.unmarshal( reader, root );
    }
    finally
    {
      if ( reader != nullreader.close();
    }
View Full Code Here

        docBuilderFactory.setNamespaceAware(true);
        DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();

        XStream xs = getConfiguredXStream(new XStream());

        gwcConfig = (GeoWebCacheConfiguration) xs.unmarshal(new DomReader(
                (Element) checkAndTransform(docBuilder.parse(is))));

        mockConfiguration = true;

        initialize();
View Full Code Here

    private void loadConfiguration(File xmlFile) throws GeoWebCacheException {
        Node rootNode = loadDocument(xmlFile);
        XStream xs = getConfiguredXStream(new XStream());

        gwcConfig = (GeoWebCacheConfiguration) xs.unmarshal(new DomReader((Element) rootNode));

        gwcConfig.init();
    }

    private void writeConfiguration() throws GeoWebCacheException {
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

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.