/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.text;

import java.io.IOException;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public final class ResolveFormatUtils {
    
    private ResolveFormatUtils() {
        /* utility class */
    }
    
    public static String format(String pattern, Object context) {
        return ResolveFormat.compile(pattern).format(context);
    }
    
    public static String vformat(String pattern, Object... arguments) {
        return ResolveFormat.compile(pattern).format(arguments);
    }
        
    public static <T extends Appendable> T format(T output, String pattern, Object context) throws IOException {
        return ResolveFormat.compile(pattern).format(output, context);
    }
    
    public static <T extends Appendable> T vformat(T output, String pattern, Object... arguments) throws IOException {
        return ResolveFormat.compile(pattern).format(output, arguments);
    }
    
    public static void parse(String pattern, String input, Object context) {
        ResolveFormat.compile(pattern).parse(input, context);
    }
    
}
