private MessageEmitter newEmitter(boolean asciiQuotes, OutputFormat outputFormat) {
            switch (outputFormat) {
            case TEXT:
                return new TextMessageEmitter(this.out, asciiQuotes);
            case GNU:
                return new GnuMessageEmitter(this.out, asciiQuotes);
            case JSON:
                return new JsonMessageEmitter(new Serializer(this.out), null,
                        asciiQuotes);
            case XML:
                return new XmlMessageEmitter(new XmlSerializer(this.out));
            default:
                throw new UnsupportedOperationException("OutputFormat " + outputFormat + " not supported");
            }
        }
Self-contained, single use class for encapsulated building of an embedded
validator.
src/nu/validator/client/EmbeddedValidator.java