Package org.apache.fop.util.text
Class ChoiceFieldPart
java.lang.Object
org.apache.fop.util.text.ChoiceFieldPart
- All Implemented Interfaces:
AdvancedMessageFormat.Part
Defines a "choice" field part that works like
ChoiceFormat
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Factory for ChoiceFieldPart. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChoiceFormat
private String
private static final Pattern
-
Constructor Summary
ConstructorsConstructorDescriptionChoiceFieldPart
(String fieldName, String choicesPattern) Creates a new choice part. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isGenerated
(Map params) Indicates whether there is any content that is generated by this message part.toString()
void
write
(StringBuffer sb, Map params) Writes the formatted part to a string buffer.
-
Field Details
-
VARIABLE_REGEX
-
fieldName
-
choiceFormat
-
-
Constructor Details
-
ChoiceFieldPart
Creates a new choice part.- Parameters:
fieldName
- the field name to work onchoicesPattern
- the choices pattern (as used byChoiceFormat
)
-
-
Method Details
-
isGenerated
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
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
-