From 942249fe40169e895c08256bb5583080813803af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Henning?= <stu114708@informatik.uni-kiel.de> Date: Thu, 25 Feb 2016 13:16:18 +0100 Subject: [PATCH] test jaxb marshaling --- .../kieker/analysis/graph/GraphTester.java | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/main/java/kieker/analysis/graph/GraphTester.java b/src/main/java/kieker/analysis/graph/GraphTester.java index 6015525c..754c4787 100644 --- a/src/main/java/kieker/analysis/graph/GraphTester.java +++ b/src/main/java/kieker/analysis/graph/GraphTester.java @@ -1,7 +1,5 @@ package kieker.analysis.graph; -import kieker.analysis.graph.export.BlueprintsExporter; -import kieker.analysis.graph.export.DotExporter; import kieker.analysis.graph.impl.GraphImpl; public class GraphTester { @@ -75,15 +73,29 @@ public class GraphTester { System.out.println(edge.getId()); } - // node2.addEdgeTo(node11); - - // Export to Blueprints - BlueprintsExporter blueprintsExporter = new BlueprintsExporter(graph); - System.out.println(blueprintsExporter.export()); - - DotExporter dotExporter = new DotExporter(graph); - System.out.println(dotExporter.export()); - + // GraphmlType graphmlType = new GraphmlType(); + // graphmlType.getKey().add(new KeyType()); + // graphmlType.getGraphOrData().add(new GraphType()); + + // ERROR als Element ist nicht möglich, weil eine @XmlRootElement-Annotation fehlt + + /* + * try { + * JAXBContext context = JAXBContext.newInstance(GraphmlType.class); + * Marshaller m = context.createMarshaller(); + * m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + * m.marshal(graphmlType, System.out); + * } catch (JAXBException e) { + * // TODO Auto-generated catch block + * e.printStackTrace(); + * } + */ + + // Use object factory + + // http://blog.bdoughan.com/2012/07/jaxb-and-root-elements.html + // http://stackoverflow.com/questions/24519449/unable-to-marshal-type-as-an-element-because-it-is-missing-an-xmlrootelement-an + // http://stackoverflow.com/questions/819720/no-xmlrootelement-generated-by-jaxb } } -- GitLab