Class LinkParser

  • All Implemented Interfaces:
    ILinkParser
    Direct Known Subclasses:
    DefaultLinkParser

    public class LinkParser
    extends Object
    implements ILinkParser
    This base implementation iterates over all provided ILinkRenderStrategy implementations and applies them to the input text.
    Author:
    Gerolf Seitz
    • Method Detail

      • addLinkRenderStrategy

        public ILinkParser addLinkRenderStrategy​(String pattern,
                                                 ILinkRenderStrategy renderStrategy)
        Adds a render strategy to the parser.
        Parameters:
        pattern - the pattern to which the provided renderStrategy should be applied.
        renderStrategy - the ILinkRenderStrategy which is applied to the text found by the provided pattern.
        Returns:
        this ILinkParser.
      • parse

        public String parse​(String text)
        Description copied from interface: ILinkParser
        Parses the text and changes it according to the provided ILinkRenderStrategy implementations.
        Specified by:
        parse in interface ILinkParser
        Parameters:
        text - the input text which should be modified.
        Returns:
        the modified input text.
        See Also:
        ILinkParser.parse(String)