Enum MarkdownSink.ElementContext
- java.lang.Object
-
- java.lang.Enum<MarkdownSink.ElementContext>
-
- org.apache.maven.doxia.module.markdown.MarkdownSink.ElementContext
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<MarkdownSink.ElementContext>
- Enclosing class:
- MarkdownSink
static enum MarkdownSink.ElementContext extends java.lang.Enum<MarkdownSink.ElementContext>
Most important contextual metadata (of the surrounding element)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classMarkdownSink.ElementContext.Type
-
Enum Constant Summary
Enum Constants Enum Constant Description BLOCKQUOTEBODYCODE_BLOCKCODE_SPANFIGUREHEADLIST_ITEMTABLE_CAPTIONTABLE_CELL
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.function.UnaryOperator<java.lang.String>escapeFunctionThe function to call to escape the given text.(package private) java.lang.Stringname(package private) java.lang.Stringprefixprefix to be used for a (nested) block elements inside the current container context (only not empty fortypebeingMarkdownSink.ElementContext.Type.CONTAINER_BLOCK)(package private) booleanrequiresBufferingiftruerequires buffering any text appearing inside this context(package private) booleanrequiresSurroundingByBlankLinesOnly relevant for block element, if set totruethe element requires to be surrounded by blank lines.(package private) MarkdownSink.ElementContext.Typetypetrueif block element, otherwisefalsefor inline elements
-
Constructor Summary
Constructors Modifier Constructor Description privateElementContext(java.lang.String name, MarkdownSink.ElementContext.Type type, java.util.function.UnaryOperator<java.lang.String> escapeFunction)privateElementContext(java.lang.String name, MarkdownSink.ElementContext.Type type, java.util.function.UnaryOperator<java.lang.String> escapeFunction, boolean requiresBuffering)privateElementContext(java.lang.String name, MarkdownSink.ElementContext.Type type, java.util.function.UnaryOperator<java.lang.String> escapeFunction, boolean requiresBuffering, java.lang.String prefix)privateElementContext(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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.Stringescape(java.lang.String text)Must be called for each inline text to be emitted directly within this context (not relevant for nested context)(package private) booleanisBlock()(package private) booleanisContainer()static MarkdownSink.ElementContextvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static MarkdownSink.ElementContext[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
HEAD
public static final MarkdownSink.ElementContext HEAD
-
BODY
public static final MarkdownSink.ElementContext BODY
-
FIGURE
public static final MarkdownSink.ElementContext FIGURE
-
CODE_BLOCK
public static final MarkdownSink.ElementContext CODE_BLOCK
-
CODE_SPAN
public static final MarkdownSink.ElementContext CODE_SPAN
-
TABLE_CAPTION
public static final MarkdownSink.ElementContext TABLE_CAPTION
-
TABLE_CELL
public static final MarkdownSink.ElementContext TABLE_CELL
-
LIST_ITEM
public static final MarkdownSink.ElementContext LIST_ITEM
-
BLOCKQUOTE
public static final MarkdownSink.ElementContext BLOCKQUOTE
-
-
Field Detail
-
name
final java.lang.String name
-
type
final MarkdownSink.ElementContext.Type type
trueif block element, otherwisefalsefor inline elements
-
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
iftruerequires buffering any text appearing inside this context
-
prefix
final java.lang.String prefix
prefix to be used for a (nested) block elements inside the current container context (only not empty fortypebeingMarkdownSink.ElementContext.Type.CONTAINER_BLOCK)
-
requiresSurroundingByBlankLines
final boolean requiresSurroundingByBlankLines
Only relevant for block element, if set totruethe 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 namejava.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
textwhen no escaping is necessary)
-
isBlock
boolean isBlock()
- Returns:
truefor all block types,falseotherwise
-
isContainer
boolean isContainer()
- Returns:
truefor all containers (allowing block elements as children),falseotherwise
-
-