package net.nuclearg.kyou.matcher;

import net.nuclearg.kyou.AnnotatedClassProcessor;
import net.nuclearg.kyou.ClassInfo;
import net.nuclearg.kyou.LinkInfo;

public class AttributeMatcherProcessor extends AnnotatedClassProcessor {

    @Override
    protected String path() {
        return "matcher/attribute";
    }

    @Override
    protected String annotationClassName() {
        return "OperatorDescription";
    }

    @Override
    protected Output process(ClassInfo info) {
        String tag = info.annotationValues.get("value");
        String name = info.className;
        String desc = info.docEntries.get("");

        StringBuilder builder = new StringBuilder();
        String LN = System.lineSeparator();

        builder.append("> [attr").append(tag).append("'value']").append(LN);
        builder.append(LN);
        builder.append(desc).append(LN);
        builder.append(LN);

        super.buildExample(info, builder);

        builder.append("#### Ïà¹ØÁ´½Ó").append(LN);
        builder.append(LN);
        builder.append("_»Øµ½[[È«²¿Æ¥ÅäÆ÷Áбí]]_");

        String pageName = "[ÊôÐÔÆ¥ÅäÆ÷] " + name;
        MatcherListProcessor.attrMatchers.add(new LinkInfo(pageName, desc));

        return new Output(pageName, builder.toString());
    }

}
