Package com.thoughtworks.xstream

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


        XStream stream = new XStream();
        stream.addImplicitCollection(Page.class, "link");
        stream.alias("results", Results.class);
        stream.alias("result", Page.class);
        stream.alias("content", Page.class);
        stream.alias("link", Link.class);
        stream.useAttributeFor(Link.class, "rel");
        stream.useAttributeFor(Link.class, "href");
        stream.ignoreUnknownElements();
        return stream;
    }
View Full Code Here


      String json = gson.toJson(page);
      return json;
    case XML:
      page.xmlns = "http://www.xwiki.org";
      XStream xstream = new XStream();
      xstream.alias("page", Page.class);
      xstream.useAttributeFor(Page.class, "xmlns");
            xstream.aliasField("xmlns", Page.class, "xmlns");
            xstream.ignoreUnknownElements();
      String xml = xstream.toXML(page);
      return xml;
View Full Code Here

      Gson gson = new Gson();
      return gson.fromJson(jsonMember(entity, "wiki_page"),
          WikiPage.class).text;
    case XML:
      XStream xstream = new XStream();
      xstream.alias("wiki_page", WikiPage.class);
      xstream.ignoreUnknownElements();
      return ((WikiPage) xstream.fromXML(entity)).text;
    default:
      return entity;
    }
View Full Code Here

  }

  private XStream getXStream()
  {
    XStream xstream = new XStream();
    xstream.alias("entry", Entry.class);
    return xstream;
  }

  private static final boolean cRunPerformance = !"false".equals(System.getProperty("runPerformanceTests"));
View Full Code Here

        JVM jvm = new JVM();
        ReflectionProvider reflectionProvider = jvm.bestReflectionProvider();
        XStream xstream = new XStream(reflectionProvider);

        // AbstractName
        xstream.alias("abstractName", AbstractName.class);
        xstream.addImmutableType(AbstractName.class);
        xstream.registerConverter(new AbstractNameConverter());

        // AbstractNameQuery
        xstream.alias("abstractNameQuery", AbstractNameQuery.class);
View Full Code Here

        xstream.alias("abstractName", AbstractName.class);
        xstream.addImmutableType(AbstractName.class);
        xstream.registerConverter(new AbstractNameConverter());

        // AbstractNameQuery
        xstream.alias("abstractNameQuery", AbstractNameQuery.class);
        xstream.addImmutableType(AbstractNameQuery.class);
        xstream.registerConverter(new AbstractNameQueryConverter());

        // Artifact
        xstream.alias("artifact", Artifact.class);
View Full Code Here

        xstream.alias("abstractNameQuery", AbstractNameQuery.class);
        xstream.addImmutableType(AbstractNameQuery.class);
        xstream.registerConverter(new AbstractNameQueryConverter());

        // Artifact
        xstream.alias("artifact", Artifact.class);
        xstream.addImmutableType(Artifact.class);

        // ConfigurationData
        xstream.alias("configurationData", ConfigurationData.class);
        xstream.registerConverter(new ConfigurationDataConverter(reflectionProvider, xstream.getClassMapper()));
View Full Code Here

        // Artifact
        xstream.alias("artifact", Artifact.class);
        xstream.addImmutableType(Artifact.class);

        // ConfigurationData
        xstream.alias("configurationData", ConfigurationData.class);
        xstream.registerConverter(new ConfigurationDataConverter(reflectionProvider, xstream.getClassMapper()));

        // ConfigurationModuleTypeConverter
        xstream.alias("moduleType", ConfigurationModuleType.class);
        xstream.addImmutableType(ConfigurationModuleType.class);
View Full Code Here

        // ConfigurationData
        xstream.alias("configurationData", ConfigurationData.class);
        xstream.registerConverter(new ConfigurationDataConverter(reflectionProvider, xstream.getClassMapper()));

        // ConfigurationModuleTypeConverter
        xstream.alias("moduleType", ConfigurationModuleType.class);
        xstream.addImmutableType(ConfigurationModuleType.class);
        xstream.registerConverter(new ConfigurationModuleTypeConverter());

        // Dependency
        xstream.alias("dependency", Dependency.class);
View Full Code Here

        xstream.alias("moduleType", ConfigurationModuleType.class);
        xstream.addImmutableType(ConfigurationModuleType.class);
        xstream.registerConverter(new ConfigurationModuleTypeConverter());

        // Dependency
        xstream.alias("dependency", Dependency.class);
        xstream.addImmutableType(Dependency.class);

        // GBeanData
        xstream.alias("gbean", GBeanData.class);
        xstream.registerConverter(new GBeanDataConverter(xstream.getClassMapper()));
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.