Top Description Inners Fields Constructors Methods
com.ibm.icu.message2

public Class Mf2FunctionRegistry

extends Object
Class Inheritance
Annotations
@Deprecated
Imports
java.util.HashMap, .Map, .Set

Deprecated

This API is for technology preview only.

This class is used to register mappings between various function names and the factories that can create those functions.

For example to add formatting for a Person object one would need to:

ICU Status
Internal ICU component: 72 technology preview

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Mf2FunctionRegistry.Builder

Deprecated This API is for technology preview only.
A Builder used to build instances of Mf2FunctionRegistry.

Field Summary

Modifier and TypeField and Description
private final Map<Class<?>, String>
private final Map<String, FormatterFactory>
private final Map<String, SelectorFactory>

Constructor Summary

AccessConstructor and Description
private
Mf2FunctionRegistry(Mf2FunctionRegistry.Builder builder)

Deprecated as a consequence of Mf2FunctionRegistry.Builder being deprecated.

Method Summary

Modifier and TypeMethod and Description
public static Mf2FunctionRegistry.Builder

Returns:

the Builder.
builder
()

Deprecated This API is for technology preview only.
Creates a builder.
public String

Returns:

the name of the formatter class, if registered. Returns null otherwise.
getDefaultFormatterNameForType
(Class<?>
the class of the object to format.
clazz
)

Deprecated This API is for technology preview only.
Returns the name of the formatter used to format an object of type clazz.
public Set<Class<?>>

Returns:

a set of all the known classes that have mapping to function names.
getDefaultFormatterTypes
()

Deprecated This API is for technology preview only.
Get all know classes that have a mappings from class to function name.
public FormatterFactory

Returns:

the factory creating formatters for name. Returns null if none is registered.
getFormatter
(String
the function name.
formatterName
)

Deprecated This API is for technology preview only.
Returns the formatter factory used to create the formatter for function named name.
public Set<String>

Returns:

a set of all the known formatter names.
getFormatterNames
()

Deprecated This API is for technology preview only.
Get all know names that have a mappings from name to FormatterFactory.
public SelectorFactory

Returns:

the factory creating selectors for name. Returns null if none is registered.
getSelector
(String
the selector name.
selectorName
)

Deprecated This API is for technology preview only.
Returns the selector factory used to create the selector for function named name.
public Set<String>

Returns:

a set of all the known selector names.
getSelectorNames
()

Deprecated This API is for technology preview only.
Get all know names that have a mappings from name to SelectorFactory.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classToFormatterback to summary
private final Map<Class<?>, String> classToFormatter
formattersMapback to summary
private final Map<String, FormatterFactory> formattersMap
selectorsMapback to summary
private final Map<String, SelectorFactory> selectorsMap

Constructor Detail

Mf2FunctionRegistryback to summary
private Mf2FunctionRegistry(Mf2FunctionRegistry.Builder builder)

Deprecated

as a consequence of Mf2FunctionRegistry.Builder being deprecated. See corresponding docs for further information.

Method Detail

builderback to summary
public static Mf2FunctionRegistry.Builder builder()

Deprecated

This API is for technology preview only.

Creates a builder.

Returns:Mf2FunctionRegistry.Builder

the Builder.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
getDefaultFormatterNameForTypeback to summary
public String getDefaultFormatterNameForType(Class<?> clazz)

Deprecated

This API is for technology preview only.

Returns the name of the formatter used to format an object of type clazz.

Parameters
clazz:Class<?>

the class of the object to format.

Returns:String

the name of the formatter class, if registered. Returns null otherwise.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
getDefaultFormatterTypesback to summary
public Set<Class<?>> getDefaultFormatterTypes()

Deprecated

This API is for technology preview only.

Get all know classes that have a mappings from class to function name.

Returns:Set<Class<?>>

a set of all the known classes that have mapping to function names.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
getFormatterback to summary
public FormatterFactory getFormatter(String formatterName)

Deprecated

This API is for technology preview only.

Returns the formatter factory used to create the formatter for function named name.

Note

function name here means the name used to refer to the function in the MessageFormat 2 syntax, for example "... {$exp :datetime} ..."
The function name here is "datetime", and does not have to correspond to the name of the methods / classes used to implement the functionality.

