Class HtmlSimpleEntityParser


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

      • HtmlSimpleEntityParser

        public HtmlSimpleEntityParser()
    • Method Detail

      • createNode

        public AbstractNode createNode​(java.lang.String start,
                                       java.lang.String end,
                                       java.lang.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 java.lang.String getEndExpression​(java.lang.String start)
        Specified by:
        getEndExpression in class AbstractParser
        Returns:
        null because there is no separate closing tag for entity.
      • getStartEndExpression

        public java.lang.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 java.lang.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