Package org.lifstools.jmzqc
Klasse Converter
java.lang.Object
org.lifstools.jmzqc.Converter
Provides convenience functions to parse date and time strings and to
serialize and deserialize mzQC from and to a variety of sources.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic MzQCReturn a Coordinate holding an MzQC object from a file.static MzQCReturn a Coordinate holding an MzQC object from a string holding the JSON representation of an mzQC data.static MzQCReturn a Coordinate holding an MzQC object from a URL.static OffsetDateTimeParse a date and time string using the default date and time formatter.static OffsetTimeparseTimeString(String str) Parse a time string using the default time formatter.static FiletoJsonFile(MzQC obj, File file) Serialize the MzQC object to a file containing the data as a JSON string.static StringtoJsonString(MzQC obj) Serialize the MzQC object to a JSON string.static Set<com.networknt.schema.ValidationMessage>Validate a mzQC JSON file.static Set<com.networknt.schema.ValidationMessage>Validate a mzQC JSON string.static Set<com.networknt.schema.ValidationMessage>Validate a mzQC JSON URL.static Set<com.networknt.schema.ValidationMessage>Validate a mzQC Object.
-
Konstruktordetails
-
Converter
public Converter()
-
-
Methodendetails
-
parseDateTimeString
Parse a date and time string using the default date and time formatter.- Parameter:
str- the date time string- Gibt zurück:
- an
OffsetDateTimeobject.
-
parseTimeString
Parse a time string using the default time formatter.- Parameter:
str- the time string- Gibt zurück:
- an
OffsetTimeobject.
-
of
Return a Coordinate holding an MzQC object from a file.- Parameter:
file- the file containing the mzQC json data.- Gibt zurück:
Coordinateholding the MzQC object.- Löst aus:
IOException
-
of
Return a Coordinate holding an MzQC object from a URL.- Parameter:
url- the url from where to load the mzQC json data.- Gibt zurück:
Coordinateholding the MzQC object.- Löst aus:
IOException
-
of
Return a Coordinate holding an MzQC object from a string holding the JSON representation of an mzQC data.- Parameter:
json- the string containing the mzQC json data.- Gibt zurück:
Coordinateholding the MzQC object.- Löst aus:
IOException
-
validate
public static Set<com.networknt.schema.ValidationMessage> validate(String json) throws com.fasterxml.jackson.core.JsonProcessingException Validate a mzQC JSON string.- Parameter:
json- the mzQC data in JSON format.- Gibt zurück:
- a set of validation messages.
- Löst aus:
com.fasterxml.jackson.core.JsonProcessingException- if the JSON is malformed.
-
validate
public static Set<com.networknt.schema.ValidationMessage> validate(MzQC mzQc) throws com.fasterxml.jackson.core.JsonProcessingException Validate a mzQC Object.- Parameter:
mzQc- the mzQC object.- Gibt zurück:
- a set of validation messages.
- Löst aus:
com.fasterxml.jackson.core.JsonProcessingException- if the JSON is malformed.
-
validate
public static Set<com.networknt.schema.ValidationMessage> validate(File file) throws com.fasterxml.jackson.core.JsonProcessingException, IOException Validate a mzQC JSON file.- Parameter:
file- the mzQC data file in JSON format.- Gibt zurück:
- a set of validation messages.
- Löst aus:
com.fasterxml.jackson.core.JsonProcessingException- if the JSON is malformed.IOException
-
validate
public static Set<com.networknt.schema.ValidationMessage> validate(URL url) throws com.fasterxml.jackson.core.JsonProcessingException, IOException Validate a mzQC JSON URL.- Parameter:
url- the url to read mzQC data in JSON format from.- Gibt zurück:
- a set of validation messages.
- Löst aus:
com.fasterxml.jackson.core.JsonProcessingException- if the JSON is malformed.IOException
-
toJsonString
public static String toJsonString(MzQC obj) throws com.fasterxml.jackson.core.JsonProcessingException Serialize the MzQC object to a JSON string.- Parameter:
obj- the MzQC object- Gibt zurück:
- an (unformatted) JSON string representation.
- Löst aus:
com.fasterxml.jackson.core.JsonProcessingException
-
toJsonFile
public static File toJsonFile(MzQC obj, File file) throws com.fasterxml.jackson.core.JsonProcessingException, IOException Serialize the MzQC object to a file containing the data as a JSON string.- Parameter:
obj- the MzQC objectfile- the file to write to- Gibt zurück:
- an (unformatted) JSON string representation.
- Löst aus:
com.fasterxml.jackson.core.JsonProcessingExceptionIOException
-