src/java/fr/jayasoft/ivy/DefaultModuleDescriptor.java
/**
     * Transforms the given module descriptor of the given namespace and return
     * a new module descriptor in the system namespace.
     * 
     * <i>Note that dependency exclude rules are not converted in system namespace, because they aren't 
     * transformable (the name space hasn't the ability to convert regular expressions)</i>
     * 
     * @param md
     * @param ns
     * @return
     */
Transforms the given module descriptor of the given namespace and return
a new module descriptor in the system namespace.

Note that dependency exclude rules are not converted in system namespace, because they aren't
transformable (the name space hasn't the ability to convert regular expressions)

@param md
@param ns
@return
Transforms the given module descriptor of the given namespace and return a new module descriptor in the system namespace . Note that dependency exclude rules are not converted in system namespace because they aren ' t transformable ( the name space hasn ' t the ability to convert regular expressions ) @param md @param ns @return
public static ModuleDescriptor transformInstance(ModuleDescriptor md, Namespace ns) {
        NamespaceTransformer t = ns.getToSystemTransformer();
        if (t.isIdentity()) {
            return md;
        }
        DefaultModuleDescriptor nmd = new DefaultModuleDescriptor(md.getParser(), md.getResource());
        nmd._revId = t.transform(md.getModuleRevisionId());
        nmd._resolvedRevId = t.transform(md.getResolvedModuleRevisionId());
        nmd._status = md.getStatus();
        nmd._publicationDate = md.getPublicationDate();
        nmd._resolvedPublicationDate = md.getResolvedPublicationDate();
        DependencyDescriptor[] dd = md.getDependencies();
        for (int i = 0; i < dd.length; i++) {
            nmd._dependencies.add(NameSpaceHelper.toSystem(dd[i], ns));
        }
        Configuration[] confs = md.getConfigurations();
        for (int i = 0; i < confs.length; i++) {
            nmd._configurations.put(confs[i].getName(), confs[i]);
            Artifact[] arts = md.getArtifacts(confs[i].getName());
            for (int j = 0; j < arts.length; j++) {
                nmd.addArtifact(confs[i].getName(), NameSpaceHelper.transform(arts[j], t));
            }
        }
        nmd.setDefault(md.isDefault());
        if (md instanceof DefaultModuleDescriptor) {
            DefaultModuleDescriptor dmd = (DefaultModuleDescriptor)md;
            nmd._conflictManagers.putAll(dmd._conflictManagers);
        } else {
            Message.warn("transformed module descriptor is not a default module descriptor: impossible to copy conflict manager configuration: "+md);
        }
        nmd._licenses.addAll(Arrays.asList(md.getLicenses()));
        nmd._homePage = md.getHomePage();
        nmd._lastModified = md.getLastModified();
        nmd._namespace = ns;
        return nmd;
    }
public static ModuleDescriptor transformInstance ( ModuleDescriptor md , Namespace ns ) { NamespaceTransformer t = ns . getToSystemTransformer ( ) ; if ( t . isIdentity ( ) ) { return md ; } DefaultModuleDescriptor nmd = new DefaultModuleDescriptor ( md . getParser ( ) , md . getResource ( ) ) ; nmd . _revId = t . transform ( md . getModuleRevisionId ( ) ) ; nmd . _resolvedRevId = t . transform ( md . getResolvedModuleRevisionId ( ) ) ; nmd . _status = md . getStatus ( ) ; nmd . _publicationDate = md . getPublicationDate ( ) ; nmd . _resolvedPublicationDate = md . getResolvedPublicationDate ( ) ; DependencyDescriptor [ ] dd = md . getDependencies ( ) ; for ( int i = 0 ; i < dd . length ; i ++ ) { nmd . _dependencies . add ( NameSpaceHelper . toSystem ( dd [ i ] , ns ) ) ; } Configuration [ ] confs = md . getConfigurations ( ) ; for ( int i = 0 ; i < confs . length ; i ++ ) { nmd . _configurations . put ( confs [ i ] . getName ( ) , confs [ i ] ) ; Artifact [ ] arts = md . getArtifacts ( confs [ i ] . getName ( ) ) ; for ( int j = 0 ; j < arts . length ; j ++ ) { nmd . addArtifact ( confs [ i ] . getName ( ) , NameSpaceHelper . transform ( arts [ j ] , t ) ) ; } } nmd . setDefault ( md . isDefault ( ) ) ; if ( md instanceof DefaultModuleDescriptor ) { DefaultModuleDescriptor dmd = ( DefaultModuleDescriptor ) md ; nmd . _conflictManagers . putAll ( dmd . _conflictManagers ) ; } else { Message . warn ( "transformed module descriptor is not a default module descriptor: impossible to copy conflict manager configuration: " + md ) ; } nmd . _licenses . addAll ( Arrays . asList ( md . getLicenses ( ) ) ) ; nmd . _homePage = md . getHomePage ( ) ; nmd . _lastModified = md . getLastModified ( ) ; nmd . _namespace = ns ; return nmd ; }
Transforms the given module descriptor of the given namespace and return
 a new module descriptor in the system namespace.
Transforms the given module descriptor of the given namespace and return a new module descriptor in the system namespace .