Package com.ibm.icu.message2
Class MessageFormatter.Builder
- java.lang.Object
-
- com.ibm.icu.message2.MessageFormatter.Builder
-
- Enclosing class:
- MessageFormatter
@Deprecated public static class MessageFormatter.Builder extends java.lang.Object
Deprecated.This API is for technology preview only.ABuilder
used to build instances ofMessageFormatter
.
-
-
Field Summary
Fields Modifier and Type Field Description private MFDataModel.Message
dataModel
Deprecated.private MessageFormatter.ErrorHandlingBehavior
errorHandlingBehavior
Deprecated.private MFFunctionRegistry
functionRegistry
Deprecated.private java.util.Locale
locale
Deprecated.private java.lang.String
pattern
Deprecated.
-
Constructor Summary
Constructors Modifier Constructor Description private
Builder()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MessageFormatter
build()
Deprecated.This API is for technology preview only.MessageFormatter.Builder
setDataModel(MFDataModel.Message dataModel)
Deprecated.This API is for technology preview only.MessageFormatter.Builder
setErrorHandlingBehavior(MessageFormatter.ErrorHandlingBehavior errorHandlingBehavior)
Deprecated.This API is for technology preview only.MessageFormatter.Builder
setFunctionRegistry(MFFunctionRegistry functionRegistry)
Deprecated.This API is for technology preview only.MessageFormatter.Builder
setLocale(java.util.Locale locale)
Deprecated.This API is for technology preview only.MessageFormatter.Builder
setPattern(java.lang.String pattern)
Deprecated.This API is for technology preview only.
-
-
-
Field Detail
-
locale
private java.util.Locale locale
Deprecated.
-
pattern
private java.lang.String pattern
Deprecated.
-
errorHandlingBehavior
private MessageFormatter.ErrorHandlingBehavior errorHandlingBehavior
Deprecated.
-
functionRegistry
private MFFunctionRegistry functionRegistry
Deprecated.
-
dataModel
private MFDataModel.Message dataModel
Deprecated.
-
-
Method Detail
-
setLocale
@Deprecated public MessageFormatter.Builder setLocale(java.util.Locale locale)
Deprecated.This API is for technology preview only.Sets the locale to use for all formatting and selection operations.- Parameters:
locale
- the locale to set.- Returns:
- the builder, for fluent use.
-
setPattern
@Deprecated public MessageFormatter.Builder setPattern(java.lang.String pattern)
Deprecated.This API is for technology preview only.Sets the pattern (in MessageFormat 2 syntax) used to create the message.
It conflicts with the data model, so it will reset it (the last call on setter wins).- Parameters:
pattern
- the pattern to set.- Returns:
- the builder, for fluent use.
-
setErrorHandlingBehavior
@Deprecated public MessageFormatter.Builder setErrorHandlingBehavior(MessageFormatter.ErrorHandlingBehavior errorHandlingBehavior)
Deprecated.This API is for technology preview only.Sets theMessageFormatter.ErrorHandlingBehavior
to use when encountering errors at formatting time.The default value is
ErrorHandlingBehavior.BEST_EFFORT
, trying to fallback.- Parameters:
the
- error handling behavior to use.- Returns:
- the builder, for fluent use.
-
setFunctionRegistry
@Deprecated public MessageFormatter.Builder setFunctionRegistry(MFFunctionRegistry functionRegistry)
Deprecated.This API is for technology preview only.Sets an instance ofMFFunctionRegistry
that should register any custom functions used by the message.There is no need to do this in order to use standard functions (for example date / time / number formatting, plural / ordinal / literal selection).
The exact set of standard functions, with the types they format and the options they accept is still TBD.- Parameters:
functionRegistry
- the function registry to set.- Returns:
- the builder, for fluent use.
-
setDataModel
@Deprecated public MessageFormatter.Builder setDataModel(MFDataModel.Message dataModel)
Deprecated.This API is for technology preview only.Sets the data model used to create the message.
It conflicts with the pattern, so it will reset it (the last call on setter wins).- Parameters:
dataModel
- the pattern to set.- Returns:
- the builder, for fluent use.
-
build
@Deprecated public MessageFormatter build()
Deprecated.This API is for technology preview only.Builds an instance ofMessageFormatter
.- Returns:
- the
MessageFormatter
created.
-
-