Example usage for java.util Formatter format

List of usage examples for java.util Formatter format

Introduction

In this page you can find the example usage for java.util Formatter format.

Prototype

public Formatter format(Locale l, String format, Object... args) 

Source Link

Document

Writes a formatted string to this object's destination using the specified locale, format string, and arguments.

Usage

From source file:org.fenixedu.academic.domain.student.Registration.java

public void exportValues(StringBuilder result) {
    Formatter formatter = new Formatter(result);
    final Student student = getStudent();
    formatter.format("%s: %s\n", BundleUtil.getString(Bundle.ACADEMIC, "label.ingression"),
            getIngressionType() == null ? " - " : getIngressionType().getDescription().getContent());
    formatter.format("%s: %d\n", BundleUtil.getString(Bundle.ACADEMIC, "label.studentNumber"),
            student.getNumber());/*from w ww .j  ava  2 s  .c o  m*/
    formatter.format("%s: %s\n", BundleUtil.getString(Bundle.ACADEMIC, "label.Student.Person.name"),
            student.getPerson().getName());
    formatter.format("%s: %s\n", BundleUtil.getString(Bundle.ACADEMIC, "label.degree"),
            getDegree().getPresentationName());
    formatter.close();
}

From source file:net.sourceforge.fenixedu.domain.student.Registration.java

public void exportValues(StringBuilder result) {
    Formatter formatter = new Formatter(result);
    final Student student = getStudent();
    formatter.format("%s: %s\n", BundleUtil.getString(Bundle.ACADEMIC, "label.ingression"),
            getIngression() == null ? " - " : getIngression().getFullDescription());
    formatter.format("%s: %d\n", BundleUtil.getString(Bundle.ACADEMIC, "label.studentNumber"),
            student.getNumber());/*  w w w  .  j a v a2s.  c  o m*/
    formatter.format("%s: %s\n", BundleUtil.getString(Bundle.ACADEMIC, "label.Student.Person.name"),
            student.getPerson().getName());
    formatter.format("%s: %s\n", BundleUtil.getString(Bundle.ACADEMIC, "label.degree"),
            getDegree().getPresentationName());
    formatter.close();
}