All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pojosontheweb.ttt.Template Maven / Gradle / Ivy

There is a newer version: 0.1-beta6
Show newest version
package com.pojosontheweb.ttt;

import java.io.IOException;
import java.io.Writer;

public abstract class Template implements ITemplate {

    protected void write(Writer out, Object o) {
        try {
            if (o == null) {
                out.write("null");
            } else {
                if (o instanceof ITemplate) {
                    ((ITemplate) o).render(out);
                } else if (o instanceof String) {
                    out.write((String) o);
                } else {
                    out.write(o.toString());
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public String getContentType() {
        return null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy