Package com.thoughtworks.xstream.io.xml

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


   
    public static Object loadMyObject(final String path)
    {
      try{
       
        XStream xstream = new XStream( new DomDriver() );
        FileReader fr = new FileReader( path );
        return xstream.fromXML(fr);

      }
      catch(InitializationException e)
View Full Code Here


   */
  private void checkXStream()
  {
    if (xstream == null)
    {
      xstream = new XStream(new DomDriver());

      xstream.setClassLoader(getClass().getClassLoader());

      xstream.alias("xstructure", IXMappingSet.class);
      xstream.alias("mapping", IXMapping.class);
View Full Code Here

   
    /**
     * construct with given script and specified classloader
     */
    public XStreamContainerBuilder(Reader script, ClassLoader classLoader) {
        this(script, classLoader, new DomDriver());
    }
View Full Code Here

          Result result = new StreamResult(writer);
          Transformer xformer = TransformerFactory.newInstance().newTransformer();
          xformer.transform(source, result);
          if (c == -1) {
            String versionInfo = writer.toString();
            XStream xstream = new XStream(new DomDriver());
            String serializationVersion = (String)xstream.fromXML(versionInfo);
            if (!serializationVersion.equals(SERIALIZATION_VERSION)) {
              throw new AggDesignerException(Messages.getString("SerializationService.UnrecognizedVersion", SERIALIZATION_VERSION, serializationVersion));
            }
            c++;
View Full Code Here

      }
    }
  }
 
  private XStream getXStream(Schema schema) {
    XStream xstream = new XStream(new DomDriver());
    xstream.registerConverter(new DatabaseMetaConverter());
    xstream.registerConverter(new AggListConverter(aggList));
    xstream.registerConverter(new AttributeConverter(schema));
    xstream.registerConverter(new MeasureConverter(schema));
    return xstream;
View Full Code Here

     */
    protected TileLayer deserializeAndCheckLayerInternal(
            String layerName, String formatExtension, InputStream is)
    throws RestletException, IOException {
       
        XStream xs = xmlConfig.getConfiguredXStream(new XStream(new DomDriver()));

        WMSLayer newLayer = null;

        if (formatExtension.equalsIgnoreCase("xml")) {
            newLayer = (WMSLayer) xs.fromXML(is);
View Full Code Here

    throws RestletException, IOException {       
        String formatExtension = (String) req.getAttributes().get("extension");
       
        SeedRequest sr = null;
       
        XStream xs = xmlConfig.getConfiguredXStream(new XStream(new DomDriver()));
       
        if(formatExtension.equalsIgnoreCase("xml")) {
            sr = (SeedRequest) xs.fromXML(req.getEntity().getStream());
        } else if(formatExtension.equalsIgnoreCase("json")){
            sr = (SeedRequest) xs.fromXML(convertJson(req.getEntity().getText()));
View Full Code Here

    if (file.exists()) {
      InputStream is = null;

      try {
        is = new BufferedInputStream(new FileInputStream(file));
        XStream xStream = new XStream(new DomDriver());
        XStreamPathConverter pConv = new XStreamPathConverter();
        pConv.setPrependSlash(true);
        xStream.registerConverter(pConv);

        try {
View Full Code Here

    OutputStreamWriter osw = null;

    try {
      osw = new OutputStreamWriter
          (new BufferedOutputStream(new FileOutputStream(file)), "UTF-8");
      XStream xStream = new XStream(new DomDriver());
      XStreamPathConverter pConv = new XStreamPathConverter();
      pConv.setPrependSlash(true);
      xStream.registerConverter(pConv);
      xStream.toXML(o, osw);
      return true;
View Full Code Here

    while ((line = reader.readLine()) != null)
      sb.append(line);
   
    String decodeMessage = URLDecoder.decode(sb.toString(), "UTF-8");

    XStream xStream = new XStream(new DomDriver());
    xStream.alias("TelnetMessage", TelnetMessage.class);
    xStream.alias("TelnetCommand", TelnetCommand.class);
    telnetMessage = (TelnetMessage) xStream.fromXML(decodeMessage);
   
    String instanceId = telnetMessage.getInstanceId();
View Full Code Here

TOP

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

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.