Package org.apache.fop.util.text
Class ChoiceFieldPart
- java.lang.Object
-
- org.apache.fop.util.text.ChoiceFieldPart
-
- All Implemented Interfaces:
AdvancedMessageFormat.Part
public class ChoiceFieldPart extends java.lang.Object implements AdvancedMessageFormat.Part
Defines a "choice" field part that works likeChoiceFormat
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChoiceFieldPart.Factory
Factory for ChoiceFieldPart.
-
Field Summary
Fields Modifier and Type Field Description private java.text.ChoiceFormat
choiceFormat
private java.lang.String
fieldName
private static java.util.regex.Pattern
VARIABLE_REGEX
-
Constructor Summary
Constructors Constructor Description ChoiceFieldPart(java.lang.String fieldName, java.lang.String choicesPattern)
Creates a new choice part.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isGenerated(java.util.Map params)
Indicates whether there is any content that is generated by this message part.java.lang.String
toString()
void
write(java.lang.StringBuffer sb, java.util.Map params)
Writes the formatted part to a string buffer.
-
-
-
Method Detail
-
isGenerated
public boolean isGenerated(java.util.Map params)
Indicates whether there is any content that is generated by this message part.- Specified by:
isGenerated
in interfaceAdvancedMessageFormat.Part
- Parameters:
params
- the parameters to work with- Returns:
- true if the part has content
-
write
public void write(java.lang.StringBuffer sb, java.util.Map params)
Writes the formatted part to a string buffer.- Specified by:
write
in interfaceAdvancedMessageFormat.Part
- Parameters:
sb
- the target string bufferparams
- the parameters to work with
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-