Class NonBreakPointsEnhancer

java.lang.Object
org.xhtmlrenderer.fop.nbsp.NonBreakPointsEnhancer

public class NonBreakPointsEnhancer extends Object
Processes text and replaces spaces by non-break spaces ( ) on places designated by the language definition file. Language definition files should be located on classpath in the directory "non-break-spaces/${langKey}.nbsp". If lang key contains '_', in first run we search for whole lang key and if not found for part of the lang key before '_'. Encoding of the nbsp file must be utf8. Language definition file consist of line per each rule. Line contains regexp pattern with three groups. Second group will be replaced by  . First and second will be copied and are used to match the selection properly. Ex.: "([\\s]+and)( )([^\\s]+)" will replace "this and something else" with "this and something else" so and will not be left hanging at the end of the line. Rules are applied to the content in the order as they appear in the file and result of one rule run is used as input for the next run. Lines starting with '#' and empty lines are skipped and can be used as comments.
  • Field Details

  • Constructor Details

    • NonBreakPointsEnhancer

      public NonBreakPointsEnhancer()
    • NonBreakPointsEnhancer

      NonBreakPointsEnhancer(NonBreakPointsLoader loader)
  • Method Details