Class EqualsFieldPart

java.lang.Object
org.apache.fop.util.text.IfFieldPart
org.apache.fop.util.text.EqualsFieldPart
All Implemented Interfaces:
org.apache.fop.util.text.AdvancedMessageFormat.Part

public class EqualsFieldPart extends IfFieldPart
Defines an "equals" field part that can compare a field's string value against another string. It returns either of two possible values attached as additional part parameters. Example: {field,equals,new,This is new!,This is old!}
  • Constructor Details

    • EqualsFieldPart

      public EqualsFieldPart(String fieldName, String values)
      Creates a new "equals" field part.
      Parameters:
      fieldName - the field name
      values - the unparsed parameter values
  • Method Details

    • parseValues

      protected void parseValues(String values)
      Parses the parameter values
      Overrides:
      parseValues in class IfFieldPart
      Parameters:
      values - the unparsed parameter values
    • isTrue

      protected boolean isTrue(Map params)
      Indicates whether the field's value is true. If the field is not a boolen, it is true if the field is not null.
      Overrides:
      isTrue in class IfFieldPart
      Parameters:
      params - the message parameters
      Returns:
      true the field's value as boolean
    • toString

      public String toString()
      Overrides:
      toString in class IfFieldPart