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.ThrowsTag;
026
027
028/**
029 * Renderer for `@throws` and `@exception` tags.
030 */
031public class ThrowsTagRenderer implements TagRenderer<ThrowsTag> {
032
033    public static final ThrowsTagRenderer INSTANCE = new ThrowsTagRenderer();
034
035    @Override
036    public void render(ThrowsTag tag, StringBuilder target, MDoclet doclet) {
037        target.append(tag.name())
038                .append(' ').append(tag.exceptionName())
039                .append(' ').append(simplifySingleParagraph(doclet.toHtml(tag.exceptionComment())));
040    }
041}