Examples of encodeAsXML()


Examples of org.apache.cayenne.map.DataMap.encodeAsXML()

        // clone DataMap by saving and loading from XML as to avoid modifying shared test
        // DataMap
        DataMap originalMap = getDomain().getDataMap("testmap");
        StringWriter out = new StringWriter();
        PrintWriter outWriter = new PrintWriter(out);
        originalMap.encodeAsXML(outWriter);
        outWriter.flush();
        StringReader in = new StringReader(out.toString());
        map = new MapLoader().loadDataMap(new InputSource(in));
       
        // map must operate in an EntityResolve namespace...
View Full Code Here

Examples of org.apache.cayenne.map.DataMap.encodeAsXML()

        DataMap tempMap = new DataMap();
        tempMap.addDbEntity(new DbEntity("X"));

        PrintWriter writer = new PrintWriter(out);
        tempMap.encodeAsXML(new XMLEncoder(writer));
        writer.close();
        assertTrue(out.isFile());

        Log log = mock(Log.class);
        Injector i = DIBootstrap.createInjector(new ToolsModule(log), new DbImportModule());
View Full Code Here

Examples of org.apache.cayenne.map.DataMap.encodeAsXML()

            }

            // Write the new DataMap out to disk.
            mapFile.delete();
            PrintWriter pw = new PrintWriter(mapFile);
            dataMap.encodeAsXML(pw);
            pw.close();
        } catch (final Exception ex) {
            final Throwable th = Util.unwindException(ex);

            String message = "Error importing database schema";
View Full Code Here

Examples of org.apache.cayenne.map.DataMap.encodeAsXML()

            }

            // Write the new DataMap out to disk.
            map.delete();
            PrintWriter pw = new PrintWriter(map);
            dataMap.encodeAsXML(pw);
            pw.close();
        } catch (final Exception ex) {
            final Throwable th = Util.unwindException(ex);

            String message = "Error importing database schema";
View Full Code Here

Examples of org.apache.cayenne.map.DataMap.encodeAsXML()

        DataMap m = getNode().getDataMaps().iterator().next();

        PrintWriter out = new PrintWriter(new FileOutputStream(f));

        try {
            m.encodeAsXML(out);
        } finally {
            out.close();
        }

        p = new DataMapProject(f);
View Full Code Here

Examples of org.apache.cayenne.map.DataMap.encodeAsXML()

        // clone DataMap by saving and loading from XML as to avoid modifying shared test
        // DataMap
        DataMap originalMap = getDomain().getMap("testmap");
        StringWriter out = new StringWriter();
        PrintWriter outWriter = new PrintWriter(out);
        originalMap.encodeAsXML(outWriter);
        outWriter.flush();
        StringReader in = new StringReader(out.toString());
        map = new MapLoader().loadDataMap(new InputSource(in));
       
        // map must operate in an EntityResolve namespace...
View Full Code Here

Examples of org.apache.cayenne.map.DataMap.encodeAsXML()

            map.delete();
            PrintWriter pw = new PrintWriter(map);
           
            XMLEncoder encoder = new XMLEncoder(pw, "\t");
            encoder.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
            dataMap.encodeAsXML(encoder);

            pw.close();
        }
        catch (final Exception ex) {
            final Throwable th = Util.unwindException(ex);
View Full Code Here

Examples of org.apache.cayenne.map.DataMap.encodeAsXML()

      PrintWriter pw = new PrintWriter(map);
      XMLEncoder encoder = new XMLEncoder(pw, "\t");

      encoder.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
      dataMap.encodeAsXML(encoder);

      pw.close();
    } catch (Exception ex) {
      Throwable th = Util.unwindException(ex);
View Full Code Here

Examples of org.apache.cayenne.map.DataMap.encodeAsXML()

      }
     
      File sourcesFolder = new File(projectFolder.getAbsolutePath(), "Sources");
      File newModelFile = new File(sourcesFolder.getAbsolutePath(), model.name() + ".map.xml");
      PrintWriter writer = new PrintWriter(newModelFile, "UTF8");
      dataMap.encodeAsXML(writer);
      writer.flush();
      writer.close();
     
      System.err.println("\nWrote cayenne map (model) file to: " +  newModelFile.getCanonicalPath() + "\n");
     
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.