For example one might write a PersonFormatterFactory returning a PersonFormatter, and map that to the MessageFormat function named "person".
The only name visible to the users of MessageFormat syntax will be "person".

Parameters
formatterName:String

the function name.

Returns:FormatterFactory

the factory creating formatters for name. Returns null if none is registered.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
getFormatterNamesback to summary
public Set<String> getFormatterNames()

Deprecated

This API is for technology preview only.

Get all know names that have a mappings from name to FormatterFactory.

Returns:Set<String>

a set of all the known formatter names.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
getSelectorback to summary
public SelectorFactory getSelector(String selectorName)

Deprecated

This API is for technology preview only.

Returns the selector factory used to create the selector for function named name.

Note

the same comments about naming as the ones on getFormatter apply.

Parameters
selectorName:String

the selector name.

Returns:SelectorFactory

the factory creating selectors for name. Returns null if none is registered.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
See Also
getFormatter(String)
getSelectorNamesback to summary
public Set<String> getSelectorNames()

Deprecated

This API is for technology preview only.

Get all know names that have a mappings from name to SelectorFactory.

Returns:Set<String>

a set of all the known selector names.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
com.ibm.icu.message2 back to summary

public Class Mf2FunctionRegistry.Builder

extends Object
Class Inheritance
Annotations
@Deprecated

Deprecated

This API is for technology preview only.

A Builder used to build instances of Mf2FunctionRegistry.
ICU Status
Internal ICU component: 72 technology preview

Field Summary

Modifier and TypeField and Description
private final Map<Class<?>, String>
private final Map<String, FormatterFactory>
private final Map<String, SelectorFactory>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Mf2FunctionRegistry.Builder

Returns:

the builder, for fluent use.
addAll
(Mf2FunctionRegistry
the registry to copy from.
functionRegistry
)

Deprecated This API is for technology preview only.
Adds all the mapping from another registry to this one.
public Mf2FunctionRegistry

Returns:

the function registry created.
build
()

Deprecated This API is for technology preview only.
Builds an instance of Mf2FunctionRegistry.
public Mf2FunctionRegistry.Builder

Returns:

the builder, for fluent use.
clearDefaultFormatterNames
()

Deprecated This API is for technology preview only.
Remove all the class to formatter-names mappings.
public Mf2FunctionRegistry.Builder

Returns:

the builder, for fluent use.
clearFormatters
()

Deprecated This API is for technology preview only.
Remove all the formatter mappings.
public Mf2FunctionRegistry.Builder

Returns:

the builder, for fluent use.
clearSelectors
()

Deprecated This API is for technology preview only.
Remove all the selector mappings.
public Mf2FunctionRegistry.Builder

Returns:

the builder, for fluent use.
removeDefaultFormatterNameForType
(Class<?>
the class to remove the mapping for.
clazz
)

Deprecated This API is for technology preview only.
Remove the function name associated with the class.
public Mf2FunctionRegistry.Builder

Returns:

the builder, for fluent use.
removeFormatter
(String
the name of the formatter to remove.
formatterName
)

Deprecated This API is for technology preview only.
Remove the formatter associated with the name.
public Mf2FunctionRegistry.Builder

Returns:

the builder, for fluent use.
removeSelector
(String
the name of the selector to remove.
selectorName
)

Deprecated This API is for technology preview only.
Remove the selector associated with the name.
public Mf2FunctionRegistry.Builder

Returns:

the builder, for fluent use.
setDefaultFormatterNameForType
(Class<?>
the class of the type to format.
clazz
,
String
the formatter name (as used in the MessageFormat 2 syntax).
formatterName
)

Deprecated This API is for technology preview only.
Adds a mapping from a type to format to a FormatterFactory formatter name.
public Mf2FunctionRegistry.Builder

Returns:

the builder, for fluent use.
setFormatter
(String
the function name (as used in the MessageFormat 2 syntax).
formatterName
,
FormatterFactory
the factory that handles the name.
formatterFactory
)

Deprecated This API is for technology preview only.
Adds a mapping from a formatter name to a FormatterFactory
public Mf2FunctionRegistry.Builder

Returns:

the builder, for fluent use.
setSelector
(String
the function name (as used in the MessageFormat 2 syntax).
selectorName
,
SelectorFactory
the factory that handles the name.
selectorFactory
)

