Class FoConfiguration


  • public class FoConfiguration
    extends java.lang.Object
    A utility class to construct FO configuration parameters.
    Since:
    1.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.swing.text.MutableAttributeSet attributeSet
      Holds the single attributes.
      private org.apache.commons.configuration2.XMLConfiguration config
      The configuration instance.
      private java.util.List<?> sets
      The list of attribute sets.
    • Constructor Summary

      Constructors 
      Constructor Description
      FoConfiguration()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addAttributes​(java.lang.String attributeId)
      Adds an attribute to the current StringBuilder.
      javax.swing.text.MutableAttributeSet getAttributeSet​(java.lang.String attributeId)
      Builds a set of attributes.
      java.lang.String getAttributeString​(java.lang.String attributeId)
      Builds a list of attributes.
      void load​(java.io.File configFile)
      Load configuration parameters from a File.
      private void loadDefaultConfig()
      Load the default fo configuration file.
      private void reset()
      (Re-)initialize the AttributeSet.
      • Methods inherited from class java.lang.Object

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

      • attributeSet

        private javax.swing.text.MutableAttributeSet attributeSet
        Holds the single attributes.
      • config

        private final org.apache.commons.configuration2.XMLConfiguration config
        The configuration instance.
      • sets

        private java.util.List<?> sets
        The list of attribute sets.
    • Constructor Detail

      • FoConfiguration

        public FoConfiguration()
        Constructor.
    • Method Detail

      • load

        public void load​(java.io.File configFile)
                  throws java.io.IOException
        Load configuration parameters from a File.
        Parameters:
        configFile - the configuration file.
        Throws:
        java.io.IOException - if the File cannot be read or some error occurs when initializing the configuration parameters.
        Since:
        1.1.1
      • getAttributeString

        public java.lang.String getAttributeString​(java.lang.String attributeId)
        Builds a list of attributes.
        Parameters:
        attributeId - A unique id to identify the set of attributes. This should correspond to the name of an attribute-set defined in the configuration file.
        Returns:
        A string that contains a list of attributes with the values configured for the current builder. Returns the empty string if attributeId is null or if attributeId is not a valid identifier.
      • getAttributeSet

        public javax.swing.text.MutableAttributeSet getAttributeSet​(java.lang.String attributeId)
        Builds a set of attributes.
        Parameters:
        attributeId - A unique id to identify the set of attributes. This should correspond to the name of an attribute-set defined in the configuration file.
        Returns:
        A MutableAttributeSet that contains the attributes with the values configured for the current builder. Returns null if attributeId is null or empty, or if attributeId is not a valid identifier.
      • addAttributes

        private void addAttributes​(java.lang.String attributeId)
        Adds an attribute to the current StringBuilder.
        Parameters:
        attributeId - A unique id to identify the set of attributes. This should correspond to the name of an attribute-set defined in the configuration file.
      • loadDefaultConfig

        private void loadDefaultConfig()
        Load the default fo configuration file.
      • reset

        private void reset()
        (Re-)initialize the AttributeSet.