Interface EditableElementParser


public interface EditableElementParser
Provides a utility to replace an editable element value.
  • Method Summary

    Modifier and Type
    Method
    Description
    default com.liferay.portal.kernel.json.JSONObject
    getAttributes(org.jsoup.nodes.Element element)
     
    default com.liferay.portal.kernel.json.JSONObject
    getFieldTemplateConfigJSONObject(String fieldName, Locale locale, Object fieldValue)
     
    getValue(org.jsoup.nodes.Element element)
     
    default String
    parseFieldValue(Object fieldValue)
     
    void
    replace(org.jsoup.nodes.Element element, String value)
    Replaces the editable element value with a new one.
    default void
    replace(org.jsoup.nodes.Element element, String value, com.liferay.portal.kernel.json.JSONObject configJSONObject)
    Replaces the editable element value with a new one and applies the configuration values.
    default void
    validate(org.jsoup.nodes.Element element)
    Validates the editable element.
  • Method Details

    • getAttributes

      default com.liferay.portal.kernel.json.JSONObject getAttributes(org.jsoup.nodes.Element element)
    • getFieldTemplateConfigJSONObject

      default com.liferay.portal.kernel.json.JSONObject getFieldTemplateConfigJSONObject(String fieldName, Locale locale, Object fieldValue)
    • getValue

      String getValue(org.jsoup.nodes.Element element)
    • parseFieldValue

      default String parseFieldValue(Object fieldValue)
    • replace

      void replace(org.jsoup.nodes.Element element, String value)
      Replaces the editable element value with a new one.
      Parameters:
      element - the editable element to replace
      value - the new element value
    • replace

      default void replace(org.jsoup.nodes.Element element, String value, com.liferay.portal.kernel.json.JSONObject configJSONObject)
      Replaces the editable element value with a new one and applies the configuration values.
      Parameters:
      element - the editable element to replace
      value - the new element value
      configJSONObject - the configuration values
    • validate

      default void validate(org.jsoup.nodes.Element element) throws com.liferay.fragment.exception.FragmentEntryContentException
      Validates the editable element.
      Parameters:
      element - the editable element to validate
      Throws:
      com.liferay.fragment.exception.FragmentEntryContentException - if an invalid editable element is detected