Deprecated This API is for technology preview only.
Adds a mapping from a selector name to a SelectorFactory
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classToFormatterback to summary
private final Map<Class<?>, String> classToFormatter
formattersMapback to summary
private final Map<String, FormatterFactory> formattersMap
selectorsMapback to summary
private final Map<String, SelectorFactory> selectorsMap

Constructor Detail

Builderback to summary
private Builder()

Method Detail

addAllback to summary
public Mf2FunctionRegistry.Builder addAll(Mf2FunctionRegistry functionRegistry)

Deprecated

This API is for technology preview only.

Adds all the mapping from another registry to this one.

Parameters
functionRegistry:Mf2FunctionRegistry

the registry to copy from.

Returns:Mf2FunctionRegistry.Builder

the builder, for fluent use.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
buildback to summary
public Mf2FunctionRegistry build()

Deprecated

This API is for technology preview only.

Builds an instance of Mf2FunctionRegistry.

Returns:Mf2FunctionRegistry

the function registry created.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
clearDefaultFormatterNamesback to summary
public Mf2FunctionRegistry.Builder clearDefaultFormatterNames()

Deprecated

This API is for technology preview only.

Remove all the class to formatter-names mappings.

Returns:Mf2FunctionRegistry.Builder

the builder, for fluent use.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
clearFormattersback to summary
public Mf2FunctionRegistry.Builder clearFormatters()

Deprecated

This API is for technology preview only.

Remove all the formatter mappings.

Returns:Mf2FunctionRegistry.Builder

the builder, for fluent use.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
clearSelectorsback to summary
public Mf2FunctionRegistry.Builder clearSelectors()

Deprecated

This API is for technology preview only.

Remove all the selector mappings.

Returns:Mf2FunctionRegistry.Builder

the builder, for fluent use.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
removeDefaultFormatterNameForTypeback to summary
public Mf2FunctionRegistry.Builder removeDefaultFormatterNameForType(Class<?> clazz)

Deprecated

This API is for technology preview only.

Remove the function name associated with the class.

Parameters
clazz:Class<?>

the class to remove the mapping for.

Returns:Mf2FunctionRegistry.Builder

the builder, for fluent use.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
removeFormatterback to summary
public Mf2FunctionRegistry.Builder removeFormatter(String formatterName)

Deprecated

This API is for technology preview only.

Remove the formatter associated with the name.

Parameters
formatterName:String

the name of the formatter to remove.

Returns:Mf2FunctionRegistry.Builder

the builder, for fluent use.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
removeSelectorback to summary
public Mf2FunctionRegistry.Builder removeSelector(String selectorName)

Deprecated

This API is for technology preview only.

Remove the selector associated with the name.

Parameters
selectorName:String

the name of the selector to remove.

Returns:Mf2FunctionRegistry.Builder

the builder, for fluent use.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
setDefaultFormatterNameForTypeback to summary
public Mf2FunctionRegistry.Builder setDefaultFormatterNameForType(Class<?> clazz, String formatterName)

Deprecated

This API is for technology preview only.

Adds a mapping from a type to format to a FormatterFactory formatter name.

Parameters
clazz:Class<?>

the class of the type to format.

formatterName:String

the formatter name (as used in the MessageFormat 2 syntax).

Returns:Mf2FunctionRegistry.Builder

the builder, for fluent use.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
setFormatterback to summary
public Mf2FunctionRegistry.Builder setFormatter(String formatterName, FormatterFactory formatterFactory)

Deprecated

This API is for technology preview only.

Adds a mapping from a formatter name to a FormatterFactory

Parameters
formatterName:String

the function name (as used in the MessageFormat 2 syntax).

formatterFactory:FormatterFactory

the factory that handles the name.

Returns:Mf2FunctionRegistry.Builder

the builder, for fluent use.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview
setSelectorback to summary
public Mf2FunctionRegistry.Builder setSelector(String selectorName, SelectorFactory selectorFactory)

Deprecated

This API is for technology preview only.

Adds a mapping from a selector name to a SelectorFactory

Parameters
selectorName:String

the function name (as used in the MessageFormat 2 syntax).

selectorFactory:SelectorFactory

the factory that handles the name.

Returns:Mf2FunctionRegistry.Builder

the builder, for fluent use.

Annotations
@Deprecated
ICU Status
Internal ICU component: 72 technology preview