Interface ContentConverterPlugin


  • public interface ContentConverterPlugin
    Plugin type which can convert log and other data into a view type: allows converting a String or object to another object type, given a "data type" string, such as "text/plain" or "application/json". To convert, e.g. a json string into an HTML table for display in a log, you would support an input object of type String and a data type string of "application/json", and you would produce an object of type String and a data type string of "text/html"
    Since:
    5/5/17
    • Method Detail

      • isSupportsDataType

        boolean isSupportsDataType​(java.lang.Class<?> clazz,
                                   java.lang.String dataType)
        Parameters:
        clazz - input object type
        dataType - input data type string
        Returns:
        true if the class and datatype are supported
      • getOutputClassForDataType

        java.lang.Class<?> getOutputClassForDataType​(java.lang.Class<?> clazz,
                                                     java.lang.String dataType)
        Parameters:
        clazz - input object type
        dataType - input data type string
        Returns:
        output object type
      • getOutputDataTypeForContentDataType

        java.lang.String getOutputDataTypeForContentDataType​(java.lang.Class<?> clazz,
                                                             java.lang.String dataType)
        Parameters:
        clazz - input object type
        dataType - input data type string
        Returns:
        output data type string
      • convert

        java.lang.Object convert​(java.lang.Object data,
                                 java.lang.String dataType,
                                 java.util.Map<java.lang.String,​java.lang.String> metadata)
        Convert the input object
        Parameters:
        data - input object
        dataType - input data type string
        metadata - metadata about the content
        Returns:
        output object