public static String substitute()

in src/java/org/apache/ivy/core/IvyPatternHelper.java [129:170]


    public static String substitute(String pattern, String org, String module, String branch,
            String revision, String artifact, String type, String ext, String conf,
            ArtifactOrigin origin, Map<String, String> extraModuleAttributes, Map<String, String> extraArtifactAttributes) {
        Map<String, Object> tokens = new HashMap<>();
        if (extraModuleAttributes != null) {
            for (Map.Entry<String, String> entry : extraModuleAttributes.entrySet()) {
                String token = entry.getKey();
                if (token.indexOf(':') > 0) {
                    token = token.substring(token.indexOf(':') + 1);
                }
                tokens.put(token, new Validated(token, entry.getValue()));
            }
        }
        if (extraArtifactAttributes != null) {
            for (Map.Entry<String, String> entry : extraArtifactAttributes.entrySet()) {
                String token = entry.getKey();
                if (token.indexOf(':') > 0) {
                    token = token.substring(token.indexOf(':') + 1);
                }
                tokens.put(token, new Validated(token, entry.getValue()));
            }
        }
        tokens.put(ORGANISATION_KEY, org == null ? "" : new Validated(ORGANISATION_KEY, org));
        tokens.put(ORGANISATION_KEY2, org == null ? "" : new Validated(ORGANISATION_KEY2, org));
        tokens.put(ORGANISATION_PATH_KEY, org == null ? "" : org.replace('.', '/'));
        tokens.put(MODULE_KEY, module == null ? "" : new Validated(MODULE_KEY, module));
        tokens.put(BRANCH_KEY, branch == null ? "" : new Validated(BRANCH_KEY, branch));
        tokens.put(REVISION_KEY, revision == null ? "" : new Validated(REVISION_KEY, revision));
        tokens.put(ARTIFACT_KEY, new Validated(ARTIFACT_KEY, artifact == null ? module : artifact));
        tokens.put(TYPE_KEY, type == null ? "jar" : new Validated(TYPE_KEY, type));
        tokens.put(EXT_KEY, ext == null ? "jar" : new Validated(EXT_KEY, ext));
        tokens.put(CONF_KEY, conf == null ? "default" : new Validated(CONF_KEY, conf));
        if (origin == null) {
            tokens.put(ORIGINAL_ARTIFACTNAME_KEY, new OriginalArtifactNameValue(org, module,
                    branch, revision, artifact, type, ext, extraModuleAttributes,
                    extraArtifactAttributes));
        } else {
            tokens.put(ORIGINAL_ARTIFACTNAME_KEY, new OriginalArtifactNameValue(origin));
        }

        return substituteTokens(pattern, tokens, false);
    }