Class Attributes


  • public class Attributes
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static AttributesBuilder builder()  
      boolean isEmpty()  
      java.util.Map<java.lang.String,​java.lang.Object> map()
      Deprecated.
      For internal use only.
      void setAllowUriRead​(boolean allowUriRead)
      Allow Asciidoctor to read content from a URI.
      void setAnchors​(boolean setAnchors)
      Sets setanchor flag.
      void setAppendixCaption​(java.lang.String appendixCaption)
      Defines the prefix added to appendix sections.
      void setAttribute​(java.lang.String attributeName, java.lang.Object attributeValue)  
      void setAttributeMissing​(java.lang.String attributeMissing)
      Define how to handle missing attribute references.
      void setAttributes​(java.lang.String attributes)
      Sets attributes in string form.
      void setAttributes​(java.lang.String... attributes)
      Sets attributes in array form.
      void setAttributes​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
      Adds all attributes.
      void setAttributeUndefined​(java.lang.String attributeUndefined)
      Define how to handle expressions that undefine an attribute.
      void setBackend​(java.lang.String backend)
      Sets the backend attribute.
      void setCacheUri​(boolean cacheUri)
      Enables or disables caching of content read from URIs.
      void setCompatMode​(CompatMode compatMode)
      Sets compat-mode attribute.
      void setCopyCss​(boolean copyCss)
      Sets copy css attribute.
      void setDataUri​(boolean dataUri)
      Sets data-uri attribute.
      void setDocDate​(java.util.Date docDate)
      Sets date in format yyyy-MM-dd
      void setDocTime​(java.util.Date docTime)
      Sets time in format HH:mm:ss z
      void setDocType​(java.lang.String docType)
      Sets the document type, which defines how a document and what parts are rendered.
      void setExperimental​(boolean experimental)
      Sets experimental attribute.
      void setHardbreaks​(boolean hardbreaks)
      Enables or disables preserving of line breaks in a paragraph.
      void setHideUriScheme​(boolean hideUriScheme)
      Enables or disables rendering of the URI scheme when rendering URLs.
      void setIconFontCdn​(java.net.URI cdnUri)
      The URI prefix of the icon font; looks for minified CSS file based on iconfont-name value; used when iconfont-remote is set
      void setIconFontName​(java.lang.String iconFontName)
      The name of the stylesheet in the stylesdir to load (.css extension added automatically)
      void setIconFontRemote​(boolean iconFontRemote)
      Enable icon font remote attribute.
      void setIcons​(java.lang.String iconsName)
      Sets which admonition icons to use.
      void setIconsDir​(java.lang.String iconsDir)
      Sets icons directory.
      void setIgnoreUndefinedAttributes​(boolean ignoreUndefinedAttributes)
      Sets ignore undefined flag so lines are kept when they contain a reference to a missing attribute.
      void setImagesDir​(java.lang.String imagesDir)
      Sets the directory to which images are resolved if the image target is a relative path.
      void setLinkAttrs​(boolean linkAttrs)
      Sets linkattrs attribute.
      void setLinkCss​(boolean linkCss)
      Sets link css attribute.
      void setLocalDate​(java.util.Date localDate)
      Sets date in format yyyy-MM-dd
      void setLocalTime​(java.util.Date localTime)
      Sets time in format HH:mm:ss z
      void setMath​(java.lang.String math)
      Sets the interpreter to use for rendering stems, i.e.
      void setMaxIncludeDepth​(int maxIncludeDepth)
      Defines how many documents can be recursively included.
      void setNoFooter​(boolean noFooter)
      Sets nofooter attribute.
      void setSectionNumbers​(boolean sectionNumbers)
      auto-number section titles.
      void setSectNumLevels​(int sectNumLevels)
      Sets the depth of section numbering.
      void setShowTitle​(boolean showTitle)
      Sets showtitle value as an alias for notitle!
      void setSkipFrontMatter​(boolean skipFrontMatter)
      Skips front matter.
      void setSourceHighlighter​(java.lang.String sourceHighlighter)
      Sets the source highlighter to use for rendering source blocks.
      void setSourceLanguage​(java.lang.String sourceLanguage)
      Globally sets the source language attribute when rendering source blocks.
      void setStylesDir​(java.lang.String stylesDir)
      Sets the styles dir.
      void setStyleSheetName​(java.lang.String styleSheetName)
      Sets stylesheet name.
      void setTableOfContents​(boolean toc)
      Sets if a table of contents should be rendered or not.
      void setTableOfContents​(Placement placement)
      Sets if a table of contents should be rendered or not.
      void setTitle​(java.lang.String title)  
      void setTocLevels​(int levels)
      Sets the amount of levels which should be shown in the toc.
      void setUntitledLabel​(java.lang.String untitledLabel)
      Sets the untitled label value.
      static java.lang.String toAsciidoctorFlag​(boolean flag)  
      void unsetStyleSheet()
      Unsets stylesheet name so document will be generated without style.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • builder

        public static AttributesBuilder builder()
        Returns:
        Empty AttributesBuilder instance.
      • setAllowUriRead

        public void setAllowUriRead​(boolean allowUriRead)
        Allow Asciidoctor to read content from a URI. Additionally, the option SafeMode must be less than SafeMode.SECURE to enable inclusion of content from a URI.
        Parameters:
        allowUriRead - true to enable inclusion of content from a URI
        See Also:
        Include Content by URI
      • setAttributeMissing

        public void setAttributeMissing​(java.lang.String attributeMissing)
        Define how to handle missing attribute references. Possible values are:
        skip leave the reference in place (default setting)
        drop drop the reference, but not the line
        drop-line drop the line on which the reference occurs (compliant behavior)
        warn print a warning about the missing attribute
        Parameters:
        attributeMissing - One of the constants shown in the table above.
        See Also:
        Handle Unresolved References: Missing attribute
      • setAttributeUndefined

        public void setAttributeUndefined​(java.lang.String attributeUndefined)
        Define how to handle expressions that undefine an attribute. Possible values are:
        drop substitute the expression with an empty string after processing it
        drop-line drop the line that contains this expression (default setting and compliant behavior)
        Parameters:
        attributeUndefined - One of the constants shown in the table above.
        See Also:
        Handle Unresolved References: Undefined attribute
      • setBackend

        public void setBackend​(java.lang.String backend)
        Sets the backend attribute.
        Parameters:
        backend - The name of the backend, e.g. docbook.
      • setTitle

        public void setTitle​(java.lang.String title)
      • setDocType

        public void setDocType​(java.lang.String docType)
        Sets the document type, which defines how a document and what parts are rendered. Possible values are:
        • article
        • book
        • inline
        • manpage
        Parameters:
        docType - One of the constants mentioned above.
        See Also:
        Document Type
      • setImagesDir

        public void setImagesDir​(java.lang.String imagesDir)
        Sets the directory to which images are resolved if the image target is a relative path.
        Parameters:
        imagesDir - The name of the directory.
        See Also:
        Set the Images Directory
      • setSourceLanguage

        public void setSourceLanguage​(java.lang.String sourceLanguage)
        Globally sets the source language attribute when rendering source blocks.
        Parameters:
        sourceLanguage - The default source language to use, e.g. Java.
        See Also:
        Source Highlighting: source-language attribute
      • setSourceHighlighter

        public void setSourceHighlighter​(java.lang.String sourceHighlighter)
        Sets the source highlighter to use for rendering source blocks. Possible values are:
        • coderay
        • highlightjs
        • prettify
        Parameters:
        sourceHighlighter - One of the constants mentioned above.
        See Also:
        Source Highlighting: source-highlighter attribute
      • setMaxIncludeDepth

        public void setMaxIncludeDepth​(int maxIncludeDepth)
        Defines how many documents can be recursively included.
        Parameters:
        maxIncludeDepth - A positive integer.
        See Also:
        Security attributes
      • setSectNumLevels

        public void setSectNumLevels​(int sectNumLevels)
        Sets the depth of section numbering. That is if set to 1 only the top level section will be assigned a number. Default is 3.
        Parameters:
        sectNumLevels - A positive integer.
      • setHardbreaks

        public void setHardbreaks​(boolean hardbreaks)
        Enables or disables preserving of line breaks in a paragraph.
        Parameters:
        hardbreaks - true to enable preserving of line breaks in paragraphs
        See Also:
        Hard Line Breaks
      • setCacheUri

        public void setCacheUri​(boolean cacheUri)
        Enables or disables caching of content read from URIs.
        Parameters:
        cacheUri - true to enable caching of content read from URIs
        See Also:
        Caching URI content
      • setHideUriScheme

        public void setHideUriScheme​(boolean hideUriScheme)
        Enables or disables rendering of the URI scheme when rendering URLs.
        Parameters:
        hideUriScheme -
        See Also:
        Hide the URL scheme
      • setAppendixCaption

        public void setAppendixCaption​(java.lang.String appendixCaption)
        Defines the prefix added to appendix sections. The default value is Appendix
        Parameters:
        appendixCaption - The string that is prefixed to the section name in the appendix.
        See Also:
        Appendix
      • setMath

        public void setMath​(java.lang.String math)
        Sets the interpreter to use for rendering stems, i.e. equations and formulas.
        Parameters:
        math - The name of the interpreter, i.e. either asciimath or latexmath.
        See Also:
        Activating STEM support
      • setSkipFrontMatter

        public void setSkipFrontMatter​(boolean skipFrontMatter)
        Skips front matter.
        Parameters:
        skipFrontMatter - value.
      • setAnchors

        public void setAnchors​(boolean setAnchors)
        Sets setanchor flag.
        Parameters:
        setAnchors - value.
      • setUntitledLabel

        public void setUntitledLabel​(java.lang.String untitledLabel)
        Sets the untitled label value.
        Parameters:
        untitledLabel - value.
      • setIgnoreUndefinedAttributes

        public void setIgnoreUndefinedAttributes​(boolean ignoreUndefinedAttributes)
        Sets ignore undefined flag so lines are kept when they contain a reference to a missing attribute.
        Parameters:
        ignoreUndefinedAttributes - value.
      • setTableOfContents

        public void setTableOfContents​(Placement placement)
        Sets if a table of contents should be rendered or not.
        Parameters:
        placement - position of toc.
      • setTocLevels

        public void setTocLevels​(int levels)
        Sets the amount of levels which should be shown in the toc.
        Parameters:
        levels - number of levels which should be shown in the toc.
      • setShowTitle

        public void setShowTitle​(boolean showTitle)
        Sets showtitle value as an alias for notitle!
        Parameters:
        showTitle - value.
      • setTableOfContents

        public void setTableOfContents​(boolean toc)
        Sets if a table of contents should be rendered or not.
        Parameters:
        toc - value.
      • setLocalDate

        public void setLocalDate​(java.util.Date localDate)
        Sets date in format yyyy-MM-dd
        Parameters:
        localDate - object.
      • setLocalTime

        public void setLocalTime​(java.util.Date localTime)
        Sets time in format HH:mm:ss z
        Parameters:
        localTime - object.
      • setDocDate

        public void setDocDate​(java.util.Date docDate)
        Sets date in format yyyy-MM-dd
        Parameters:
        docDate - object.
      • setDocTime

        public void setDocTime​(java.util.Date docTime)
        Sets time in format HH:mm:ss z
        Parameters:
        docTime - object.
      • setStyleSheetName

        public void setStyleSheetName​(java.lang.String styleSheetName)
        Sets stylesheet name.
        Parameters:
        styleSheetName - of css file.
      • unsetStyleSheet

        public void unsetStyleSheet()
        Unsets stylesheet name so document will be generated without style.
      • setStylesDir

        public void setStylesDir​(java.lang.String stylesDir)
        Sets the styles dir.
        Parameters:
        stylesDir - directory.
      • setLinkCss

        public void setLinkCss​(boolean linkCss)
        Sets link css attribute.
        Parameters:
        linkCss - true if css is linked, false if css is embedded.
      • setCopyCss

        public void setCopyCss​(boolean copyCss)
        Sets copy css attribute.
        Parameters:
        copyCss - true if css should be copied to the output location, false otherwise.
      • setIcons

        public void setIcons​(java.lang.String iconsName)
        Sets which admonition icons to use. Attributes.IMAGE_ICONS constant can be used to use the original icons with images or Attributes.FONT_ICONS for font icons (font-awesome).
        Parameters:
        iconsName - value.
      • setIconFontRemote

        public void setIconFontRemote​(boolean iconFontRemote)
        Enable icon font remote attribute. If enabled, will use the iconfont-cdn value to load the icon font URI; if disabled, will use the iconfont-name value to locate the icon font CSS file
        Parameters:
        iconFontRemote - true if attribute enabled false otherwise.
      • setIconFontCdn

        public void setIconFontCdn​(java.net.URI cdnUri)
        The URI prefix of the icon font; looks for minified CSS file based on iconfont-name value; used when iconfont-remote is set
        Parameters:
        cdnUri - uri where css is stored.
      • setIconFontName

        public void setIconFontName​(java.lang.String iconFontName)
        The name of the stylesheet in the stylesdir to load (.css extension added automatically)
        Parameters:
        iconFontName - stylesheet name without .css extension.
      • setDataUri

        public void setDataUri​(boolean dataUri)
        Sets data-uri attribute.
        Parameters:
        dataUri - true if images should be embedded, false otherwise.
      • setIconsDir

        public void setIconsDir​(java.lang.String iconsDir)
        Sets icons directory.
        Parameters:
        iconsDir -
      • setSectionNumbers

        public void setSectionNumbers​(boolean sectionNumbers)
        auto-number section titles.
        Parameters:
        sectionNumbers -
      • setLinkAttrs

        public void setLinkAttrs​(boolean linkAttrs)
        Sets linkattrs attribute.
        Parameters:
        linkAttrs - true if Asciidoctor should parse link macro attributes, false otherwise.
      • setExperimental

        public void setExperimental​(boolean experimental)
        Sets experimental attribute.
        Parameters:
        experimental - true if experimental features should be enabled, false otherwise.
      • setNoFooter

        public void setNoFooter​(boolean noFooter)
        Sets nofooter attribute.
        Parameters:
        noFooter - true if the footer block should not be shown, false otherwise.
      • setCompatMode

        public void setCompatMode​(CompatMode compatMode)
        Sets compat-mode attribute.
        Parameters:
        compatMode - value.
      • setAttribute

        public void setAttribute​(java.lang.String attributeName,
                                 java.lang.Object attributeValue)
      • setAttributes

        public void setAttributes​(java.lang.String attributes)
        Sets attributes in string form. An example of a valid string would be:

        'toc sectnums source-highlighter=coderay'

        where you are adding three attributes: toc, sectnums and source-highlighter with value coderay.
        Parameters:
        attributes - in string format.
      • setAttributes

        public void setAttributes​(java.lang.String... attributes)
        Sets attributes in array form. An example of a valid array would be:

        '['toc', 'sectnums']'

        where you are adding two attributes: toc and sectnums.
        Parameters:
        attributes - in array format.
      • setAttributes

        public void setAttributes​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
        Adds all attributes.
        Parameters:
        attributes - to add.
      • toAsciidoctorFlag

        public static java.lang.String toAsciidoctorFlag​(boolean flag)
      • isEmpty

        public boolean isEmpty()
      • map

        @Deprecated
        public java.util.Map<java.lang.String,​java.lang.Object> map()
        Deprecated.
        For internal use only.