Package org.asciidoctor.jruby.ast.impl
Class StructuralNodeImpl
- java.lang.Object
-
- org.asciidoctor.jruby.internal.RubyObjectWrapper
-
- org.asciidoctor.jruby.ast.impl.ContentNodeImpl
-
- org.asciidoctor.jruby.ast.impl.StructuralNodeImpl
-
- All Implemented Interfaces:
ContentNode
,StructuralNode
- Direct Known Subclasses:
BlockImpl
,CellImpl
,DescriptionListEntryImpl
,DescriptionListImpl
,DocumentImpl
,ListImpl
,ListItemImpl
,SectionImpl
,TableImpl
public class StructuralNodeImpl extends ContentNodeImpl implements StructuralNode
-
-
Field Summary
-
Fields inherited from class org.asciidoctor.jruby.internal.RubyObjectWrapper
rubyNode, runtime
-
Fields inherited from interface org.asciidoctor.ast.StructuralNode
SUBSTITUTION_ATTRIBUTES, SUBSTITUTION_MACROS, SUBSTITUTION_POST_REPLACEMENTS, SUBSTITUTION_QUOTES, SUBSTITUTION_REPLACEMENTS, SUBSTITUTION_SPECIAL_CHARACTERS
-
-
Constructor Summary
Constructors Constructor Description StructuralNodeImpl(org.jruby.runtime.builtin.IRubyObject blockDelegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSubstitution(java.lang.String substitution)
Adds the given substitution to this node at the end of the substitution list.void
append(StructuralNode block)
Appends a new child block as the last block to this block.java.lang.String
convert()
java.util.List<StructuralNode>
findBy(java.util.Map<java.lang.Object,java.lang.Object> selector)
java.util.List<StructuralNode>
getBlocks()
java.lang.String
getCaption()
java.lang.Object
getContent()
java.lang.String
getContentModel()
Returns the content model.int
getLevel()
Cursor
getSourceLocation()
Returns the source location of this block.java.lang.String
getStyle()
java.util.List<java.lang.String>
getSubstitutions()
Returns the list of enabled substitutions.java.lang.String
getTitle()
boolean
isSubstitutionEnabled(java.lang.String substitution)
void
prependSubstitution(java.lang.String substitution)
Adds the given substitution to this node at the beginning of the substitution list.void
removeSubstitution(java.lang.String substitution)
Removes the given substitution from this node.void
setCaption(java.lang.String caption)
void
setLevel(int level)
void
setStyle(java.lang.String style)
void
setSubstitutions(java.lang.String... substitutions)
Sets the given substitutions on this node overwriting all other substitutions.void
setTitle(java.lang.String title)
-
Methods inherited from class org.asciidoctor.jruby.ast.impl.ContentNodeImpl
addRole, getAttribute, getAttribute, getAttribute, getAttributes, getContext, getDocument, getId, getNodeName, getParent, getReftext, getRole, getRoles, hasAttribute, hasAttribute, hasRole, iconUri, imageUri, imageUri, isAttribute, isAttribute, isBlock, isInline, isOption, isReftext, isRole, mediaUri, normalizeWebPath, readAsset, removeRole, setAttribute, setContext, setId
-
Methods inherited from class org.asciidoctor.jruby.internal.RubyObjectWrapper
getBoolean, getInt, getList, getProperty, getRubyObject, getRubyProperty, getRuntime, getString, getSymbol, setBoolean, setInt, setRubyProperty, setString, setSymbol, toJava, toJava
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.asciidoctor.ast.ContentNode
addRole, getAttribute, getAttribute, getAttribute, getAttributes, getContext, getDocument, getId, getNodeName, getParent, getReftext, getRole, getRoles, hasAttribute, hasAttribute, hasRole, iconUri, imageUri, imageUri, isAttribute, isAttribute, isBlock, isInline, isOption, isReftext, isRole, mediaUri, normalizeWebPath, readAsset, removeRole, setAttribute, setContext, setId
-
-
-
-
Method Detail
-
getTitle
public java.lang.String getTitle()
- Specified by:
getTitle
in interfaceStructuralNode
-
setTitle
public void setTitle(java.lang.String title)
- Specified by:
setTitle
in interfaceStructuralNode
-
getCaption
public java.lang.String getCaption()
- Specified by:
getCaption
in interfaceStructuralNode
-
setCaption
public void setCaption(java.lang.String caption)
- Specified by:
setCaption
in interfaceStructuralNode
-
getStyle
public java.lang.String getStyle()
- Specified by:
getStyle
in interfaceStructuralNode
-
setStyle
public void setStyle(java.lang.String style)
- Specified by:
setStyle
in interfaceStructuralNode
-
getBlocks
public java.util.List<StructuralNode> getBlocks()
- Specified by:
getBlocks
in interfaceStructuralNode
- Returns:
- The list of child blocks of this block
-
append
public void append(StructuralNode block)
Description copied from interface:StructuralNode
Appends a new child block as the last block to this block.- Specified by:
append
in interfaceStructuralNode
- Parameters:
block
- The new child block added as last child to this block.
-
getContent
public java.lang.Object getContent()
- Specified by:
getContent
in interfaceStructuralNode
-
convert
public java.lang.String convert()
- Specified by:
convert
in interfaceStructuralNode
-
getLevel
public int getLevel()
- Specified by:
getLevel
in interfaceStructuralNode
-
setLevel
public void setLevel(int level)
- Specified by:
setLevel
in interfaceStructuralNode
-
getSourceLocation
public Cursor getSourceLocation()
Description copied from interface:StructuralNode
Returns the source location of this block. This information is only available if thesourcemap
option is enabled when loading or rendering the document.- Specified by:
getSourceLocation
in interfaceStructuralNode
- Returns:
- the source location of this block or
null
if thesourcemap
option is not enabled when loading the document.
-
getContentModel
public java.lang.String getContentModel()
Description copied from interface:StructuralNode
Returns the content model.- Specified by:
getContentModel
in interfaceStructuralNode
- Returns:
- the content model
- See Also:
ContentModel
-
getSubstitutions
public java.util.List<java.lang.String> getSubstitutions()
Description copied from interface:StructuralNode
Returns the list of enabled substitutions.- Specified by:
getSubstitutions
in interfaceStructuralNode
- Returns:
- A list of substitutions enabled for this node, e.g.
["specialcharacters", "quotes", "attributes", "replacements", "macros", "post_replacements"]
for paragraphs. - See Also:
- Asciidoctor User Manual
-
isSubstitutionEnabled
public boolean isSubstitutionEnabled(java.lang.String substitution)
- Specified by:
isSubstitutionEnabled
in interfaceStructuralNode
- Parameters:
substitution
- the name of a substitution, e.g.StructuralNode.SUBSTITUTION_POST_REPLACEMENTS
- Returns:
true
if the name of the given substitution is enabled.- See Also:
- Asciidoctor User Manual
-
removeSubstitution
public void removeSubstitution(java.lang.String substitution)
Description copied from interface:StructuralNode
Removes the given substitution from this node.- Specified by:
removeSubstitution
in interfaceStructuralNode
- Parameters:
substitution
- the name of a substitution, e.g.StructuralNode.SUBSTITUTION_QUOTES
- See Also:
- Substitutions
-
addSubstitution
public void addSubstitution(java.lang.String substitution)
Description copied from interface:StructuralNode
Adds the given substitution to this node at the end of the substitution list.- Specified by:
addSubstitution
in interfaceStructuralNode
- Parameters:
substitution
- the name of a substitution, e.g.StructuralNode.SUBSTITUTION_MACROS
- See Also:
- Substitutions
-
prependSubstitution
public void prependSubstitution(java.lang.String substitution)
Description copied from interface:StructuralNode
Adds the given substitution to this node at the beginning of the substitution list.- Specified by:
prependSubstitution
in interfaceStructuralNode
- Parameters:
substitution
- the name of a substitution, e.g.StructuralNode.SUBSTITUTION_ATTRIBUTES
- See Also:
- Substitutions
-
setSubstitutions
public void setSubstitutions(java.lang.String... substitutions)
Description copied from interface:StructuralNode
Sets the given substitutions on this node overwriting all other substitutions.- Specified by:
setSubstitutions
in interfaceStructuralNode
- Parameters:
substitutions
- the name of a substitution, e.g.StructuralNode.SUBSTITUTION_SPECIAL_CHARACTERS
- See Also:
- Substitutions
-
findBy
public java.util.List<StructuralNode> findBy(java.util.Map<java.lang.Object,java.lang.Object> selector)
- Specified by:
findBy
in interfaceStructuralNode
-
-