Package org.apache.fop.util.text
Class IfFieldPart
java.lang.Object
org.apache.fop.util.text.IfFieldPart
- All Implemented Interfaces:
org.apache.fop.util.text.AdvancedMessageFormat.Part
- Direct Known Subclasses:
EqualsFieldPart
public class IfFieldPart
extends Object
implements org.apache.fop.util.text.AdvancedMessageFormat.Part
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}
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isGenerated
(Map params) protected boolean
Indicates whether the field's value is true.protected void
parseValues
(String values) Parses the parameter valuestoString()
void
write
(StringBuffer sb, Map params)
-
Field Details
-
fieldName
the field name for the part -
ifValue
the value being returned if the field is true -
elseValue
the value being returned if the field is false
-
-
Constructor Details
-
IfFieldPart
Creates a new "if" field part.- Parameters:
fieldName
- the field namevalues
- the unparsed parameter values
-
-
Method Details
-
parseValues
Parses the parameter values- Parameters:
values
- the unparsed parameter values
-
write
- Specified by:
write
in interfaceorg.apache.fop.util.text.AdvancedMessageFormat.Part
-
isTrue
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
- Specified by:
isGenerated
in interfaceorg.apache.fop.util.text.AdvancedMessageFormat.Part
-
toString
-