001/*
002 * JDrupes MDoclet
003 * Copyright 2013 Raffael Herzog
004 * Copyright (C) 2017 Michael N. Lipp
005 * 
006 * This program is free software; you can redistribute it and/or modify it 
007 * under the terms of the GNU General Public License as published by 
008 * the Free Software Foundation; either version 3 of the License, or 
009 * (at your option) any later version.
010 * 
011 * This program is distributed in the hope that it will be useful, but 
012 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
013 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
014 * for more details.
015 * 
016 * You should have received a copy of the GNU General Public License along 
017 * with this program; if not, see <http://www.gnu.org/licenses/>.
018 */
019package org.jdrupes.mdoclet.renderers;
020
021import static org.jdrupes.mdoclet.renderers.TagRendering.*;
022
023import org.jdrupes.mdoclet.MDoclet;
024
025import com.sun.javadoc.Tag;
026
027
028/**
029 * Renders a tag by processing the {@link com.sun.javadoc.Tag#text() text}.
030 */
031public class SimpleTagRenderer implements TagRenderer<Tag> {
032
033    public static final SimpleTagRenderer INSTANCE = new SimpleTagRenderer();
034
035    @Override
036    public void render(Tag tag, StringBuilder target, MDoclet doclet) {
037        target.append(tag.name()).append(" ").append(simplifySingleParagraph(doclet.toHtml(tag.text())));
038    }
039
040}