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 Deprecated Methods Modifier and Type Method Description voidaddSubstitution(java.lang.String substitution)Adds the given substitution to this node at the end of the substitution list.voidappend(StructuralNode block)Appends a new child block as the last block to this block.java.util.List<StructuralNode>blocks()Deprecated.java.lang.Objectcontent()Deprecated.java.lang.Stringconvert()java.util.List<StructuralNode>findBy(java.util.Map<java.lang.Object,java.lang.Object> selector)java.util.List<StructuralNode>getBlocks()java.lang.StringgetCaption()java.lang.ObjectgetContent()java.lang.StringgetContentModel()Returns the content model.intgetLevel()CursorgetSourceLocation()Returns the source location of this block.java.lang.StringgetStyle()java.util.List<java.lang.String>getSubstitutions()Returns the list of enabled substitutions.java.lang.StringgetTitle()booleanisSubstitutionEnabled(java.lang.String substitution)voidprependSubstitution(java.lang.String substitution)Adds the given substitution to this node at the beginning of the substitution list.voidremoveSubstitution(java.lang.String substitution)Removes the given substitution from this node.voidsetCaption(java.lang.String caption)voidsetLevel(int level)voidsetStyle(java.lang.String style)voidsetSubstitutions(java.lang.String... substitutions)Sets the given substitutions on this node overwriting all other substitutions.voidsetTitle(java.lang.String title)java.lang.Stringstyle()Deprecated.java.lang.Stringtitle()Deprecated.-
Methods inherited from class org.asciidoctor.jruby.ast.impl.ContentNodeImpl
addRole, context, document, getAttr, getAttr, getAttr, getAttribute, getAttribute, getAttribute, getAttributes, getContext, getDocument, getId, getNodeName, getParent, getReftext, getRole, getRoles, hasAttr, hasAttr, hasAttribute, hasAttribute, hasRole, iconUri, id, imageUri, imageUri, isAttr, isAttr, isAttribute, isAttribute, isBlock, isInline, isOption, isReftext, isRole, mediaUri, normalizeWebPath, parent, readAsset, removeRole, role, setAttr, 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, context, document, getAttr, getAttr, getAttr, getAttribute, getAttribute, getAttribute, getAttributes, getContext, getDocument, getId, getNodeName, getParent, getReftext, getRole, getRoles, hasAttr, hasAttr, hasAttribute, hasAttribute, hasRole, iconUri, id, imageUri, imageUri, isAttr, isAttr, isAttribute, isAttribute, isBlock, isInline, isOption, isReftext, isRole, mediaUri, normalizeWebPath, parent, readAsset, removeRole, role, setAttr, setAttribute, setContext, setId
-
-
-
-
Method Detail
-
title
@Deprecated public java.lang.String title()
Deprecated.- Specified by:
titlein interfaceStructuralNode
-
getTitle
public java.lang.String getTitle()
- Specified by:
getTitlein interfaceStructuralNode
-
setTitle
public void setTitle(java.lang.String title)
- Specified by:
setTitlein interfaceStructuralNode
-
getCaption
public java.lang.String getCaption()
- Specified by:
getCaptionin interfaceStructuralNode
-
setCaption
public void setCaption(java.lang.String caption)
- Specified by:
setCaptionin interfaceStructuralNode
-
style
@Deprecated public java.lang.String style()
Deprecated.- Specified by:
stylein interfaceStructuralNode
-
getStyle
public java.lang.String getStyle()
- Specified by:
getStylein interfaceStructuralNode
-
setStyle
public void setStyle(java.lang.String style)
- Specified by:
setStylein interfaceStructuralNode
-
blocks
@Deprecated public java.util.List<StructuralNode> blocks()
Deprecated.- Specified by:
blocksin interfaceStructuralNode- Returns:
- The list of child blocks of this block
-
getBlocks
public java.util.List<StructuralNode> getBlocks()
- Specified by:
getBlocksin interfaceStructuralNode- Returns:
- The list of child blocks of this block
-
append
public void append(StructuralNode block)
Description copied from interface:StructuralNodeAppends a new child block as the last block to this block.- Specified by:
appendin interfaceStructuralNode- Parameters:
block- The new child block added as last child to this block.
-
content
@Deprecated public java.lang.Object content()
Deprecated.- Specified by:
contentin interfaceStructuralNode
-
getContent
public java.lang.Object getContent()
- Specified by:
getContentin interfaceStructuralNode
-
convert
public java.lang.String convert()
- Specified by:
convertin interfaceStructuralNode
-
getLevel
public int getLevel()
- Specified by:
getLevelin interfaceStructuralNode
-
setLevel
public void setLevel(int level)
- Specified by:
setLevelin interfaceStructuralNode
-
getSourceLocation
public Cursor getSourceLocation()
Description copied from interface:StructuralNodeReturns the source location of this block. This information is only available if thesourcemapoption is enabled when loading or rendering the document.- Specified by:
getSourceLocationin interfaceStructuralNode- Returns:
- the source location of this block or
nullif thesourcemapoption is not enabled when loading the document.
-
getContentModel
public java.lang.String getContentModel()
Description copied from interface:StructuralNodeReturns the content model.- Specified by:
getContentModelin interfaceStructuralNode- Returns:
- the content model
- See Also:
ContentModel
-
getSubstitutions
public java.util.List<java.lang.String> getSubstitutions()
Description copied from interface:StructuralNodeReturns the list of enabled substitutions.- Specified by:
getSubstitutionsin 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:
isSubstitutionEnabledin interfaceStructuralNode- Parameters:
substitution- the name of a substitution, e.g.StructuralNode.SUBSTITUTION_POST_REPLACEMENTS- Returns:
trueif 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:StructuralNodeRemoves the given substitution from this node.- Specified by:
removeSubstitutionin 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:StructuralNodeAdds the given substitution to this node at the end of the substitution list.- Specified by:
addSubstitutionin 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:StructuralNodeAdds the given substitution to this node at the beginning of the substitution list.- Specified by:
prependSubstitutionin 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:StructuralNodeSets the given substitutions on this node overwriting all other substitutions.- Specified by:
setSubstitutionsin 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:
findByin interfaceStructuralNode
-
-