Class CustomFieldsAdapter


  • public class CustomFieldsAdapter
    extends java.lang.Object
    Assists in converting plugin property values with DYNAMIC_FORM rendering option, so that variable expansion can be done within the field values of the JSON structure.
    • Method Detail

      • create

        public static CustomFieldsAdapter create​(Description description)
        Create a new instance
        Parameters:
        description - description
        Returns:
        instance
      • replaceConvertedCustomFieldValues

        public static java.lang.String replaceConvertedCustomFieldValues​(CustomFieldsAdapter.CustomFields customFields,
                                                                         java.util.Map<java.lang.String,​java.lang.String> converted)
        Given a map of converted values, replace the values in the CustomFields object and return the JSON serialized
        Parameters:
        customFields - CustomFields object
        converted - converted values
        Returns:
        json serialized string of new value, or null if there is an error
      • convertJsonCustomFieldValues

        public static CustomFieldsAdapter.CustomFields convertJsonCustomFieldValues​(java.lang.String input)
        Parse the input as a JSON representation of an array of CustomFields
        Parameters:
        input - input string
        Returns:
        CustomFields object, or null if there is an error
      • convertInput

        public java.lang.Object convertInput​(java.lang.String key,
                                             java.lang.Object input)
        Given property key, and input value, convert the value if it is a JSON representation of an array of CustomFields
        Parameters:
        key - property key
        input - input value
        Returns:
        converted value, or original value if not converted
      • convertOutput

        public java.lang.Object convertOutput​(java.lang.String key,
                                              java.lang.Object output)
        Given property key, and output value, restore the value back to JSON string
        Parameters:
        key - property key
        output - output value
        Returns:
        json serialized string of new value, or original value if not converted