Package mondrian.spi

Interface MemberFormatter

  • All Known Subinterfaces:
    MemberFormatter

    public interface MemberFormatter
    An SPI to redefine the caption displayed for members.

    For example, the following class displays members of the time dimension as "01-JAN-2005".

    public class TimeMemberFormatter implements MemberFormatter {
        public String formatMember(Member member) {
            SimpleDateFormat inFormat =
                new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S");
            SimpleDateFormat outFormat =
                new SimpleDateFormat("dd-MMM-yyyy");
            try {
                Date date = inFormat.parse(in.getName());
                return outFormat.format(data);
            } catch (ParseException e) {
                e.printStackTrace();
                return "error";
            }
        }
    }
    Since:
    6 October, 2004
    Author:
    hhaas
    • Method Detail

      • formatMember

        String formatMember​(Member member)
        Returns the string to be displayed as a caption for a given member.