SourceMarkerRenderer.java

biz/hammurapi/legacy/review/SourceMarkerRenderer.java

Violations

Inspector Message Severity Location
Java Inspector 048 Copyrights information should be present in each file. 1
Java Inspector 089 Type is not documented 2 39:1
Java Inspector 089 Undocumented parameter request 2 42:5
Java Inspector 089 Undocumented method 2 46:5
Java Inspector 026 Avoid hardwired string literals. Allowed literals: [] 3 47:44
Java Inspector 026 Avoid hardwired string literals. Allowed literals: [] 3 49:26
Java Inspector 026 Avoid hardwired string literals. Allowed literals: [] 3 50:26
Java Inspector 026 Avoid hardwired string literals. Allowed literals: [] 3 52:34

Source code

1/*
2 * hgcommons 9
3 * Hammurapi Group Common Library
4 * Copyright (C) 2003 Hammurapi Group
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * URL: http://www.hammurapi.biz/hammurapi-biz/ef/xmenu/hammurapi-group/products/products/hgcommons/index.html
21 * e-Mail: support@hammurapi.biz
22 */
23
24package biz.hammurapi.legacy.review;
25
26import org.w3c.dom.Document;
27import org.w3c.dom.Element;
28
29import biz.hammurapi.render.RenderRequest;
30import biz.hammurapi.render.RenderingException;
31import biz.hammurapi.render.dom.AbstractRenderer;
32
33
34/**
35 *
36 * @author Pavel Vlasov
37 * @version $Revision: 1.3 $
38 */
39public class SourceMarkerRenderer extends AbstractRenderer {
40
41 /** Creates a new instance of ViolationEntryRenderer */
42 public SourceMarkerRenderer(RenderRequest request) {
43 super(request);
44 }
45
46 public Element render(Document document) throws RenderingException {
47 Element ret=document.createElement("source-marker");
48 SourceMarker sm=(SourceMarker) request.getRenderee();
49 ret.setAttribute("line", String.valueOf(sm.getLine()));
50 ret.setAttribute("col", String.valueOf(sm.getColumn()));
51 if (sm.getSourceURL()!=null) {
52 ret.setAttribute("source-url", sm.getSourceURL());
53 }
54 return ret;
55 }
56}
57