java.util.logging.Formatter.getHead()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(167)

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

Formatter.getHead介绍

[英]Gets the head string used to wrap a set of log records. This base class always returns an empty string.
[中]获取用于包装一组日志记录的头字符串。这个基类总是返回一个空字符串。

代码示例

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

private synchronized void flushAndClose() throws SecurityException {
 if (writer != null) {
  try {
   if (!doneHeader) {
    writer.write(getFormatter().getHead(this));
    doneHeader = true;
   }
   writer.write(getFormatter().getTail(this));
   writer.flush();
   writer.close();
  } catch (Exception ex) {
   // We don't want to throw an exception here, but we
   // report the exception to any registered ErrorManager.
   reportError(null, ex, ErrorManager.CLOSE_FAILURE);
  }
  writer = null;
 }
}

代码示例来源:origin: robovm/robovm

private void initializeWriter() {
  this.writerNotInitialized = false;
  if (getEncoding() == null) {
    this.writer = new OutputStreamWriter(this.os);
  } else {
    try {
      this.writer = new OutputStreamWriter(this.os, getEncoding());
    } catch (UnsupportedEncodingException e) {
      /*
       * Should not happen because it's checked in
       * super.initProperties().
       */
    }
  }
  write(getFormatter().getHead(this));
}

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

public synchronized void publish(final LogRecord record) {
 if (!isLoggable(record)) {
  return;
 }
 String msg;
 try {
  msg = getFormatter().format(record);
 } catch (Exception ex) {
  // We don't want to throw an exception here, but we
  // report the exception to any registered ErrorManager.
  reportError(null, ex, ErrorManager.FORMAT_FAILURE);
  return;
 }
 try {
  if (!doneHeader) {
   writer.write(getFormatter().getHead(this));
   doneHeader = true;
  }
  writer.write(msg);
 } catch (Exception ex) {
  // We don't want to throw an exception here, but we
  // report the exception to any registered ErrorManager.
  reportError(null, ex, ErrorManager.WRITE_FAILURE);
 }
}

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

/**
 * Creates the head or reports a formatting error.
 * @param f the formatter.
 * @return the head string or an empty string.
 */
private String head(final Formatter f) {
  try {
    return f.getHead(this);
  } catch (final RuntimeException RE) {
    reportError(RE.getMessage(), RE, ErrorManager.FORMAT_FAILURE);
    return "";
  }
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * Creates the head or reports a formatting error.
 * @param f the formatter.
 * @return the head string or an empty string.
 */
private String head(final Formatter f) {
  try {
    return f.getHead(this);
  } catch (final RuntimeException RE) {
    reportError(RE.getMessage(), RE, ErrorManager.FORMAT_FAILURE);
    return "";
  }
}

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

(encoding != null) ? new OutputStreamWriter(os, encoding)
                : new OutputStreamWriter(os), false);
  writer.write(getFormatter().getHead(this));
} catch (Exception e) {
  reportError(null, e, ErrorManager.OPEN_FAILURE);

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

if (f != null) {
  synchronized (f) {
    head = f.getHead(h);
    msg = record != null ? f.format(record) : "";
    tail = f.getTail(h);

代码示例来源:origin: com.sun.mail/javax.mail

if (f != null) {
  synchronized (f) {
    head = f.getHead(h);
    msg = record != null ? f.format(record) : "";
    tail = f.getTail(h);

代码示例来源:origin: danfickle/openhtmltopdf

/**
 * Return the header string for a set of formatted records.
 *
 * @param h  PARAM
 * @return   The head value
 */
public String getHead( Handler h ) {
  return super.getHead( h );
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

/**
 * Return the header string for a set of formatted records.
 *
 * @param h  PARAM
 * @return   The head value
 */
public String getHead( Handler h ) {
  return super.getHead( h );
}

代码示例来源:origin: org.docx4j/xhtmlrenderer

/**
 * Return the header string for a set of formatted records.
 *
 * @param h  PARAM
 * @return   The head value
 */
public String getHead( Handler h ) {
  return super.getHead( h );
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

/**
 * Return the header string for a set of formatted records.
 *
 * @param h  PARAM
 * @return   The head value
 */
public String getHead( Handler h ) {
  return super.getHead( h );
}

代码示例来源:origin: javax.mail/com.springsource.javax.mail

private String head(final Formatter f) {
  try {
    return f.getHead(this);
  } catch (final RuntimeException RE) {
    reportError(RE.getMessage(), RE, ErrorManager.FORMAT_FAILURE);
    return "";
  }
}

代码示例来源:origin: ata4/bspsrc

private void doHeaders() {
  if (!doneHeader) {
    String head = getFormatter().getHead(this);
    out.append(head);
    err.append(head);
    doneHeader = true;
  }
}

代码示例来源:origin: com.sun.mail/jakarta.mail

/**
 * Creates the head or reports a formatting error.
 * @param f the formatter.
 * @return the head string or an empty string.
 */
private String head(final Formatter f) {
  try {
    return f.getHead(this);
  } catch (final RuntimeException RE) {
    reportError(RE.getMessage(), RE, ErrorManager.FORMAT_FAILURE);
    return "";
  }
}

代码示例来源:origin: com.sun.mail/android-mail

/**
 * Creates the head or reports a formatting error.
 * @param f the formatter.
 * @return the head string or an empty string.
 */
private String head(final Formatter f) {
  try {
    return f.getHead(this);
  } catch (final RuntimeException RE) {
    reportError(RE.getMessage(), RE, ErrorManager.FORMAT_FAILURE);
    return "";
  }
}

代码示例来源:origin: org.glassfish.metro/webservices-extra

/**
 * Creates the head or reports a formatting error.
 * @param f the formatter.
 * @return the head string or an empty string.
 */
private String head(final Formatter f) {
  try {
    return f.getHead(this);
  } catch (final RuntimeException RE) {
    reportError(RE.getMessage(), RE, ErrorManager.FORMAT_FAILURE);
    return "";
  }
}

代码示例来源:origin: org.jboss.logmanager/jboss-logmanager

private void writeHead(final Writer writer) {
  try {
    final Formatter formatter = getFormatter();
    if (formatter != null) writer.write(formatter.getHead(this));
  } catch (Exception e) {
    reportError("Error writing section header", e, ErrorManager.WRITE_FAILURE);
  }
}

代码示例来源:origin: org.jboss.logmanager/jboss-logmanager

private void writeHead(final Writer writer) {
  try {
    final Formatter formatter = getFormatter();
    if (formatter != null) writer.write(formatter.getHead(this));
  } catch (Exception e) {
    reportError("Error writing section header", e, ErrorManager.WRITE_FAILURE);
  }
}

代码示例来源:origin: com.jtransc/jtransc-rt

private void initializeWriter() {
  this.writerNotInitialized = false;
  if (getEncoding() == null) {
    this.writer = new OutputStreamWriter(this.os);
  } else {
    try {
      this.writer = new OutputStreamWriter(this.os, getEncoding());
    } catch (UnsupportedEncodingException e) {
    }
  }
  write(getFormatter().getHead(this));
}

相关文章