View Javadoc

1   /*
2    * Copyright 2007-2013 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package de.smartics.exceptions.report.renderer.html;
17  
18  import de.smartics.exceptions.report.renderer.CodeTagRenderer;
19  import de.smartics.exceptions.report.renderer.DefaultTextRenderer;
20  import de.smartics.exceptions.report.renderer.LinkPlainTagRenderer;
21  import de.smartics.exceptions.report.renderer.LinkTagRenderer;
22  import de.smartics.exceptions.report.renderer.LiteralTagRenderer;
23  import de.smartics.exceptions.report.renderer.RendererFactory;
24  import de.smartics.exceptions.report.renderer.SeeTagRenderer;
25  import de.smartics.exceptions.report.renderer.SinceTagRenderer;
26  import de.smartics.exceptions.report.renderer.TagListRenderer;
27  import de.smartics.exceptions.report.renderer.TextRenderer;
28  import de.smartics.exceptions.report.renderer.ValueTagRenderer;
29  import de.smartics.exceptions.report.renderer.VersionTagRenderer;
30  
31  /**
32   * A renderer factory to create HTML elements from the Javadoc information
33   * returned by the Javadoc tool.
34   */
35  public class HtmlRendererFactory implements RendererFactory
36  {
37    // ********************************* Fields *********************************
38  
39    // --- constants ------------------------------------------------------------
40  
41    // --- members --------------------------------------------------------------
42  
43    /**
44     * The preconfigured stateless text renderer.
45     */
46    private final TextRenderer textRenderer = new DefaultTextRenderer();
47  
48    /**
49     * The preconfigured stateless renderer for see tags.
50     */
51    private final SeeTagRenderer seeTagRenderer = new HtmlSeeTagRenderer();
52  
53    /**
54     * The preconfigured stateless renderer for link tags.
55     */
56    private final LinkTagRenderer linkTagRenderer = new HtmlLinkTagRenderer();
57  
58    /**
59     * The preconfigured stateless renderer for literal tags.
60     */
61    private final LiteralTagRenderer literalTagRenderer =
62        new HtmlLiteralTagRenderer();
63  
64    /**
65     * The preconfigured stateless renderer for literal tags.
66     */
67    private final CodeTagRenderer codeTagRenderer = new HtmlCodeTagRenderer();
68  
69    /**
70     * The preconfigured stateless renderer for linkplain tags.
71     */
72    private final LinkPlainTagRenderer linkPlainTagRenderer =
73        new HtmlLinkPlainTagRenderer();
74  
75    /**
76     * The preconfigured stateless renderer for value tags.
77     */
78    private final ValueTagRenderer valueTagRenderer = new HtmlValueTagRenderer();
79  
80    /**
81     * The preconfigured stateless renderer for the since tag.
82     */
83    private final SinceTagRenderer sinceTagRenderer = new HtmlSinceTagRenderer();
84  
85    /**
86     * The preconfigured stateless renderer for the version tag.
87     */
88    private final VersionTagRenderer versionTagRenderer =
89        new HtmlVersionTagRenderer();
90  
91    /**
92     * The preconfigured stateless renderer for tag lists.
93     */
94    private final HtmlDlTagListRenderer tagListRenderer =
95        new HtmlDlTagListRenderer();
96  
97    // ****************************** Initializer *******************************
98  
99    // ****************************** Constructors ******************************
100 
101   /**
102    * Default constructor.
103    */
104   public HtmlRendererFactory()
105   {
106   }
107 
108   // ****************************** Inner Classes *****************************
109 
110   // ********************************* Methods ********************************
111 
112   // --- init -----------------------------------------------------------------
113 
114   // --- get&set --------------------------------------------------------------
115 
116   // --- business -------------------------------------------------------------
117 
118   @Override
119   public TextRenderer createTextRenderer()
120   {
121     return textRenderer;
122   }
123 
124   @Override
125   public SeeTagRenderer createSeeTagRenderer()
126   {
127     return seeTagRenderer;
128   }
129 
130   @Override
131   public LiteralTagRenderer createLiteralTagRenderer()
132   {
133     return literalTagRenderer;
134   }
135 
136   @Override
137   public CodeTagRenderer createCodeTagRenderer()
138   {
139     return codeTagRenderer;
140   }
141 
142   @Override
143   public LinkPlainTagRenderer createLinkPlainTagRenderer()
144   {
145     return linkPlainTagRenderer;
146   }
147 
148   @Override
149   public ValueTagRenderer createValueTagRenderer()
150   {
151     return valueTagRenderer;
152   }
153 
154   @Override
155   public SinceTagRenderer createSinceTagRenderer()
156   {
157     return sinceTagRenderer;
158   }
159 
160   @Override
161   public VersionTagRenderer createVersionTagRenderer()
162   {
163     return versionTagRenderer;
164   }
165 
166   @Override
167   public LinkTagRenderer createLinkTagRenderer()
168   {
169     return linkTagRenderer;
170   }
171 
172   @Override
173   public TagListRenderer createTagListRenderer()
174   {
175     return tagListRenderer;
176   }
177 
178   // --- object basics --------------------------------------------------------
179 
180 }