Package java.util.Map

Examples of java.util.Map.Entry


        Map<String, Map<String, Object>> resolvedDependencies = new HashMap<String, Map<String, Object>>();

        Set entries = prop.entrySet();
        Iterator iterator = entries.iterator();
        String propertyName;
        Entry currentEntry;

        while ( iterator.hasNext() )
        {
            currentEntry = (Entry) iterator.next();
            propertyName = (String) currentEntry.getKey();

            if ( propertyName.startsWith( "dependency." ) )
            {
                Map<String, Object> versionMap;
                String artifactVersionlessKey;
                int startIndex;
                int endIndex;
                String versionType;

                startIndex = propertyName.lastIndexOf( "dependency." );

                if ( propertyName.indexOf( ".development" ) != -1 )
                {
                    endIndex = propertyName.indexOf( ".development" );
                    versionType = ReleaseDescriptor.DEVELOPMENT_KEY;
                }
                else
                {
                    endIndex = propertyName.indexOf( ".release" );
                    versionType = ReleaseDescriptor.RELEASE_KEY;
                }

                artifactVersionlessKey = propertyName.substring( startIndex, endIndex );

                if ( resolvedDependencies.containsKey( artifactVersionlessKey ) )
                {
                    versionMap = resolvedDependencies.get( artifactVersionlessKey );
                }
                else
                {
                    versionMap = new HashMap<String, Object>();
                    resolvedDependencies.put( artifactVersionlessKey, versionMap );
                }

                versionMap.put( versionType, currentEntry.getValue() );
            }
        }

        descriptor.setResolvedSnapshotDependencies( resolvedDependencies );
    }
View Full Code Here


        }
        project.setUserProperty("ivy.packager.restricted", "" + this.restricted);
        project.setUserProperty("ivy.packager.quiet", String.valueOf(quiet));
        if (properties != null) {
            for (Iterator it = properties.entrySet().iterator(); it.hasNext();) {
                Entry entry = (Entry) it.next();
                project.setUserProperty((String) entry.getKey(), (String) entry.getValue());
            }
        }

        // Execute task
        Message.verbose("performing packager resolver build in " + this.dir);
View Full Code Here

                out.print(licenseHeader);
            }
            StringBuffer xmlNamespace = new StringBuffer();
            Map namespaces = md.getExtraAttributesNamespaces();
            for (Iterator iter = namespaces.entrySet().iterator(); iter.hasNext();) {
                Entry ns = (Entry) iter.next();
                xmlNamespace.append(" xmlns:").append(ns.getKey()).append("=\"")
                        .append(ns.getValue()).append("\"");
            }

            String version = "2.0";
            if (md.getInheritedDescriptors().length > 0) {
                version = "2.2";
View Full Code Here

        return engine;
    }

    void blacklist(IvyNode node) {
        for (Iterator iter = visitData.entrySet().iterator(); iter.hasNext();) {
            Entry entry = (Entry) iter.next();
            VisitData vdata = (VisitData) entry.getValue();
            if (vdata.getNode() == node && !node.getResolvedId().equals(entry.getKey())) {
                // this visit data was associated with the blacklisted node,
                // we discard this association
                iter.remove();
            }
        }
View Full Code Here

                Long.toString(md.getPublicationDate().getTime()));
        }

        Map extra = mrid.getExtraAttributes();
        for (Iterator iter = extra.entrySet().iterator(); iter.hasNext();) {
            Entry entry = (Entry) iter.next();
            getProject().setProperty(property + ".extra." + entry.getKey(),
                (String) entry.getValue());
        }

        getProject().setProperty(property + ".configurations",
            mergeConfs(md.getConfigurationsNames()));

        // store the public configurations in a separate property
        Configuration[] configs = md.getConfigurations();
        List publicConfigsList = new ArrayList();
        for (int i = 0; i < configs.length; i++) {
            String name = configs[i].getName();
            if (Visibility.PUBLIC.equals(configs[i].getVisibility())) {
                publicConfigsList.add(name);
            }

            if (configs[i].getDescription() != null) {
                getProject().setProperty(property + ".configuration." + name + ".desc",
                    configs[i].getDescription());
            }
        }
        String[] publicConfigs = (String[]) publicConfigsList.toArray(new String[publicConfigsList
                .size()]);
        getProject().setProperty(property + ".public.configurations", mergeConfs(publicConfigs));

        Artifact[] artifacts = md.getAllArtifacts();
        for (int i = 0; i < artifacts.length; i++) {
            int id = i + 1;
            getProject()
                    .setProperty(property + ".artifact." + id + ".name", artifacts[i].getName());
            getProject()
                    .setProperty(property + ".artifact." + id + ".type", artifacts[i].getType());
            getProject().setProperty(property + ".artifact." + id + ".ext", artifacts[i].getExt());
            getProject().setProperty(property + ".artifact." + id + ".conf",
                mergeConfs(artifacts[i].getConfigurations()));

            Map artiExtra = artifacts[i].getExtraAttributes();
            for (Iterator iter = artiExtra.entrySet().iterator(); iter.hasNext();) {
                Entry entry = (Entry) iter.next();
                getProject().setProperty(property + ".artifact." + id + ".extra." + entry.getKey(),
                    (String) entry.getValue());
            }
        }
    }
