Class Profiler

java.lang.Object
org.forgerock.doc.maven.utils.Profiler

public class Profiler extends Object
Offers an alternative to DocBook profiling.
docbkx-tools relies on support in the DocBook XSL distribution, which does not appear to include profiling support for webhelp output (v1.78.1). docbkx-tools also handles the profiling in the same pass as the build, meaning that dangling links might result in the built output.
This implementation can be used to handle profiling (conditional text) during pre-processing. Build tools and validators then need not deal with DocBook profiles.
  • Constructor Details

    • Profiler

      public Profiler(Map<String,String> inclusions, Map<String,String> exclusions)
      Constructs a profiler based on a profile inclusions configuration.
      The profile maps do not restrict the keys (attribute names) to those supported by DocBook profiling.
      Parameters:
      inclusions - Profile map: keys == attr names; values == attr values. Lists of attr values must be space-separated. If no inclusions are specified, set this to null.
      exclusions - Profile map: keys == attr names; values == attr values. Lists of attr values must be space-separated. If no exclusions are specified, set this to null.
  • Method Details

    • applyProfiles

      public void applyProfiles(File xmlSourceDirectory) throws IOException
      Applies inclusions and exclusions if any to the XML files under the source directory.
      This method changes the files in place, so the source should be a modifiable copy.
      Parameters:
      xmlSourceDirectory - Source directory for XML files to profile.
      Throws:
      IOException - Failed to transform an XML file.