package ru.yandex.autodoc.common.doc.view.handlers;

import ru.yandex.autodoc.common.doc.ErrorsDocumentationBuilder;
import ru.yandex.autodoc.common.doc.view.Markup;
import ru.yandex.autodoc.common.doc.view.common.MarkupRequestHandler;

import java.util.Map;

/**
 * @author avhaliullin
 */
@Deprecated
public class ErrorsDocumentationHandler implements MarkupRequestHandler {
    private final ErrorsDocumentationMarkuper errorsDocumentationMarkuper;
    private final ErrorsDocumentationBuilder errorsDocumentationBuilder;

    public ErrorsDocumentationHandler(ErrorsDocumentationMarkuper errorsDocumentationMarkuper, ErrorsDocumentationBuilder errorsDocumentationBuilder) {
        this.errorsDocumentationMarkuper = errorsDocumentationMarkuper;
        this.errorsDocumentationBuilder = errorsDocumentationBuilder;
    }

    @Override
    public Markup handle(Map<String, String> params) {
        return errorsDocumentationMarkuper.toMarkup(errorsDocumentationBuilder.getUserErrors());
    }
}
