org.apache.fop.layoutmgr

## Class WhitespaceManagementPenalty

- java.lang.Object
- - org.apache.fop.layoutmgr.ListElement
  - - org.apache.fop.layoutmgr.KnuthElement
    - - org.apache.fop.layoutmgr.KnuthPenalty
      - - org.apache.fop.layoutmgr.WhitespaceManagementPenalty

-     public class WhitespaceManagementPenalty
      extends KnuthPenalty

  A special penalty used to specify content having multiple variants. At most only one variant will be inserted into the final document. If none of the variants fit into the remaining space on the current page, the dynamic content will be completely ignored.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `WhitespaceManagementPenalty.Variant`

  - ### Field Summary

    - ### Fields inherited from class org.apache.fop.layoutmgr.KnuthPenalty

      `DUMMY_ZERO_PENALTY, FLAGGED_PENALTY`

    - ### Fields inherited from class org.apache.fop.layoutmgr.KnuthElement

      `INFINITE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WhitespaceManagementPenalty(org.apache.fop.layoutmgr.MultiSwitchLayoutManager.WhitespaceManagementPosition pos)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addVariant(WhitespaceManagementPenalty.Variant variant)`
    `java.util.List<WhitespaceManagementPenalty.Variant>` | `getVariants()`
    `boolean` | `hasActiveVariant()`
    `void` | `setActiveVariant(WhitespaceManagementPenalty.Variant bestVariant)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class org.apache.fop.layoutmgr.KnuthPenalty

      `getBreakClass, getPenalty, isForcedBreak, isPenalty, isPenaltyFlagged, setPenalty, valueOf`

    - ### Methods inherited from class org.apache.fop.layoutmgr.KnuthElement

      `getShrink, getStretch, getWidth, isAuxiliary, isUnresolvedElement`

    - ### Methods inherited from class org.apache.fop.layoutmgr.ListElement

      `getLayoutManager, getPosition, isBox, isGlue, setPosition`

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

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

- - ### Constructor Detail

    - #### WhitespaceManagementPenalty

          public WhitespaceManagementPenalty(org.apache.fop.layoutmgr.MultiSwitchLayoutManager.WhitespaceManagementPosition pos)

  - ### Method Detail

    - #### addVariant

          public void addVariant(WhitespaceManagementPenalty.Variant variant)

    - #### setActiveVariant

          public void setActiveVariant(WhitespaceManagementPenalty.Variant bestVariant)

    - #### hasActiveVariant

          public boolean hasActiveVariant()

    - #### getVariants

          public java.util.List<WhitespaceManagementPenalty.Variant> getVariants()

    - #### toString

          public java.lang.String toString()

      Description copied from class: `KnuthPenalty`
      Overrides:
        `toString` in class `KnuthPenalty`

Copyright 1999-2019 The Apache Software Foundation. All Rights Reserved.