Enum MarkdownSink.ElementContext

    • Field Detail

      • name

        final java.lang.String name
      • escapeFunction

        final java.util.function.UnaryOperator<java.lang.String> escapeFunction
        The function to call to escape the given text. The function is supposed to return the escaped text or return just the given text if no escaping is necessary in this context
      • requiresBuffering

        final boolean requiresBuffering
        if true requires buffering any text appearing inside this context
      • requiresSurroundingByBlankLines

        final boolean requiresSurroundingByBlankLines
        Only relevant for block element, if set to true the element requires to be surrounded by blank lines.
    • Constructor Detail

      • ElementContext

        private ElementContext​(java.lang.String name,
                               MarkdownSink.ElementContext.Type type,
                               java.util.function.UnaryOperator<java.lang.String> escapeFunction)
      • ElementContext

        private ElementContext​(java.lang.String name,
                               MarkdownSink.ElementContext.Type type,
                               java.util.function.UnaryOperator<java.lang.String> escapeFunction,
                               boolean requiresBuffering)
      • ElementContext

        private ElementContext​(java.lang.String name,
                               MarkdownSink.ElementContext.Type type,
                               java.util.function.UnaryOperator<java.lang.String> escapeFunction,
                               boolean requiresBuffering,
                               java.lang.String prefix)
      • ElementContext

        private ElementContext​(java.lang.String name,
                               MarkdownSink.ElementContext.Type type,
                               java.util.function.UnaryOperator<java.lang.String> escapeFunction,
                               boolean requiresBuffering,
                               java.lang.String prefix,
                               boolean requiresSurroundingByBlankLines)
    • Method Detail

      • values

        public static MarkdownSink.ElementContext[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MarkdownSink.ElementContext c : MarkdownSink.ElementContext.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MarkdownSink.ElementContext valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • escape

        java.lang.String escape​(java.lang.String text)
        Must be called for each inline text to be emitted directly within this context (not relevant for nested context)
        Parameters:
        text -
        Returns:
        the escaped text (may be same as text when no escaping is necessary)
      • isBlock

        boolean isBlock()
        Returns:
        true for all block types, false otherwise
      • isContainer

        boolean isContainer()
        Returns:
        true for all containers (allowing block elements as children), false otherwise