Class Deserialize


  • public final class Deserialize
    extends Object
    Utility methods for deserializing the input of an ExtractionPlugin, for use in the Flits test framework. TODO deserialize all property types, how? (e.g. time zone, based on model?? based on string format??)
    • Method Detail

      • traceFromJson

        public static org.hansken.plugin.extraction.runtime.grpc.client.api.ClientTrace traceFromJson​(Path jsonFile)
        Create a Trace described by the JSON in the file pointed to by given path.

        The JSON is expected to contain a single trace field, which is an object containing an object field per type. Each object field then contains the properties of the trace for that type.

        Parameters:
        jsonFile - the file to read from
        Returns:
        the deserialized trace
      • searchTraceFromJson

        public static SearchTrace searchTraceFromJson​(Path jsonFile)
                                               throws IOException
        Create a SearchTrace described by the JSON string.

        The JSON is expected to contain a single trace field, which is an object containing an object field per type. Each object field then contains the properties of the trace for that type.

        Parameters:
        jsonFile - the file to read from
        Returns:
        the deserialized trace
        Throws:
        IOException - when an I/O error occurs or when given input file does not exist
      • contextFromRandomAccessData

        public static org.hansken.plugin.extraction.runtime.grpc.client.api.ClientDataContext contextFromRandomAccessData​(Path dataFile)
                                                                                                                   throws IOException
        Create a context from a RandomAccessFileData.
        Parameters:
        dataFile - path to the data
        Returns:
        the created data context
        Throws:
        IOException - when the path is incorrect
      • traceSearcherFromData

        public static TraceSearcher traceSearcherFromData​(Path tracePath)
        Create a trace searcher with files residing in the directory pointed to by the given path.
        Parameters:
        tracePath - the directory whose children will be used
        Returns:
        the created trace searcher
      • extractDataType

        public static String extractDataType​(Path dataFilePath)