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.
  • Field Details

    • VARIABLE_REGEX

      private static final Pattern VARIABLE_REGEX
    • fieldName

      private String fieldName
    • choiceFormat

      private ChoiceFormat choiceFormat
  • Constructor Details

    • 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 Details

    • isGenerated

      public boolean isGenerated(Map params)
      Indicates whether there is any content that is generated by this message part.
      Specified by:
      isGenerated in interface AdvancedMessageFormat.Part
      Parameters:
      params - the parameters to work with
      Returns:
      true if the part has content
    • write

      public void write(StringBuffer sb, Map params)
      Writes the formatted part to a string buffer.
      Specified by:
      write in interface AdvancedMessageFormat.Part
      Parameters:
      sb - the target string buffer
      params - the parameters to work with
    • toString

      public String toString()
      Overrides:
      toString in class Object