org.apache.fop.apps

## Class FopFactoryBuilder

- java.lang.Object
- - org.apache.fop.apps.FopFactoryBuilder

-     public final class FopFactoryBuilder
      extends Object

  This is the builder class for `FopFactory`. Setters can be chained to make building a `FopFactory` object more concise and intuitive e.g.

       FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(<URI>)
                                                        .setURIResolver(<URIResolver>)
                                                        .setPageHeight(<String>)
                                                        .setPageWidth(<String>)
                                                        .setStrictUserConfigValidation(<boolean>)
                                                          ... etc ...
       FopFactory fopFactory = fopFactoryBuilder.build();

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FopFactoryBuilder.FopFactoryConfigImpl`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FopFactoryBuilder(EnvironmentProfile enviro)` A builder class for `FopFactory` which can be used for setting configuration.
    `FopFactoryBuilder(URI defaultBaseURI)` A builder class for `FopFactory` which can be used for setting configuration.
    `FopFactoryBuilder(URI defaultBaseURI, org.apache.xmlgraphics.io.ResourceResolver resourceResolver)` A builder class for `FopFactory` which can be used for setting configuration.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `FopFactory` | `build()` Builds an instance of the the `FopFactory`.
    `FopFactoryConfig` | `buildConfig()` Deprecated. Exposing the `FopFactoryConfig` is only to maintain backwards compatibility
    `FontManager` | `getFontManager()` Returns the `FontManager` used for managing the fonts within FOP.
    `org.apache.xmlgraphics.image.loader.ImageManager` | `getImageManager()` Return the `ImageManager` used for handling images through out FOP.
    `FopFactoryBuilder` | `ignoreNamespace(String namespaceURI)` FOP will ignore the specified XML element namespace.
    `FopFactoryBuilder` | `ignoreNamespaces(Collection<String> namespaceURIs)` FOP will ignore the colletion of XML element namespaces.
    `FopFactoryBuilder` | `setAccessibility(boolean enableAccessibility)` Sets whether to include accessibility features in document creation.
    `FopFactoryBuilder` | `setBaseURI(URI baseURI)` Sets the base URI, this will be used for resolving all URIs given to FOP.
    `FopFactoryBuilder` | `setBreakIndentInheritanceOnReferenceAreaBoundary(boolean value)` Sets whether the indent inheritance should be broken when crossing reference area boundaries.
    `FopFactoryBuilder` | `setComplexScriptFeatures(boolean csf)`
    `FopFactoryBuilder` | `setConfiguration(Configuration cfg)` Sets the Avalon configuration if a FOP conf is used.
    `protected FopFactoryBuilder` | `setConfiguration(Configuration cfg, boolean parse)`
    `FopFactoryBuilder` | `setHyphenBaseResourceResolver(InternalResourceResolver hyphenationResourceResolver)`
    `FopFactoryBuilder` | `setHyphPatNames(Map<String,String> hyphPatNames)`
    `FopFactoryBuilder` | `setKeepEmptyTags(boolean b)`
    `FopFactoryBuilder` | `setLayoutManagerMakerOverride(LayoutManagerMaker lmMaker)` Sets the `LayoutManagerMaker` so that users can configure how FOP creates `LayoutManager`s.
    `FopFactoryBuilder` | `setPageHeight(String pageHeight)` Sets the page height of the paginated output.
    `FopFactoryBuilder` | `setPageWidth(String pageWidth)` Sets the page width of the paginated output.
    `FopFactoryBuilder` | `setPreferRenderer(boolean preferRenderer)` Sets whether to chose a `Renderer` in preference to an `IFDocumentHandler`.
    `FopFactoryBuilder` | `setSimpleLineBreaking(boolean b)`
    `FopFactoryBuilder` | `setSkipPagePositionOnlyAllowed(boolean b)`
    `FopFactoryBuilder` | `setSourceResolution(float dpi)` Sets the resolution of resolution-dependent input.
    `FopFactoryBuilder` | `setStrictFOValidation(boolean validateStrictly)` Sets whether to perform strict validation on the FO used.
    `FopFactoryBuilder` | `setStrictUserConfigValidation(boolean validateStrictly)` Sets whether to perform strict alidation on the user-configuration.
    `FopFactoryBuilder` | `setTableBorderOverpaint(boolean b)`
    `FopFactoryBuilder` | `setTargetResolution(float dpi)` Sets the resolution of resolution-dependent output.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FopFactoryBuilder

          public FopFactoryBuilder(URI defaultBaseURI)

      A builder class for `FopFactory` which can be used for setting configuration. This is a helper constructor that uses the default URI resolver implementation that FOP packages provide.
      Parameters:
        `defaultBaseURI` - the default base URI for resolving URIs against

    - #### FopFactoryBuilder

          public FopFactoryBuilder(URI defaultBaseURI,
                                   org.apache.xmlgraphics.io.ResourceResolver resourceResolver)

      A builder class for `FopFactory` which can be used for setting configuration.
      Parameters:
        `defaultBaseURI` - the default base URI for resolving URIs against
        `resourceResolver` - the URI resolver

    - #### FopFactoryBuilder

          public FopFactoryBuilder(EnvironmentProfile enviro)

      A builder class for `FopFactory` which can be used for setting configuration.
      Parameters:
        `enviro` - the profile of the FOP deployment environment

  - ### Method Detail

    - #### buildConfig

          public FopFactoryConfig buildConfig()

      Deprecated. Exposing the `FopFactoryConfig` is only to maintain backwards compatibility
      Returns the `FopFactoryConfig` which is needed to get an instance of `FopFactory`.
      Returns:
        build the `FopFactoryConfig`

    - #### build

          public FopFactory build()

      Builds an instance of the the `FopFactory`.
      Returns:
        the FopFactory instance

    - #### getFontManager

          public FontManager getFontManager()

      Returns the `FontManager` used for managing the fonts within FOP.
      Returns:
        the font managing object

    - #### getImageManager

          public org.apache.xmlgraphics.image.loader.ImageManager getImageManager()

      Return the `ImageManager` used for handling images through out FOP.
      Returns:
        the image manager

    - #### setAccessibility

          public FopFactoryBuilder setAccessibility(boolean enableAccessibility)

      Sets whether to include accessibility features in document creation.
      Parameters:
        `enableAccessibility` - true to set accessibility on
      Returns:
        `this`

    - #### setKeepEmptyTags

          public FopFactoryBuilder setKeepEmptyTags(boolean b)

    - #### setLayoutManagerMakerOverride

          public FopFactoryBuilder setLayoutManagerMakerOverride(LayoutManagerMaker lmMaker)

      Sets the `LayoutManagerMaker` so that users can configure how FOP creates `LayoutManager`s.
      Parameters:
        `lmMaker` - he layout manager maker
      Returns:
        `this`

    - #### setBaseURI

          public FopFactoryBuilder setBaseURI(URI baseURI)

      Sets the base URI, this will be used for resolving all URIs given to FOP.
      Parameters:
        `baseURI` - the base URI
      Returns:
        `this`

    - #### setHyphenBaseResourceResolver

          public FopFactoryBuilder setHyphenBaseResourceResolver(InternalResourceResolver hyphenationResourceResolver)

    - #### setStrictFOValidation

          public FopFactoryBuilder setStrictFOValidation(boolean validateStrictly)

      Sets whether to perform strict validation on the FO used.
      Parameters:
        `validateStrictly` - true if the FO is to be strictly validated
      Returns:
        `this`

    - #### setStrictUserConfigValidation

          public FopFactoryBuilder setStrictUserConfigValidation(boolean validateStrictly)

      Sets whether to perform strict alidation on the user-configuration.
      Parameters:
        `validateStrictly` - true if the fop conf is to be strictly validated
      Returns:
        `this`

    - #### setBreakIndentInheritanceOnReferenceAreaBoundary

          public FopFactoryBuilder setBreakIndentInheritanceOnReferenceAreaBoundary(boolean value)

      Sets whether the indent inheritance should be broken when crossing reference area boundaries.
      Parameters:
        `value` - true to break inheritance when crossing reference area boundaries
      Returns:
        `this`

    - #### setSourceResolution

          public FopFactoryBuilder setSourceResolution(float dpi)

      Sets the resolution of resolution-dependent input.
      Parameters:
        `dpi` - the source resolution
      Returns:
        `this`

    - #### setTargetResolution

          public FopFactoryBuilder setTargetResolution(float dpi)

      Sets the resolution of resolution-dependent output.
      Parameters:
        `dpi` - the target resolution
      Returns:
        `this`

    - #### setPageHeight

          public FopFactoryBuilder setPageHeight(String pageHeight)

      Sets the page height of the paginated output.
      Parameters:
        `pageHeight` - the page height
      Returns:
        `this`

    - #### setPageWidth

          public FopFactoryBuilder setPageWidth(String pageWidth)

      Sets the page width of the paginated output.
      Parameters:
        `pageWidth` - the page width
      Returns:
        `this`

    - #### ignoreNamespace

          public FopFactoryBuilder ignoreNamespace(String namespaceURI)

      FOP will ignore the specified XML element namespace.
      Parameters:
        `namespaceURI` - the namespace URI to ignore
      Returns:
        `this`

    - #### ignoreNamespaces

          public FopFactoryBuilder ignoreNamespaces(Collection<String> namespaceURIs)

      FOP will ignore the colletion of XML element namespaces.
      Parameters:
        `namespaceURIs` - a collection of namespace URIs to ignore
      Returns:
        `this`

    - #### setConfiguration

          public FopFactoryBuilder setConfiguration(Configuration cfg)

      Sets the Avalon configuration if a FOP conf is used.
      Parameters:
        `cfg` - the fop conf configuration
      Returns:
        `this`

    - #### setConfiguration

          protected FopFactoryBuilder setConfiguration(Configuration cfg,
                                                       boolean parse)

    - #### setPreferRenderer

          public FopFactoryBuilder setPreferRenderer(boolean preferRenderer)

      Sets whether to chose a `Renderer` in preference to an `IFDocumentHandler`.
      Parameters:
        `preferRenderer` - true to prefer `Renderer`
      Returns:
        `this`

    - #### setComplexScriptFeatures

          public FopFactoryBuilder setComplexScriptFeatures(boolean csf)

    - #### setHyphPatNames

          public FopFactoryBuilder setHyphPatNames(Map<String,String> hyphPatNames)

    - #### setTableBorderOverpaint

          public FopFactoryBuilder setTableBorderOverpaint(boolean b)

    - #### setSimpleLineBreaking

          public FopFactoryBuilder setSimpleLineBreaking(boolean b)

    - #### setSkipPagePositionOnlyAllowed

          public FopFactoryBuilder setSkipPagePositionOnlyAllowed(boolean b)

Copyright © 2023 Apache Software Foundation. All rights reserved.