Class TextConverterBaseImpl

java.lang.Object
de.hybris.platform.sap.productconfig.runtime.interf.impl.TextConverterBaseImpl
All Implemented Interfaces:
TextConverterBase

public class TextConverterBaseImpl extends Object implements TextConverterBase
Default implementation of the TextConverterBase
Note: This class will remove any markup from the ITF-Text, as this an potential attack vector. In case it is desired to display formatted ITF-Texts on the UI, this class needs to be enhanced/replaced. One should specify a white list of allowed markup for formatting.
  • Constructor Details

    • TextConverterBaseImpl

      public TextConverterBaseImpl()
  • Method Details

    • convertLongText

      public String convertLongText(String formattedText)
      Description copied from interface: TextConverterBase
      Removes all meta text elements (bold, underline, etc.) out of the long text value, provided by the knowledge base.
      Specified by:
      convertLongText in interface TextConverterBase
      Parameters:
      formattedText - The text to be cleansed
      Returns:
      The converted text, which will be shown in the web frontend
    • removeFormatting

      protected String removeFormatting(String formattedText)
    • removeMarkup

      protected String removeMarkup(String markup)
    • extractSection

      protected String extractSection(String textWithSections)
    • deEscapeString

      protected String deEscapeString(String escapedString)
    • replaceDoubleQuotes

      protected String replaceDoubleQuotes(String singleQuotes)