View Full Code Here

        try {
            StringBuffer sb = new StringBuffer();

            Iterator keyItr = destToSrcMap.entrySet().iterator();
            while (keyItr.hasNext()) {
                Entry/* <File, File> */entry = (Entry) keyItr.next();
                File destFile = (File) entry.getKey();
                File srcFile = (File) entry.getValue();
                if (!ALLOWED_PATH_PATTERN.matcher(srcFile.getAbsolutePath()).matches()) {
                    throw new IOException("Unsafe file to 'mass' symlink: '"
                            + srcFile.getAbsolutePath() + "'");
                }
                if (!ALLOWED_PATH_PATTERN.matcher(destFile.getAbsolutePath()).matches()) {
View Full Code Here

        if (stdAttributes != null) {
            this.attributes.putAll(stdAttributes);
        }
        if (extraAttributes != null) {
            for (Iterator iter = extraAttributes.entrySet().iterator(); iter.hasNext();) {
                Entry extraAtt = (Entry) iter.next();
                setExtraAttribute((String) extraAtt.getKey(), (String) extraAtt.getValue());
            }
        }
    }
View Full Code Here

     */
    public void updateProject(String id) {
        Map r = new HashMap(super.getVariables());
        r.putAll(overwrittenProperties);
        for (Iterator it = r.entrySet().iterator(); it.hasNext();) {
            Entry entry = (Entry) it.next();

            setPropertyIfNotSet((String) entry.getKey(), (String) entry.getValue());
            if (id != null) {
                setPropertyIfNotSet((String) entry.getKey() + "." + id, (String) entry.getValue());
            }
        }

        if (getEnvironmentPrefix() != null) {
            Property propTask = new Property();
View Full Code Here

            specWidth = Math.min(MAX_SPEC_WIDTH, Math.max(specWidth, option.getSpec().length()));
        }

        // print options help
        for (Iterator iterator = categories.entrySet().iterator(); iterator.hasNext();) {
            Entry entry = (Entry) iterator.next();
            String category = (String) entry.getKey();
            pw.println("==== " + category);
            List/* <Option> */options = (List) entry.getValue();
            for (Iterator it = options.iterator(); it.hasNext();) {
                Option option = (Option) it.next();
                if (option.isDeprecated() && !showDeprecated) {
                    continue;
                }
View Full Code Here

    public MapMatcher(Map attributes, PatternMatcher pm) {
        this.attributes = attributes;
        this.pm = pm;
        for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();) {
            Entry entry = (Entry) iter.next();
            String value = (String) entry.getValue();
            if (value != null) {
                matchers.put(entry.getKey(), pm.getMatcher(value));
            }
        }
    }
View Full Code Here

TOP

Related Classes of java.util.Map.Entry

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.