Enum MarkdownSink.ElementContext
java.lang.Object
java.lang.Enum<MarkdownSink.ElementContext>
org.apache.maven.doxia.module.markdown.MarkdownSink.ElementContext
- All Implemented Interfaces:
Serializable
,Comparable<MarkdownSink.ElementContext>
- Enclosing class:
MarkdownSink
Most important contextual metadata (of the surrounding element)
-
Nested Class Summary
Nested Classes -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final UnaryOperator
<String> The function to call to escape the given text.(package private) final String
(package private) final String
prefix to be used for a (nested) block elements inside the current container context (only not empty fortype
beingMarkdownSink.ElementContext.Type.CONTAINER_BLOCK
)(package private) final boolean
iftrue
requires buffering any text appearing inside this context(package private) final boolean
Only relevant for block element, if set totrue
the element requires to be surrounded by blank lines.(package private) final MarkdownSink.ElementContext.Type
true
if block element, otherwisefalse
for inline elements -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ElementContext
(String name, MarkdownSink.ElementContext.Type type, UnaryOperator<String> escapeFunction) private
ElementContext
(String name, MarkdownSink.ElementContext.Type type, UnaryOperator<String> escapeFunction, boolean requiresBuffering) private
ElementContext
(String name, MarkdownSink.ElementContext.Type type, UnaryOperator<String> escapeFunction, boolean requiresBuffering, String prefix) private
ElementContext
(String name, MarkdownSink.ElementContext.Type type, UnaryOperator<String> escapeFunction, boolean requiresBuffering, String prefix, boolean requiresSurroundingByBlankLines) -
Method Summary
Modifier and TypeMethodDescription(package private) String
Must be called for each inline text to be emitted directly within this context (not relevant for nested context)(package private) boolean
isBlock()
(package private) boolean
static MarkdownSink.ElementContext
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 Details
-
HEAD
-
BODY
-
FIGURE
-
CODE_BLOCK
-
CODE_SPAN
-
TABLE_CAPTION
-
TABLE_CELL
-
LIST_ITEM
-
BLOCKQUOTE
-
-
Field Details
-
name
-
type
true
if block element, otherwisefalse
for inline elements -
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 requiresBufferingiftrue
requires buffering any text appearing inside this context -
prefix
prefix to be used for a (nested) block elements inside the current container context (only not empty fortype
beingMarkdownSink.ElementContext.Type.CONTAINER_BLOCK
) -
requiresSurroundingByBlankLines
final boolean requiresSurroundingByBlankLinesOnly relevant for block element, if set totrue
the element requires to be surrounded by blank lines.
-
-
Constructor Details
-
ElementContext
private ElementContext(String name, MarkdownSink.ElementContext.Type type, UnaryOperator<String> escapeFunction) -
ElementContext
private ElementContext(String name, MarkdownSink.ElementContext.Type type, UnaryOperator<String> escapeFunction, boolean requiresBuffering) -
ElementContext
private ElementContext(String name, MarkdownSink.ElementContext.Type type, UnaryOperator<String> escapeFunction, boolean requiresBuffering, String prefix) -
ElementContext
private ElementContext(String name, MarkdownSink.ElementContext.Type type, UnaryOperator<String> escapeFunction, boolean requiresBuffering, String prefix, boolean requiresSurroundingByBlankLines)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
escape
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
-