-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from julesjacobsen/json-deserialise
Json deserialise
- Loading branch information
Showing
20 changed files
with
260 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 8 additions & 9 deletions
17
src/main/java/org/geneontology/obographs/io/OgJsonReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
package org.geneontology.obographs.io; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.geneontology.obographs.model.GraphDocument; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import org.geneontology.obographs.model.Graph; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
public class OgJsonReader { | ||
|
||
public static Graph readFile(String fileName) throws IOException { | ||
public static GraphDocument readFile(String fileName) throws IOException { | ||
return readFile(new File(fileName)); | ||
} | ||
|
||
public static Graph readFile(File file) throws IOException { | ||
public static GraphDocument readFile(File file) throws IOException { | ||
ObjectMapper objectMapper = new ObjectMapper(); | ||
return objectMapper.readValue(file, Graph.class); | ||
return objectMapper.readValue(file, GraphDocument.class); | ||
} | ||
|
||
public static Graph readInputStream(InputStream stream) throws IOException { | ||
public static GraphDocument readInputStream(InputStream stream) throws IOException { | ||
ObjectMapper objectMapper = new ObjectMapper(); | ||
return objectMapper.readValue(stream, Graph.class); | ||
return objectMapper.readValue(stream, GraphDocument.class); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
src/main/java/org/geneontology/obographs/model/axiom/AbstractExpression.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
package org.geneontology.obographs.model.axiom; | ||
|
||
import org.geneontology.obographs.model.Meta; | ||
import org.geneontology.obographs.model.axiom.AbstractAxiom.Builder; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public class AbstractExpression implements Expression { | ||
|
||
protected AbstractExpression(Builder builder) { | ||
} | ||
|
||
public static class Builder { | ||
|
||
|
||
|
||
|
||
} | ||
} |
Oops, something went wrong.