[Issue 6501] Create dependencies between classes on import

[email protected] Sun, 21 Dec 2014 05:54:45 -0800 (PST)
Newsgroups gmane.comp.lang.uml.argouml.issues
Message-ID <[email protected]>
http://argouml.tigris.org/issues/show_bug.cgi?id=6501






------- Additional comments from [email protected] Sun Dec 21 05:54:45 -0800 2014 -------
Hi Bob,

as you mentioned in the mailing list, the HEAD version of the java module can
already create dependencies to classifiers in the same package. I've implemented
it in a way that this can easily be extended, see the '// ...' lines in the
following Modeller.java code snippet:

    void addClassifierDependency(String name) {
        String classifierName = stripVarargAndGenerics(name);
        Object clientObj = parseState.getClassifier();
        if (clientObj == null) {
            return;
        }
        Object supplierObj = null;
        
        // first try: lookup classifierName in same namespace
        Object ns = Model.getFacade().getNamespace(clientObj);
        if (ns != null) {
            supplierObj = Model.getFacade().lookupIn(ns, classifierName);
        }

        // second try: lookup in imports
        if (supplierObj == null) {
            String packageName = getPackageName(name);
            // ...
        }
        
        // third try: resolve fully qualified classifier (xxx.yyy.Zzz)
        String packageName = getPackageName(name);
        if (supplierObj == null && packageName.length() > 0) {
            classifierName = this.getClassifierName(name);
            // ...
        }
        
        // finally build the dependency
        if (supplierObj != null) {
            buildDependency(supplierObj, clientObj, null);
        }
    }

I'll see when I can get back to this, feel free to play with it yourself.

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=448&dsMessageId=3093214

To unsubscribe from this list, e-mail: [[email protected]].
Please do not reply to this mail. Instead, add your comments in the issue.