Package org.asciidoctor.jruby.ast.impl
Class DocumentImpl
- java.lang.Object
-
- org.asciidoctor.jruby.internal.RubyObjectWrapper
-
- org.asciidoctor.jruby.ast.impl.ContentNodeImpl
-
- org.asciidoctor.jruby.ast.impl.StructuralNodeImpl
-
- org.asciidoctor.jruby.ast.impl.DocumentImpl
-
- All Implemented Interfaces:
ContentNode,Document,StructuralNode
public class DocumentImpl extends StructuralNodeImpl implements Document
-
-
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 DocumentImpl(org.jruby.runtime.builtin.IRubyObject document)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAndIncrementCounter(java.lang.String name)Gets the current counter with the given name and increases its value.intgetAndIncrementCounter(java.lang.String name, int initialValue)Gets the current counter with the given name and increases its value.java.util.List<Author>getAuthors()Gets the author(s) information as defined in the author line in the document header, or in author & email attributes.CataloggetCatalog()The catalog contains data collected by asciidoctor that is useful to a converter.java.lang.StringgetDoctitle()java.util.Map<java.lang.Object,java.lang.Object>getOptions()RevisionInfogetRevisionInfo()The revision information with: date, number and remark.java.lang.StringgetSource()Make the raw source for the Document available.java.util.List<java.lang.String>getSourceLines()Make the raw source lines for the Document available.TitlegetStructuredDoctitle()booleanisBasebackend(java.lang.String backend)booleanisSourcemap()voidsetSourcemap(boolean state)Toggles the sourcemap option.-
Methods inherited from class org.asciidoctor.jruby.ast.impl.StructuralNodeImpl
addSubstitution, append, convert, findBy, getBlocks, getCaption, getContent, getContentModel, getLevel, getSourceLocation, getStyle, getSubstitutions, getTitle, isSubstitutionEnabled, prependSubstitution, removeSubstitution, setCaption, setLevel, setStyle, setSubstitutions, setTitle
-
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
-
Methods inherited from interface org.asciidoctor.ast.StructuralNode
addSubstitution, append, convert, findBy, getBlocks, getCaption, getContent, getContentModel, getLevel, getSourceLocation, getStyle, getSubstitutions, getTitle, isSubstitutionEnabled, prependSubstitution, removeSubstitution, setCaption, setLevel, setStyle, setSubstitutions, setTitle
-
-
-
-
Method Detail
-
getSource
public java.lang.String getSource()
Description copied from interface:DocumentMake the raw source for the Document available. Trailing white characters (spaces, line breaks, etc.) are removed.
-
getSourceLines
public java.util.List<java.lang.String> getSourceLines()
Description copied from interface:DocumentMake the raw source lines for the Document available.- Specified by:
getSourceLinesin interfaceDocument- Returns:
- Raw content as List
-
isBasebackend
public boolean isBasebackend(java.lang.String backend)
- Specified by:
isBasebackendin interfaceDocument- Returns:
- 'basebackend' attribute value
-
getOptions
public java.util.Map<java.lang.Object,java.lang.Object> getOptions()
- Specified by:
getOptionsin interfaceDocument- Returns:
- Options defined in the document
-
getStructuredDoctitle
public Title getStructuredDoctitle()
- Specified by:
getStructuredDoctitlein interfaceDocument- Returns:
- The Title structure for this document.
- See Also:
Title
-
getDoctitle
public java.lang.String getDoctitle()
- Specified by:
getDoctitlein interfaceDocument- Returns:
- The title as a String.
- See Also:
Title
-
getAuthors
public java.util.List<Author> getAuthors()
Description copied from interface:DocumentGets the author(s) information as defined in the author line in the document header, or in author & email attributes.- Specified by:
getAuthorsin interfaceDocument- Returns:
- The authors information
- See Also:
Author
-
getAndIncrementCounter
public int getAndIncrementCounter(java.lang.String name)
Description copied from interface:DocumentGets the current counter with the given name and increases its value. At the first invocation the counter will return 1. After the call the value of the counter is set to the returned value plus 1.- Specified by:
getAndIncrementCounterin interfaceDocument- Parameters:
name- name of the counter- Returns:
- Value before increment plus 1
-
getAndIncrementCounter
public int getAndIncrementCounter(java.lang.String name, int initialValue)Description copied from interface:DocumentGets the current counter with the given name and increases its value. At the first invocation the counter will return the given initial value. After the call the value of the counter is set to the returned value plus 1.- Specified by:
getAndIncrementCounterin interfaceDocument- Parameters:
name- name of the counterinitialValue- value to start counter from- Returns:
- Value before increment plus 1
-
isSourcemap
public boolean isSourcemap()
- Specified by:
isSourcemapin interfaceDocument- Returns:
- Whether the sourcemap is enabled
-
setSourcemap
public void setSourcemap(boolean state)
Description copied from interface:DocumentToggles the sourcemap option.This method must be called before the document is parsed, such as from a Preprocessor extension. Otherwise, it has no effect.
- Specified by:
setSourcemapin interfaceDocument- Parameters:
state- State in which to put the sourcemap (true = on, false = off)
-
getCatalog
public Catalog getCatalog()
Description copied from interface:DocumentThe catalog contains data collected by asciidoctor that is useful to a converter.- Specified by:
getCatalogin interfaceDocument- Returns:
- Catalog assets
- See Also:
Catalog
-
getRevisionInfo
public RevisionInfo getRevisionInfo()
Description copied from interface:DocumentThe revision information with: date, number and remark.- Specified by:
getRevisionInfoin interfaceDocument- Returns:
- revisionInfo
- See Also:
RevisionInfo
-
-