1 26 27 31 32 package org.hammurapi.inspectors.metrics; 33 34 import org.w3c.dom.Document ; 35 import org.w3c.dom.Element ; 36 37 public class ArchitecturalCategory { 38 39 public String source_url = ""; 41 public int source_line = 0; 42 public int source_col = 0; 43 public String categoryType = ""; 44 public String identicator = ""; 45 public int occurance = 1; 46 47 public ArchitecturalCategory(String _source_url, int col, int line, String _identicator, String _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 search){ 61 return search.equals(this.categoryType); 62 } 63 64 public Element toDom(Document document){ 65 66 Element 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 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 |