Permalink
Browse files

examples

  • Loading branch information...
VarioML committed Dec 29, 2017
1 parent 19e3ef4 commit 712ac7a17f9519543e1f68dd14959a895e8c70c7
Showing with 29 additions and 7 deletions.
  1. +3 −0 .gitignore
  2. +0 −7 src/main/java/examples/Example.java
  3. +26 −0 src/main/java/examples/Example2.java
@@ -41,3 +41,6 @@ Thumbs.db
/bin/
/.gradle/
/build/
.project
.settings
.DS_Store
@@ -1,19 +1,12 @@
package examples;
import java.io.FileInputStream;
import java.net.URL;
import org.varioml.jaxb.CafeVariome;
import org.varioml.jaxb.Frequency;
import org.varioml.jaxb.Lsdb;
import org.varioml.jaxb.Vreport;
import org.varioml.util.Util;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.module.jsonSchema.factories.SchemaFactoryWrapper;
public class Example {
@@ -0,0 +1,26 @@
package examples;
import org.varioml.jaxb.Lsdb;
import org.varioml.util.Util;
public class Example2 {
public static void main(String[] args) throws Exception {
Util u = new Util();
/* LOVD example */
Lsdb lsdb = (Lsdb) u.readXML("xml/xsd/cafe_variome.xsd","xml/lsdb_main/examples/lovd_example.xml", Lsdb.class);
/* Generate JSON schema from the Java class */
u.toJSONSchema("lovd.json-schema", Lsdb.class);
/* Generate JSON schema for the json editor. https://github.com/jdorn/json-editor*/
u.toJSONSchemaHtml5Enabled("lovd.json-schema-html5", Lsdb.class);
}
}

0 comments on commit 712ac7a

Please sign in to comment.