Class IfFieldPart

java.lang.Object
org.apache.fop.util.text.IfFieldPart
Direct Known Subclasses:
EqualsFieldPart

public class IfFieldPart extends Object
Defines an "if" field part that checks if field's value is true or false. It returns either of two possible values attached as additional part parameters. Example: {field,if,Yes,No}
  • Field Details

    • fieldName

      protected String fieldName
      the field name for the part
    • ifValue

      protected String ifValue
      the value being returned if the field is true
    • elseValue

      protected String elseValue
      the value being returned if the field is false
  • Constructor Details

    • IfFieldPart

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

    • parseValues

      protected void parseValues(String values)
      Parses the parameter values
      Parameters:
      values - the unparsed parameter values
    • write

      public void write(StringBuffer sb, Map params)
    • 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.
      Parameters:
      params - the message parameters
      Returns:
      true the field's value as boolean
    • isGenerated

      public boolean isGenerated(Map params)
    • toString

      public String toString()
      Overrides:
      toString in class Object