Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
config |
static java.lang.String |
CONTENT_MODEL_EMPTY |
Constructor and Description |
---|
JRubyProcessor() |
JRubyProcessor(java.util.Map<java.lang.String,java.lang.Object> config) |
Modifier and Type | Method and Description |
---|---|
Block |
createBlock(StructuralNode parent,
java.lang.String context,
java.util.List<java.lang.String> content) |
Block |
createBlock(StructuralNode parent,
java.lang.String context,
java.util.List<java.lang.String> content,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
Block |
createBlock(StructuralNode parent,
java.lang.String context,
java.util.List<java.lang.String> content,
java.util.Map<java.lang.String,java.lang.Object> attributes,
java.util.Map<java.lang.Object,java.lang.Object> options) |
Block |
createBlock(StructuralNode parent,
java.lang.String context,
java.util.Map<java.lang.Object,java.lang.Object> options) |
Block |
createBlock(StructuralNode parent,
java.lang.String context,
java.lang.String content) |
Block |
createBlock(StructuralNode parent,
java.lang.String context,
java.lang.String content,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
Block |
createBlock(StructuralNode parent,
java.lang.String context,
java.lang.String content,
java.util.Map<java.lang.String,java.lang.Object> attributes,
java.util.Map<java.lang.Object,java.lang.Object> options) |
Document |
createDocument(Document parentDocument)
Creates an inner document for the given parent document.
|
List |
createList(StructuralNode parent,
java.lang.String context)
Creates a new List.
|
List |
createList(StructuralNode parent,
java.lang.String context,
java.util.Map<java.lang.Object,java.lang.Object> options)
Creates a new List.
|
List |
createList(StructuralNode parent,
java.lang.String context,
java.util.Map<java.lang.String,java.lang.Object> attributes,
java.util.Map<java.lang.Object,java.lang.Object> options)
Creates a new List.
|
ListItem |
createListItem(DescriptionList parent,
java.lang.String text) |
ListItem |
createListItem(List parent,
java.lang.String text) |
PhraseNode |
createPhraseNode(ContentNode parent,
java.lang.String context,
java.util.List<java.lang.String> text) |
PhraseNode |
createPhraseNode(ContentNode parent,
java.lang.String context,
java.util.List<java.lang.String> text,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
PhraseNode |
createPhraseNode(ContentNode parent,
java.lang.String context,
java.util.List<java.lang.String> text,
java.util.Map<java.lang.String,java.lang.Object> attributes,
java.util.Map<java.lang.Object,java.lang.Object> options) |
PhraseNode |
createPhraseNode(ContentNode parent,
java.lang.String context,
java.lang.String text) |
PhraseNode |
createPhraseNode(ContentNode parent,
java.lang.String context,
java.lang.String text,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
PhraseNode |
createPhraseNode(ContentNode parent,
java.lang.String context,
java.lang.String text,
java.util.Map<java.lang.String,java.lang.Object> attributes,
java.util.Map<java.lang.String,java.lang.Object> options) |
Section |
createSection(StructuralNode parent) |
Section |
createSection(StructuralNode parent,
boolean numbered,
java.util.Map<java.lang.Object,java.lang.Object> options) |
Section |
createSection(StructuralNode parent,
int level,
boolean numbered,
java.util.Map<java.lang.Object,java.lang.Object> options) |
Section |
createSection(StructuralNode parent,
java.lang.Integer level,
boolean numbered,
java.util.Map<java.lang.Object,java.lang.Object> options) |
Section |
createSection(StructuralNode parent,
java.util.Map<java.lang.Object,java.lang.Object> options) |
Table |
createTable(StructuralNode parent) |
Table |
createTable(StructuralNode parent,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
Cell |
createTableCell(Column column,
Document innerDocument) |
Cell |
createTableCell(Column column,
Document innerDocument,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
Cell |
createTableCell(Column column,
java.lang.String text) |
Cell |
createTableCell(Column column,
java.lang.String text,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
Column |
createTableColumn(Table parent,
int index) |
Column |
createTableColumn(Table parent,
int index,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
Row |
createTableRow(Table parent) |
JRubyAsciidoctor |
getAsciidoctor() |
java.util.Map<java.lang.String,java.lang.Object> |
getConfig() |
void |
log(LogRecord logRecord) |
void |
parseContent(StructuralNode parent,
java.util.List<java.lang.String> lines)
Parses the given raw asciidoctor content, parses it and appends it as children to the given parent block.
|
void |
setAsciidoctor(JRubyAsciidoctor asciidoctor) |
void |
setConfig(java.util.Map<java.lang.String,java.lang.Object> config) |
void |
setConfigFinalized() |
<T> T |
unwrap(java.lang.Class<T> clazz) |
void |
updateConfig(java.util.Map<java.lang.String,java.lang.Object> config) |
public static final java.lang.String CONTENT_MODEL_EMPTY
protected java.util.Map<java.lang.String,java.lang.Object> config
public JRubyProcessor()
public JRubyProcessor(java.util.Map<java.lang.String,java.lang.Object> config)
public java.util.Map<java.lang.String,java.lang.Object> getConfig()
public final void setConfig(java.util.Map<java.lang.String,java.lang.Object> config)
public final void updateConfig(java.util.Map<java.lang.String,java.lang.Object> config)
updateConfig
in interface Processor
public final void setConfigFinalized()
public Table createTable(StructuralNode parent)
createTable
in interface Processor
public Table createTable(StructuralNode parent, java.util.Map<java.lang.String,java.lang.Object> attributes)
createTable
in interface Processor
public Row createTableRow(Table parent)
createTableRow
in interface Processor
public Column createTableColumn(Table parent, int index, java.util.Map<java.lang.String,java.lang.Object> attributes)
createTableColumn
in interface Processor
public Cell createTableCell(Column column, Document innerDocument, java.util.Map<java.lang.String,java.lang.Object> attributes)
createTableCell
in interface Processor
public Cell createTableCell(Column column, java.lang.String text, java.util.Map<java.lang.String,java.lang.Object> attributes)
createTableCell
in interface Processor
public Block createBlock(StructuralNode parent, java.lang.String context, java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.Object,java.lang.Object> options)
createBlock
in interface Processor
public Block createBlock(StructuralNode parent, java.lang.String context, java.util.List<java.lang.String> content, java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.Object,java.lang.Object> options)
createBlock
in interface Processor
public PhraseNode createPhraseNode(ContentNode parent, java.lang.String context, java.util.List<java.lang.String> text, java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.Object,java.lang.Object> options)
createPhraseNode
in interface Processor
public PhraseNode createPhraseNode(ContentNode parent, java.lang.String context, java.lang.String text, java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.String,java.lang.Object> options)
createPhraseNode
in interface Processor
public Block createBlock(StructuralNode parent, java.lang.String context, java.util.Map<java.lang.Object,java.lang.Object> options)
createBlock
in interface Processor
public Section createSection(StructuralNode parent, java.lang.Integer level, boolean numbered, java.util.Map<java.lang.Object,java.lang.Object> options)
createSection
in interface Processor
public Document createDocument(Document parentDocument)
asciidoc
.createDocument
in interface Processor
parentDocument
- The parent document of the new document.public List createList(StructuralNode parent, java.lang.String context)
Processor
createList
in interface Processor
parent
- The block to which the parsed content should be added as children.context
- Either "olist"
, ulist
, colist
or dlist
public List createList(StructuralNode parent, java.lang.String context, java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.Object,java.lang.Object> options)
Processor
createList
in interface Processor
parent
- The block to which the parsed content should be added as children.context
- Either "olist"
, ulist
, colist
or dlist
attributes
- Additional attributes to be set on the new list node, e.g. Collections.singletonMap("start", "2")
.options
- Additional options to be set on the new list node.public List createList(StructuralNode parent, java.lang.String context, java.util.Map<java.lang.Object,java.lang.Object> options)
Processor
createList
in interface Processor
parent
- The block to which the parsed content should be added as children.context
- Either "olist"
, ulist
, colist
or dlist
options
- Additional options to be set on the new list node.public ListItem createListItem(List parent, java.lang.String text)
createListItem
in interface Processor
public ListItem createListItem(DescriptionList parent, java.lang.String text)
createListItem
in interface Processor
public void parseContent(StructuralNode parent, java.util.List<java.lang.String> lines)
The following example will add two paragraphs with the role newcontent
to all top
level sections of a document:
Asciidoctor asciidoctor = ... asciidoctor.javaExtensionRegistry().treeprocessor(new Treeprocessor() { DocumentRuby process(DocumentRuby document) { for (AbstractBlock block: document.getBlocks()) { if (block instanceof Section) { parseContent(block, Arrays.asList(new String[]{ "[newcontent]", "This is new content" "", "[newcontent]", "This is also new content"})); } } } });
parseContent
in interface Processor
parent
- The block to which the parsed content should be added as children.lines
- Raw asciidoctor contentpublic Column createTableColumn(Table parent, int index)
createTableColumn
in interface Processor
public Cell createTableCell(Column column, java.lang.String text)
createTableCell
in interface Processor
public Cell createTableCell(Column column, Document innerDocument)
createTableCell
in interface Processor
public Block createBlock(StructuralNode parent, java.lang.String context, java.lang.String content)
createBlock
in interface Processor
public Block createBlock(StructuralNode parent, java.lang.String context, java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> attributes)
createBlock
in interface Processor
public Block createBlock(StructuralNode parent, java.lang.String context, java.util.List<java.lang.String> content)
createBlock
in interface Processor
public Block createBlock(StructuralNode parent, java.lang.String context, java.util.List<java.lang.String> content, java.util.Map<java.lang.String,java.lang.Object> attributes)
createBlock
in interface Processor
public Section createSection(StructuralNode parent)
createSection
in interface Processor
public Section createSection(StructuralNode parent, java.util.Map<java.lang.Object,java.lang.Object> options)
createSection
in interface Processor
public Section createSection(StructuralNode parent, boolean numbered, java.util.Map<java.lang.Object,java.lang.Object> options)
createSection
in interface Processor
public Section createSection(StructuralNode parent, int level, boolean numbered, java.util.Map<java.lang.Object,java.lang.Object> options)
createSection
in interface Processor
public PhraseNode createPhraseNode(ContentNode parent, java.lang.String context, java.util.List<java.lang.String> text)
createPhraseNode
in interface Processor
public PhraseNode createPhraseNode(ContentNode parent, java.lang.String context, java.util.List<java.lang.String> text, java.util.Map<java.lang.String,java.lang.Object> attributes)
createPhraseNode
in interface Processor
public PhraseNode createPhraseNode(ContentNode parent, java.lang.String context, java.lang.String text)
createPhraseNode
in interface Processor
public PhraseNode createPhraseNode(ContentNode parent, java.lang.String context, java.lang.String text, java.util.Map<java.lang.String,java.lang.Object> attributes)
createPhraseNode
in interface Processor
public JRubyAsciidoctor getAsciidoctor()
public void setAsciidoctor(JRubyAsciidoctor asciidoctor)