本文整理汇总了Java中java.time.format.DateTimeFormatterBuilder.CompositePrinterParser类的典型用法代码示例。如果您正苦于以下问题:Java CompositePrinterParser类的具体用法?Java CompositePrinterParser怎么用?Java CompositePrinterParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CompositePrinterParser类属于java.time.format.DateTimeFormatterBuilder包,在下文中一共展示了CompositePrinterParser类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DateTimeFormatter
import java.time.format.DateTimeFormatterBuilder.CompositePrinterParser; //导入依赖的package包/类
/**
* Constructor.
*
* @param printerParser the printer/parser to use, not null
* @param locale the locale to use, not null
* @param decimalStyle the DecimalStyle to use, not null
* @param resolverStyle the resolver style to use, not null
* @param resolverFields the fields to use during resolving, null for all fields
* @param chrono the chronology to use, null for no override
* @param zone the zone to use, null for no override
*/
DateTimeFormatter(CompositePrinterParser printerParser,
Locale locale, DecimalStyle decimalStyle,
ResolverStyle resolverStyle, Set<TemporalField> resolverFields,
Chronology chrono, ZoneId zone) {
this.printerParser = Objects.requireNonNull(printerParser, "printerParser");
this.resolverFields = resolverFields;
this.locale = Objects.requireNonNull(locale, "locale");
this.decimalStyle = Objects.requireNonNull(decimalStyle, "decimalStyle");
this.resolverStyle = Objects.requireNonNull(resolverStyle, "resolverStyle");
this.chrono = chrono;
this.zone = zone;
}
示例2: DateTimeFormatter
import java.time.format.DateTimeFormatterBuilder.CompositePrinterParser; //导入依赖的package包/类
/**
* Constructor.
*
* @param printerParser the printer/parser to use, not null
* @param locale the locale to use, not null
* @param decimalStyle the decimal style to use, not null
* @param resolverStyle the resolver style to use, not null
* @param resolverFields the fields to use during resolving, null for all fields
* @param chrono the chronology to use, null for no override
* @param zone the zone to use, null for no override
*/
DateTimeFormatter(CompositePrinterParser printerParser, Locale locale,
DecimalStyle decimalStyle, ResolverStyle resolverStyle,
Set<TemporalField> resolverFields, Chronology chrono, ZoneId zone) {
this.printerParser = Jdk8Methods.requireNonNull(printerParser, "printerParser");
this.locale = Jdk8Methods.requireNonNull(locale, "locale");
this.decimalStyle = Jdk8Methods.requireNonNull(decimalStyle, "decimalStyle");
this.resolverStyle = Jdk8Methods.requireNonNull(resolverStyle, "resolverStyle");
this.resolverFields = resolverFields;
this.chrono = chrono;
this.zone = zone;
}
示例3: DateTimeFormatter
import java.time.format.DateTimeFormatterBuilder.CompositePrinterParser; //导入依赖的package包/类
/**
* Constructor.
*
* @param printerParser the printer/parser to use, not null
* @param locale the locale to use, not null
* @param symbols the symbols to use, not null
*/
DateTimeFormatter(CompositePrinterParser printerParser, Locale locale, DateTimeFormatSymbols symbols) {
this.locale = locale;
this.symbols = symbols;
this.printerParser = printerParser;
}
示例4: toPrinterParser
import java.time.format.DateTimeFormatterBuilder.CompositePrinterParser; //导入依赖的package包/类
/**
* Returns the formatter as a composite printer parser.
*
* @param optional whether the printer/parser should be optional
* @return the printer/parser, not null
*/
CompositePrinterParser toPrinterParser(boolean optional) {
return printerParser.withOptional(optional);
}
示例5: toPrinterParser
import java.time.format.DateTimeFormatterBuilder.CompositePrinterParser; //导入依赖的package包/类
/**
* Returns the formatter as a composite printer parser.
*
* @param optional whether the printer/parser should be optional
* @return the printer/parser, not null
*/
CompositePrinterParser toPrinterParser(boolean optional) {
return this.printerParser.withOptional(optional);
}