org.joda.time.format.DateTimeFormatter.getPrinter()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中org.joda.time.format.DateTimeFormatter.getPrinter()方法的一些代码示例,展示了DateTimeFormatter.getPrinter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DateTimeFormatter.getPrinter()方法的具体详情如下:
包路径:org.joda.time.format.DateTimeFormatter
类名称:DateTimeFormatter
方法名:getPrinter

DateTimeFormatter.getPrinter介绍

[英]Gets the internal printer object that performs the real printing work.
[中]获取执行实际打印工作的内部打印机对象。

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Appends another formatter.
 *
 * @param formatter  the formatter to add
 * @return this DateTimeFormatterBuilder, for chaining
 * @throws IllegalArgumentException if formatter is null or of an invalid type
 */
public DateTimeFormatterBuilder append(DateTimeFormatter formatter) {
  if (formatter == null) {
    throw new IllegalArgumentException("No formatter supplied");
  }
  return append0(formatter.getPrinter(), formatter.getParser());
}

代码示例来源:origin: camunda/camunda-bpm-platform

public void printTo(
    Writer out, long instant, Chronology chrono,
    int displayOffset, DateTimeZone displayZone, Locale locale) throws IOException {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(out, instant, chrono, displayOffset, displayZone, locale);
}

代码示例来源:origin: camunda/camunda-bpm-platform

public void printTo(
    StringBuffer buf, long instant, Chronology chrono,
    int displayOffset, DateTimeZone displayZone, Locale locale) {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(buf, instant, chrono, displayOffset, displayZone, locale);
}

代码示例来源:origin: camunda/camunda-bpm-platform

public void printTo(StringBuffer buf, ReadablePartial partial, Locale locale) {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(buf, partial, locale);
}

代码示例来源:origin: camunda/camunda-bpm-platform

