Top Description Fields Constructors Methods
java.util

pack-priv final Class FormatterBuilder

extends Object
Class Inheritance
Imports
java.io.IOException, java.lang.invoke.*, .MethodHandles.Lookup, java.text.DecimalFormat, .DecimalFormatSymbols, .NumberFormat, java.text.spi.NumberFormatProvider, java.util.FormatItem.*, java.util.Formatter.*, jdk.internal.util.FormatConcatItem, sun.invoke.util.Wrapper, sun.util.locale.provider.LocaleProviderAdapter, .ResourceBundleBasedAdapter

This package private class supports the construction of the MethodHandle used by FormatProcessor.
Since
21 Warning: This class is part of PreviewFeature.Feature.STRING_TEMPLATES. Do not rely on its availability.

Field Summary

Modifier and TypeField and Description
private final DecimalFormatSymbols
private static final MethodHandle
private static final MethodHandle
private static final MethodHandle
private static final MethodHandle
private static final MethodHandle
private static final MethodHandle
private static final MethodHandle
private static final MethodHandle
private static final MethodHandle
private static final MethodHandle
private static final MethodHandle
private final String
private static final MethodHandle
private static final MethodHandle
private final boolean
private final Locale
private static final MethodHandles.Lookup
private static final MethodHandle
private final Class<?>[]
private static final MethodHandle
private static final MethodHandle

Constructor Summary

AccessConstructor and Description
pack-priv
FormatterBuilder(String format, Locale locale, Class<?>[] ptypes)

Method Summary

Modifier and TypeMethod and Description
pack-priv MethodHandle

Returns:

new MethodHandle to format arguments
build
()

Build a MethodHandle to format arguments.

private MethodHandle

Returns:

concat MethodHandle for based on format
buildFilters
(List<Formatter.FormatString>
list of specifiers
fsa
,
List<String> segments, MethodHandle[] filters)

Construct concat MethodHandle for based on format.

private static MethodHandle
findMethod(Class<?> cls, String name, Class<?> rType, Class<?>... ptypes)

private static MethodHandle
findStaticMethod(Class<?> cls, String name, Class<?> rType, Class<?>... ptypes)

private static MethodHandle
private MethodHandle
private static boolean
private static int
private static boolean
isFlag(int value, int flags)

private static boolean
private static Class<?>
mapType(Class<?> type)

private static boolean
nullCheck(Object object)

private static long
toLong(int value)

private static boolean
validFlags(int value, int flags)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dfsback to summary
private final DecimalFormatSymbols dfs
FIBoolean_MHback to summary
private static final MethodHandle FIBoolean_MH
FICharacter_MHback to summary
private static final MethodHandle FICharacter_MH
FIDecimal_MHback to summary
private static final MethodHandle FIDecimal_MH
FIFillLeft_MHback to summary
private static final MethodHandle FIFillLeft_MH
FIFillRight_MHback to summary
private static final MethodHandle FIFillRight_MH
FIFormatSpecifier_MHback to summary
private static final MethodHandle FIFormatSpecifier_MH
FIFormattable_MHback to summary
private static final MethodHandle FIFormattable_MH
FIHexadecimal_MHback to summary
private static final MethodHandle FIHexadecimal_MH
FINull_MHback to summary
private static final MethodHandle FINull_MH
FIOctal_MHback to summary
private static final MethodHandle FIOctal_MH
FIString_MHback to summary
private static final MethodHandle FIString_MH
formatback to summary
private final String format
FormattableCheck_MHback to summary
private static final MethodHandle FormattableCheck_MH
HashCode_MHback to summary
private static final MethodHandle HashCode_MH
isGenericDFSback to summary
private final boolean isGenericDFS
localeback to summary
private final Locale locale
LOOKUPback to summary
private static final MethodHandles.Lookup LOOKUP
NullCheck_MHback to summary
private static final MethodHandle NullCheck_MH
ptypesback to summary
private final Class<?>[] ptypes
ToLong_MHback to summary
private static final MethodHandle ToLong_MH
ToString_MHback to summary
private static final MethodHandle ToString_MH

Constructor Detail

FormatterBuilderback to summary
pack-priv FormatterBuilder(String format, Locale locale, Class<?>[] ptypes)

Method Detail

buildback to summary
pack-priv MethodHandle build()

Build a MethodHandle to format arguments.

Returns:MethodHandle

new MethodHandle to format arguments

buildFiltersback to summary
private MethodHandle buildFilters(List<Formatter.FormatString> fsa, List<String> segments, MethodHandle[] filters)

Construct concat MethodHandle for based on format.

Parameters
fsa:List<Formatter.FormatString>

list of specifiers

Returns:MethodHandle

concat MethodHandle for based on format

findMethodback to summary
private static MethodHandle findMethod(Class<?> cls, String name, Class<?> rType, Class<?>... ptypes)
findStaticMethodback to summary
private static MethodHandle findStaticMethod(Class<?> cls, String name, Class<?> rType, Class<?>... ptypes)
findStringConcatItemConstructorback to summary
private static MethodHandle findStringConcatItemConstructor(Class<?> cls, Class<?>... ptypes)
formatSpecifierback to summary
private MethodHandle formatSpecifier(Formatter.FormatSpecifier fs, Class<?> ptype)
formattableCheckback to summary
private static boolean formattableCheck(Object object)
groupSizeback to summary
private static int groupSize(Locale locale, DecimalFormatSymbols dfs)
isFlagback to summary
private static boolean isFlag(int value, int flags)
isGenericDFSback to summary
private static boolean isGenericDFS(DecimalFormatSymbols dfs)
mapTypeback to summary
private static Class<?> mapType(Class<?> type)
nullCheckback to summary
private static boolean nullCheck(Object object)
toLongback to summary
private static long toLong(int value)
validFlagsback to summary
private static boolean validFlags(int value, int flags)