Package org.evolizer.famix.model.entities

Examples of org.evolizer.famix.model.entities.FamixAssociation


     */
    @SuppressWarnings("unchecked")
    public String getEdgeInfo(Edge selectedEdge) {
        StringBuffer buf = new StringBuffer();

        FamixAssociation association = (FamixAssociation) getEdgeToFamixMap().get(selectedEdge);

        if (association != null) {
            buf.append(association.getFrom()).append(" ").append(association.getType()).append(" ").append(association.getTo());
        } else {
            // get contained edges
            List<Edge> edges = (List<Edge>) getAggregatedEdgeMap().get(selectedEdge);
            for (Edge edge : edges) {
                if (buf.length() > 0) {
View Full Code Here


    public String getEdgeTip(Edge edge) {
        StringBuilder tip = new StringBuilder("<HtMl>");
        List<Edge> lowLevelEdges = this.getLowLevelEdges(edge);
        if (lowLevelEdges != null && lowLevelEdges.size() > 0) {
            for (Edge lowLevelEdge : lowLevelEdges) {
                FamixAssociation association = this.getAssociation(lowLevelEdge);
                if (association != null) {
                    tip.append(simpleHTMLConverter(association.getLabel())).append("<br>");
                } else {
                    sLogger.error("Could not determine FAMIX association of edge " + edge);

                }
            }
        } else {
            FamixAssociation association = getAssociation(edge);
            if (association != null) {
                tip.append(simpleHTMLConverter(association.getLabel()));
            } else {
                sLogger.error("Could not determine FAMIX association of edge " + edge);
                tip.append("Error determining FAMIX association of edge " + edge);
            }
        }
View Full Code Here

        List<Type> superInterfaces = getASTNode().superInterfaceTypes();
        for (Type superInterface : superInterfaces) {
            FamixClass lInterface = getClass(superInterface.resolveBinding(), superInterface, false);
            lInterface = (FamixClass) getModel().addElement(lInterface);
            lInterface.setModifiers(lInterface.getModifiers() | AbstractFamixEntity.MODIFIER_INTERFACE);
            FamixAssociation subtyping = getFactory().createSubtyping(getCurrType(), lInterface);
            subtyping.setSourceAnchor(getSourceAnchor());
            getModel().addRelation(subtyping);
        }
    }
View Full Code Here

        try {
            createAttributeFromAccess();
   
            if ((getField() != null) && (getCurrMethod() != null)) {
                FamixAssociation access = getFactory().createAccess(getCurrMethod(), getField());
                access.setSourceAnchor(getSourceAnchor());
                getModel().addRelation(access);
            }
        } catch (NullPointerException e) {
            sLogger.error("Error processing variable access in method "
                    + (getCurrMethod() != null ? getCurrMethod().getUniqueName() : "<no method>") + "\n"
View Full Code Here

    private void group(List<Edge> edges) {
        Hashtable<String, List<Edge>> typeToEdgeListMap = new Hashtable<String, List<Edge>>();

        // get list of lower level edges per edge type
        for (Edge edge : edges) {
            FamixAssociation association = fGraph.getAssociation(edge);
            if (association != null) {
                List<Edge> edgeList;
                if (typeToEdgeListMap.containsKey(association.getType())) {
                    edgeList = typeToEdgeListMap.get(association.getType());
                } else {
                    edgeList = new ArrayList<Edge>();
                    typeToEdgeListMap.put(association.getType(), edgeList);
                }
                edgeList.add(edge);
            }
        }
View Full Code Here

        try {
            ITypeBinding lBinding = getASTNode().getRightOperand().resolveBinding();
            FamixClass lClass = getClass(lBinding, getASTNode().getRightOperand(), false);
            lClass = (FamixClass) getModel().addElement(lClass);
            FamixAssociation instanceOf = getFactory().createCheckInstanceOf(getCurrMethod(), lClass);
            instanceOf.setSourceAnchor(getSourceAnchor());
            getModel().addRelation(instanceOf);
        } catch (NullPointerException e) {
            sLogger.error("Error processing instanceof expression in method "
                    + (getCurrMethod() != null ? getCurrMethod().getUniqueName() : "<no method>") + "\n"
                    + getASTNode().toString()
View Full Code Here

            if (getTypeBinding().getInterfaces().length != 0) {
                // An anonymous class can implement only 1 interface
                lImplementedType = getClass(getTypeBinding().getInterfaces()[0], null, false);
                lImplementedType = (FamixClass) getModel().addElement(lImplementedType);
                lImplementedType.setModifiers(lImplementedType.getModifiers() | AbstractFamixEntity.MODIFIER_INTERFACE);
                FamixAssociation subtyping = getFactory().createSubtyping(getCurrType(), lImplementedType);
                subtyping.setSourceAnchor(getSourceAnchor());
                getModel().addRelation(subtyping);
            } else {
                lImplementedType = getClass(getTypeBinding().getSuperclass(), null, false);
                lImplementedType = (FamixClass) getModel().addElement(lImplementedType);
                FamixAssociation inheritance = getFactory().createInheritance(getCurrType(), lImplementedType);
                inheritance.setSourceAnchor(getSourceAnchor());
                getModel().addRelation(inheritance);
            }
        } else {
            String lClassID = AbstractASTNodeHandler.UNDEFINED_BINDING;
            if (getASTNode().getParent() instanceof ClassInstanceCreation) {
                SimpleType castedType = (SimpleType) ((ClassInstanceCreation) getASTNode().getParent()).getType();
                lClassID += AbstractFamixEntity.NAME_DELIMITER + castedType.getName().getFullyQualifiedName();
            }
            lImplementedType = getFactory().createClass(lClassID, null);
            lImplementedType = (FamixClass) getModel().addElement(lImplementedType);
            // We do not know whether it is a superclass or an interface; we create a Subtype
            FamixAssociation subtyping = getFactory().createSubtyping(getCurrType(), lImplementedType);
            subtyping.setSourceAnchor(getSourceAnchor());
            getModel().addRelation(subtyping);
        }
        // getModel().addElement(lImplementedType);
    }
View Full Code Here

        List<Type> superInterfaces = getASTNode().superInterfaceTypes();
        for (Type superInterface : superInterfaces) {
            FamixClass lInterface = getClass(superInterface.resolveBinding(), superInterface, false);
            lInterface = (FamixClass) getModel().addElement(lInterface);
            lInterface.setModifiers(lInterface.getModifiers() | AbstractFamixEntity.MODIFIER_INTERFACE);
            FamixAssociation subtyping = getFactory().createSubtyping(getCurrType(), lInterface);
            subtyping.setSourceAnchor(getSourceAnchor(superInterface));
            getModel().addRelation(subtyping);
        }
    }
View Full Code Here

//            lSuperClass = getClass(superType.resolveBinding(), superType, false);
//        }
        if (superType != null) {
            FamixClass lSuperClass = getClass(superType.resolveBinding(), superType, false);
          lSuperClass = (FamixClass) getModel().addElement(lSuperClass);
          FamixAssociation inheritance = getFactory().createInheritance(getCurrType(), lSuperClass);
        
          inheritance.setSourceAnchor(getSourceAnchor(superType));
        
          getModel().addRelation(inheritance);
        }
    }
View Full Code Here

                        calleeMethod = unresolvedMethodInvocation.createMethodFromSignature();
                        calleeMethod = (FamixMethod) getModel().addElement(calleeMethod);
                    }

                    if (calleeMethod != null) {
                        FamixAssociation invocation =
                                unresolvedMethodInvocation.getCrawler().getFactory().createInvocation(
                                        method,
                                        calleeMethod);
                        invocation.setStatement(unresolvedMethodInvocation.getStatement());
                        invocation.setSourceAnchor(unresolvedMethodInvocation.getInvocationHandler().getSourceAnchor());
                        getModel().addRelation(invocation);

                        // add the corresponding constructor to the anonymous class (only for anonymous classes)
                        if (unresolvedMethodInvocation instanceof UnresolvedAnonymousClassInstanceCreationInvocation) {
                            addAnonymousClass(unresolvedMethodInvocation, calleeMethod);
View Full Code Here

TOP

Related Classes of org.evolizer.famix.model.entities.FamixAssociation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.