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 java.lang.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
Nested Classes Modifier and Type Class Description static class
IfFieldPart.Factory
Part factory for "if".
-
Constructor Summary
Constructors Constructor Description IfFieldPart(java.lang.String fieldName, java.lang.String values)
Creates a new "if" field part.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isGenerated(java.util.Map params)
protected boolean
isTrue(java.util.Map params)
Indicates whether the field's value is true.protected void
parseValues(java.lang.String values)
Parses the parameter valuesjava.lang.String
toString()
void
write(java.lang.StringBuffer sb, java.util.Map params)
-
-
-
Method Detail
-
parseValues
protected void parseValues(java.lang.String values)
Parses the parameter values- Parameters:
values
- the unparsed parameter values
-
write
public void write(java.lang.StringBuffer sb, java.util.Map params)
- Specified by:
write
in interfaceorg.apache.fop.util.text.AdvancedMessageFormat.Part
-
isTrue
protected boolean isTrue(java.util.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(java.util.Map params)
- Specified by:
isGenerated
in interfaceorg.apache.fop.util.text.AdvancedMessageFormat.Part
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-