Class HtmlSimpleEntityParser

java.lang.Object
de.hybris.platform.commons.translator.parsers.AbstractParser
de.hybris.platform.commons.translator.parsers.HtmlSimpleEntityParser

public class HtmlSimpleEntityParser extends AbstractParser
HtmlSimpleEntityParser is an implementation of AbstractParser created for html entities like & nbsp; .
  • Constructor Details

    • HtmlSimpleEntityParser

      public HtmlSimpleEntityParser()
  • Method Details

    • createNode

      public AbstractNode createNode(String start, String end, String text, Translator translator)
      Description copied from class: AbstractParser
      Create AbstractNode instance from a given text
      Specified by:
      createNode in class AbstractParser
      Parameters:
      start - is a String that was found when searching for a start of text that should be used to create node
      end - is a String that was found when searching for a end of text that should be used to create node
      text - text is whole text that was between start and end Strings
      translator - reference to Translator that would be used to search for sub tags in given text
      Returns:
      node that was created from the given text (can be with subnodes if any was found in text)
    • getEndExpression

      public String getEndExpression(String start)
      Specified by:
      getEndExpression in class AbstractParser
      Returns:
      null because there is no separate closing tag for entity.
    • getStartEndExpression

      public String getStartEndExpression()
      return the same result as getStartExpression method. There is no separate closing tag, string that was found as beginning always should be considered as a finish for text from which node would be created
      Specified by:
      getStartEndExpression in class AbstractParser
      Returns:
      regular expression that would be used to check if beginning of text is not also the finishing one ( like br html tag which have no separate closing tag)
    • getStartExpression

      public String getStartExpression()
      Specified by:
      getStartExpression in class AbstractParser
      Returns:
      regular expression that would be used to search for beginning of text from which node would be created