Package com.thoughtworks.xstream

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


       
        if(classAlias == null) {
            if(excludePackage) {
                xstream.alias(object.getClass().getSimpleName(), object.getClass());
            } else {
                xstream.alias(object.getClass().getName(), object.getClass());
            }
        } else {
            xstream.alias(classAlias, object.getClass());
        }
        XStreamConfigurator.addClassAliases(classAliases, xstream);
View Full Code Here


                xstream.alias(object.getClass().getSimpleName(), object.getClass());
            } else {
                xstream.alias(object.getClass().getName(), object.getClass());
            }
        } else {
            xstream.alias(classAlias, object.getClass());
        }
        XStreamConfigurator.addClassAliases(classAliases, xstream);
        XStreamConfigurator.addFieldAliases(fieldAliases, xstream);
        XStreamConfigurator.addImplicitCollections(implicitCollections, xstream);
        XStreamConfigurator.addConverters(converters, xstream);
View Full Code Here

        String xml = (String)oMsg.getBody().get();
        XStream xstream = new XStream(new DomDriver());
        TestBean bean = new TestBean();

        assertTrue("Expected [<TestBean>].  Got [" + xml + "]", xml.startsWith("<TestBean>"));
        xstream.alias("TestBean", TestBean.class);
        xstream.fromXML(xml, bean);
       
        assertEquals("Tom", bean.getName());
        assertEquals("1234", bean.getPhone());
    }
View Full Code Here

        oMsg.getBody().add(new TestBean("Tom", "1234"));
        objectToXStream.process(oMsg);
        String xml = (String)oMsg.getBody().get();

        XStream xstream = new XStream(new DomDriver());
        xstream.alias("TomsClass", TestBean.class);
        TestBean bean = new TestBean();

        assertTrue("Expected start with [<TomsClass>].  Got [" + xml + "]", xml.startsWith("<TomsClass>"));
        xstream.fromXML(xml, bean);
       
View Full Code Here

   public Message insertOrder(Message message) throws Exception
   {
      Body msgBody = message.getBody();
      XStream xstream = new XStream(new DomDriver());
      xstream.alias("order", Order.class);
      Order order = (Order) xstream.fromXML((String) msgBody.get());

      PetStoreFacade petStore = (PetStoreFacade) getBeanFactory()
            .getBean("petStore");
      petStore.insertOrder(order);
View Full Code Here

    }

    protected XStream getXStream(){
        XStream xstream = new XStream();
        xstream.setMode(XStream.NO_REFERENCES);
        xstream.alias("envelope", GeneralEnvelope.class);
        xstream.alias("WCS", WCSConfig.class);
        xstream.alias("WFS", WFSConfig.class);
        xstream.alias("WMS", WMSConfig.class);
        xstream.alias("crs", CoordinateReferenceSystem.class);
        xstream.aliasField("abstract", WMSConfig.class, "__abstract");
View Full Code Here

    protected XStream getXStream(){
        XStream xstream = new XStream();
        xstream.setMode(XStream.NO_REFERENCES);
        xstream.alias("envelope", GeneralEnvelope.class);
        xstream.alias("WCS", WCSConfig.class);
        xstream.alias("WFS", WFSConfig.class);
        xstream.alias("WMS", WMSConfig.class);
        xstream.alias("crs", CoordinateReferenceSystem.class);
        xstream.aliasField("abstract", WMSConfig.class, "__abstract");
        xstream.registerConverter(new CRSConverter());
View Full Code Here

    protected XStream getXStream(){
        XStream xstream = new XStream();
        xstream.setMode(XStream.NO_REFERENCES);
        xstream.alias("envelope", GeneralEnvelope.class);
        xstream.alias("WCS", WCSConfig.class);
        xstream.alias("WFS", WFSConfig.class);
        xstream.alias("WMS", WMSConfig.class);
        xstream.alias("crs", CoordinateReferenceSystem.class);
        xstream.aliasField("abstract", WMSConfig.class, "__abstract");
        xstream.registerConverter(new CRSConverter());
        return xstream;
View Full Code Here

        XStream xstream = new XStream();
        xstream.setMode(XStream.NO_REFERENCES);
        xstream.alias("envelope", GeneralEnvelope.class);
        xstream.alias("WCS", WCSConfig.class);
        xstream.alias("WFS", WFSConfig.class);
        xstream.alias("WMS", WMSConfig.class);
        xstream.alias("crs", CoordinateReferenceSystem.class);
        xstream.aliasField("abstract", WMSConfig.class, "__abstract");
        xstream.registerConverter(new CRSConverter());
        return xstream;
    }
View Full Code Here

        xstream.setMode(XStream.NO_REFERENCES);
        xstream.alias("envelope", GeneralEnvelope.class);
        xstream.alias("WCS", WCSConfig.class);
        xstream.alias("WFS", WFSConfig.class);
        xstream.alias("WMS", WMSConfig.class);
        xstream.alias("crs", CoordinateReferenceSystem.class);
        xstream.aliasField("abstract", WMSConfig.class, "__abstract");
        xstream.registerConverter(new CRSConverter());
        return xstream;
    }
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.