public void visit(TypeDefinition p) throws JselException, ClassNotFoundException { this.coupling.classCouplingMetric.put(p.getFcn(), new CouplingMetricOfClass(p)); allCategorizedClasses.put( p.getFcn(), new ListOfCategories( p.getFcn(), ((SourceMarker) p).getSourceURL(), ((SourceMarker) p).getLine(), ((SourceMarker) p).getColumn())); this.identifyCategories(p); }
/* public void addCategory(String category, String variableIdent, Interface element, TypeDefinition declarationType) { ListOfCategories typeLoc = null; typeLoc = (ListOfCategories) allCategorizedClasses.get(element.getFcn()); typeLoc.add(new ArchitecturalCategory( ((SourceMarker)element).getSourceURL(), ((SourceMarker)element).getLine(), ((SourceMarker)element).getColumn(), variableIdent, category)); } */ public void addCategory( String category, String variableIdent, TypeSpecification element, TypeDefinition declarationType) throws JselException { ListOfCategories typeLoc = null; if (declarationType != null) { typeLoc = (ListOfCategories) allCategorizedClasses.get(declarationType.getFcn()); // !! job: what happens with missing categories?? if (typeLoc == null) { // typeLoc = new ListOfCategories( declarationType.getFcn( ); // allCategorizedClasses.put( declarationType.getFcn(), typeLoc ); new Exception().printStackTrace(); } else { typeLoc.add( new ArchitecturalCategory( ((SourceMarker) element).getSourceURL(), ((SourceMarker) element).getLine(), ((SourceMarker) element).getColumn(), variableIdent, category)); } } }
// !! job: remember tokens which raise a ClassNotFounds and remove from list, for performance // optimization private void checkExtendTypeHelper(String _loadClass, String category, TypeDefinition type) { try { if (type.isKindOf(_loadClass)) { addCategory(category, _loadClass, type); } } catch (JselException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public void addCategory(String category, String variableIdent, TypeDefinition element) throws JselException { ListOfCategories typeLoc = null; typeLoc = (ListOfCategories) allCategorizedClasses.get(element.getFcn()); typeLoc.add( new ArchitecturalCategory( ((SourceMarker) element).getSourceURL(), ((SourceMarker) element).getLine(), ((SourceMarker) element).getColumn(), variableIdent, category)); }