Package com.dtolabs.rundeck.plugins.logs
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 typeString
and a data type string of "application/json", and you would produce an object of typeString
and a data type string of "text/html"- Since:
- 5/5/17
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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 objectjava.lang.Class<?>
getOutputClassForDataType(java.lang.Class<?> clazz, java.lang.String dataType)
java.lang.String
getOutputDataTypeForContentDataType(java.lang.Class<?> clazz, java.lang.String dataType)
boolean
isSupportsDataType(java.lang.Class<?> clazz, java.lang.String dataType)
-
-
-
Method Detail
-
isSupportsDataType
boolean isSupportsDataType(java.lang.Class<?> clazz, java.lang.String dataType)
- Parameters:
clazz
- input object typedataType
- 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 typedataType
- 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 typedataType
- 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 objectdataType
- input data type stringmetadata
- metadata about the content- Returns:
- output object
-
-