Class FormattingElementsConfiguration

java.lang.Object
com.deltaxml.ditamerge.FormattingElementsConfiguration

public class FormattingElementsConfiguration extends Object

Formatting Elements are DITA elements whose primary purpose is to affect the rendering style of their text contents. Normally, Formatting Elements occur as 'inline' elements, that is, children of 'block' elements that contain mixed-content (i.e. elements and text).

This class provides various settings for specifying the formatting elements.

DITA Merge provides the default list of DITA elements which will be marked as formatting elements if the formatting elements are enabled. The formatting elements processing will be enabled when FormattingElementsConfiguration is set on the merge object.

The default list is "apiname, b, cite, cmdname, codeph, filepath, i, lines, msgnum, msgph, parmname, pre, q, sep, sub, sup, systemoutput, term, tm, tt, u, uicontrol, userinput, var, wintitle". This list can be updated using the methods from this class.

  • Constructor Details

    • FormattingElementsConfiguration

      public FormattingElementsConfiguration()
      Constructs FormattingElementConfiguration.
  • Method Details

    • enableFormattingElements

      public void enableFormattingElements(boolean value)
      This method is used to enable or disable formatting elements processing By default, the formatting elements processing is disabled.
      Parameters:
      value - a boolean value to enable/disable formatting elements
    • isFormattingElementsEnabled

      public boolean isFormattingElementsEnabled()
      Returns true if formatting elements processing is enabled.
      Returns:
      a boolean value
    • setFormattingElements

      public void setFormattingElements(Set<String> value) throws IllegalArgumentException

      Sets the list of formatting elements. This setting overrides the built in list of formatting elements.

      The built in list is shown in the default.

      Default: "apiname, b, cite, cmdname, codeph, filepath, i, lines, msgnum, msgph, parmname, pre, q, sep, sub, sup, systemoutput, term, tm, tt, u, uicontrol, userinput, var, wintitle"

      Parameters:
      value - a set of formatting element names
      Throws:
      IllegalArgumentException - if the value is null
    • getFormattingElements

      public Set<String> getFormattingElements()

      Returns the set of formatting element names.

      Returns:
      a set of formatting element names
    • addFormattingElements

      public void addFormattingElements(Set<String> value) throws IllegalArgumentException

      A set of formatting element names, which will be added to the value of the formatting elements list.

      Parameters:
      value - a set of formatting element names to be added to existing list
      Throws:
      IllegalArgumentException - if the value is null
    • removeFormattingElements

      public void removeFormattingElements(Set<String> value) throws IllegalArgumentException

      A set of formatting element names, which will be removed from the value of the formatting elements list.

      Parameters:
      value - a set of formatting element names to be removed from existing list
      Throws:
      IllegalArgumentException - if the value is null