KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hammurapi > inspectors > metrics > ArchitecturalCategory


1 /*
2  * Hammurapi
3  * Automated Java code review system.
4  * Copyright (C) 2004 Johannes Bellert
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (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
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; 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.pavelvlasov.com/pv/content/menu.show?id=products.jtaste
21  * e-Mail: Johannes.Bellert@ercgroup.com
22  *
23  * * Created on Mar 20, 2004
24  *
25  */

26
27 /* Copyright (C) 2004 Johannes Bellert
28  * e-Mail: Johannes.Bellert@ercgroup.com
29  * Created on Mar 20, 2004
30  */

31
32 package org.hammurapi.inspectors.metrics;
33
34 import org.w3c.dom.Document JavaDoc;
35 import org.w3c.dom.Element JavaDoc;
36
37 public class ArchitecturalCategory {
38
39     // public SourceMarker srcCodeMarker = null;
40
public String JavaDoc source_url = "";
41     public int source_line = 0;
42     public int source_col = 0;
43     public String JavaDoc categoryType = "";
44     public String JavaDoc identicator = "";
45     public int occurance = 1;
46
47     public ArchitecturalCategory(String JavaDoc _source_url, int col, int line, String JavaDoc _identicator, String JavaDoc _category){
48         super();
49         this.categoryType = _category;
50         this.identicator = _identicator;
51         this.source_url = _source_url;
52         this.source_line = line;
53         this.source_col = col;
54     }
55
56     public boolean equals(ArchitecturalCategory ac){
57         return ac.categoryType.equals(this.categoryType);
58     }
59
60     public boolean equals(String JavaDoc search){
61             return search.equals(this.categoryType);
62         }
63
64     public Element JavaDoc toDom(Document JavaDoc document){
65
66         Element JavaDoc ret=document.createElement("ArchitecturalCategory");
67         ret.setAttribute("category", this.categoryType );
68         ret.setAttribute("identicator", this.identicator );
69         ret.setAttribute("occurance", String.valueOf( this.occurance ) );
70
71         Element JavaDoc typ=document.createElement("SourceMarker");
72
73         
74         typ.setAttribute("source-url", source_url );
75         typ.setAttribute("line", String.valueOf(source_line) );
76         typ.setAttribute("col", String.valueOf(source_col ));
77         ret.appendChild(typ);
78         
79         return ret;
80     }
81
82 }
83
Popular Tags