/** * Returns a FormatToken representing the format specifier starting at 'offset'. * @param offset the first character after the '%' */ FormatToken parseFormatToken(int offset) { this.startIndex = offset; this.i = offset; return parseArgumentIndexAndFlags(new FormatToken()); }
private FormatToken parseConversionType(FormatToken token) { char conversionType = advance(); // A conversion type is mandatory. token.setConversionType(conversionType); if (conversionType == 't' || conversionType == 'T') { char dateSuffix = advance(); // A date suffix is mandatory for 't' or 'T'. token.setDateSuffix(dateSuffix); } return token; }
private FormatToken parsePrecision(FormatToken token) { advance(); // Swallow the '.'. int ch = peek(); if (isDigit(ch)) { token.setPrecision(nextInt()); return parseConversionType(token); } else { // The precision is required but not given by the format string. throw unknownFormatConversionException(); } }
private FormatToken parseWidth(FormatToken token, int width) { token.setWidth(width); int ch = peek(); if (ch == '.') { return parsePrecision(token); } else { return parseConversionType(token); } }
private UnknownFormatConversionException unknownFormatConversionException() { throw new UnknownFormatConversionException(getFormatSpecifierText()); }
@Override public String toString() { return SimpleFormat.format("<%s - %s>", start, end); } }
private CharSequence transformFromNull() { formatToken.flagZero = false; return padding("null", 0); }
private FormatToken parsePrecision(FormatToken token) { advance(); // Swallow the '.'. int ch = peek(); if (isDigit(ch)) { token.setPrecision(nextInt()); return parseConversionType(token); } else { // The precision is required but not given by the format string. throw unknownFormatConversionException(); } }
private FormatToken parseWidth(FormatToken token, int width) { token.setWidth(width); int ch = peek(); if (ch == '.') { return parsePrecision(token); } else { return parseConversionType(token); } }
/** * Returns a FormatToken representing the format specifier starting at 'offset'. * @param offset the first character after the '%' */ FormatToken parseFormatToken(int offset) { this.startIndex = offset; this.i = offset; return parseArgumentIndexAndFlags(new FormatToken()); }
private UnknownFormatConversionException unknownFormatConversionException() { throw new UnknownFormatConversionException(getFormatSpecifierText()); }
@Override public String toString() { return SimpleFormat.format("IN: %s OUT: %s", in, out); }
private FormatToken parseConversionType(FormatToken token) { char conversionType = advance(); // A conversion type is mandatory. token.setConversionType(conversionType); if (conversionType == 't' || conversionType == 'T') { char dateSuffix = advance(); // A date suffix is mandatory for 't' or 'T'. token.setDateSuffix(dateSuffix); } return token; }
@Override public String toString() { return SimpleFormat.format(MESSAGE_REPRESENTATION_FORMAT, name); }
@Override public String toString() { return SimpleFormat.format("<%s - %s>", start, end); } }
@Override public String toString() { return SimpleFormat.format("DependencyInfo(relativePath='%1$s', path='%2$s', " + "provides=%3$s, requires=%4$s, loadFlags=%5$s)", srcPathRelativeToClosure, pathOfDefiningFile, provides, requires, loadFlags); }
@Override public String toString() { return SimpleFormat.format("IN: %s OUT: %s", in, out); }
@Override public String toString() { return SimpleFormat.format("IN: %s OUT: %s", in, out); }