org.apache.fop.util.text

## Class ChoiceFieldPart

- java.lang.Object
- - org.apache.fop.util.text.ChoiceFieldPart

- All Implemented Interfaces:
    AdvancedMessageFormat.Part

      public class ChoiceFieldPart
      extends Object
      implements AdvancedMessageFormat.Part

  Defines a "choice" field part that works like `ChoiceFormat`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ChoiceFieldPart.Factory` Factory for ChoiceFieldPart.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChoiceFieldPart(String fieldName, String choicesPattern)` Creates a new choice part.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isGenerated(Map params)`
    `String` | `toString()`
    `void` | `write(StringBuffer sb, Map params)`

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

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

- - ### Constructor Detail

    - #### ChoiceFieldPart

          public ChoiceFieldPart(String fieldName,
                                 String choicesPattern)

      Creates a new choice part.
      Parameters:
        `fieldName` - the field name to work on
        `choicesPattern` - the choices pattern (as used by `ChoiceFormat`)

  - ### Method Detail

    - #### isGenerated

          public boolean isGenerated(Map params)

      Specified by:
        `isGenerated` in interface `AdvancedMessageFormat.Part`

    - #### write

          public void write(StringBuffer sb,
                            Map params)

      Specified by:
        `write` in interface `AdvancedMessageFormat.Part`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2025 Apache Software Foundation. All rights reserved.