public void printTo(Writer out, ReadablePartial partial, Locale locale) throws IOException {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(out, partial, locale);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Returns the pattern used by a particular style and locale.
 * <p>
 * The first character is the date style, and the second character is the
 * time style. Specify a character of 'S' for short style, 'M' for medium,
 * 'L' for long, and 'F' for full.
 * A date or time may be ommitted by specifying a style character '-'.
 *
 * @param style  two characters from the set {"S", "M", "L", "F", "-"}
 * @param locale  locale to use, null means default
 * @return the formatter
 * @throws IllegalArgumentException if the style is invalid
 * @since 1.3
 */
public static String patternForStyle(String style, Locale locale) {
  DateTimeFormatter formatter = createFormatterForStyle(style);
  if (locale == null) {
    locale = Locale.getDefault();
  }
  // Not pretty, but it works.
  return ((StyleFormatter) formatter.getPrinter()).getPattern(locale);
}

代码示例来源:origin: org.elasticsearch/elasticsearch

.append(dateTimeFormatter.withZone(DateTimeZone.UTC).getPrinter(), parsers);
formatter = builder.toFormatter();

代码示例来源:origin: org.elasticsearch/elasticsearch

public static DateFormatter getStrictStandardDateFormatter() {
  // 2014/10/10
  DateTimeFormatter shortFormatter = new DateTimeFormatterBuilder()
      .appendFixedDecimal(DateTimeFieldType.year(), 4)
      .appendLiteral('/')
      .appendFixedDecimal(DateTimeFieldType.monthOfYear(), 2)
      .appendLiteral('/')
      .appendFixedDecimal(DateTimeFieldType.dayOfMonth(), 2)
      .toFormatter()
      .withZoneUTC();
  // 2014/10/10 12:12:12
  DateTimeFormatter longFormatter = new DateTimeFormatterBuilder()
      .appendFixedDecimal(DateTimeFieldType.year(), 4)
      .appendLiteral('/')
      .appendFixedDecimal(DateTimeFieldType.monthOfYear(), 2)
      .appendLiteral('/')
      .appendFixedDecimal(DateTimeFieldType.dayOfMonth(), 2)
      .appendLiteral(' ')
      .appendFixedSignedDecimal(DateTimeFieldType.hourOfDay(), 2)
      .appendLiteral(':')
      .appendFixedSignedDecimal(DateTimeFieldType.minuteOfHour(), 2)
      .appendLiteral(':')
      .appendFixedSignedDecimal(DateTimeFieldType.secondOfMinute(), 2)
      .toFormatter()
      .withZoneUTC();
  DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder().append(longFormatter.withZone(DateTimeZone.UTC).getPrinter(),
    new DateTimeParser[]{longFormatter.getParser(), shortFormatter.getParser(), new EpochTimeParser(true)});
  DateTimeFormatter formatter = builder.toFormatter().withLocale(Locale.ROOT).withZone(DateTimeZone.UTC);
  return new JodaDateFormatter("yyyy/MM/dd HH:mm:ss||yyyy/MM/dd||epoch_millis", formatter, formatter);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time

public void printTo(
    Writer out, long instant, Chronology chrono,
    int displayOffset, DateTimeZone displayZone, Locale locale) throws IOException {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(out, instant, chrono, displayOffset, displayZone, locale);
}

代码示例来源:origin: org.joda/com.springsource.org.joda.time

public void printTo(
    StringBuffer buf, long instant, Chronology chrono,
    int displayOffset, DateTimeZone displayZone, Locale locale) {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(buf, instant, chrono, displayOffset, displayZone, locale);
}

代码示例来源:origin: redfish64/TinyTravelTracker

public void printTo(
    Writer out, long instant, Chronology chrono,
    int displayOffset, DateTimeZone displayZone, Locale locale) throws IOException {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(out, instant, chrono, displayOffset, displayZone, locale);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public void printTo(
    StringBuffer buf, long instant, Chronology chrono,
    int displayOffset, DateTimeZone displayZone, Locale locale) {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(buf, instant, chrono, displayOffset, displayZone, locale);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

public void printTo(
    StringBuffer buf, long instant, Chronology chrono,
    int displayOffset, DateTimeZone displayZone, Locale locale) {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(buf, instant, chrono, displayOffset, displayZone, locale);
}

代码示例来源:origin: redfish64/TinyTravelTracker

public void printTo(
    StringBuffer buf, long instant, Chronology chrono,
    int displayOffset, DateTimeZone displayZone, Locale locale) {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(buf, instant, chrono, displayOffset, displayZone, locale);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time

public void printTo(
    StringBuffer buf, long instant, Chronology chrono,
    int displayOffset, DateTimeZone displayZone, Locale locale) {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(buf, instant, chrono, displayOffset, displayZone, locale);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public void printTo(
    StringBuffer buf, long instant, Chronology chrono,
    int displayOffset, DateTimeZone displayZone, Locale locale) {
  DateTimePrinter p = getFormatter(locale).getPrinter();
  p.printTo(buf, instant, chrono, displayOffset, displayZone, locale);
}

代码示例来源:origin: com.arm.mbed.cloud.sdk/update_service

public DateTimeTypeAdapter() {
  this(new DateTimeFormatterBuilder()
    .append(ISODateTimeFormat.dateTime().getPrinter(), ISODateTimeFormat.dateOptionalTimeParser().getParser())
    .toFormatter());
}

代码示例来源:origin: com.arm.mbed.cloud.sdk/iam

public DateTimeTypeAdapter() {
  this(new DateTimeFormatterBuilder()
    .append(ISODateTimeFormat.dateTime().getPrinter(), ISODateTimeFormat.dateOptionalTimeParser().getParser())
    .toFormatter());
}

代码示例来源:origin: com.arm.mbed.cloud.sdk/device_directory

public DateTimeTypeAdapter() {
  this(new DateTimeFormatterBuilder()
    .append(ISODateTimeFormat.dateTime().getPrinter(), ISODateTimeFormat.dateOptionalTimeParser().getParser())
    .toFormatter());
}

代码示例来源:origin: com.arm.mbed.cloud.sdk/billing

public DateTimeTypeAdapter() {
  this(new DateTimeFormatterBuilder()
    .append(ISODateTimeFormat.dateTime().getPrinter(), ISODateTimeFormat.dateOptionalTimeParser().getParser())
    .toFormatter());
}

相关文章