Package java.util

Examples of java.util.LinkedHashMap$Entry


    }

    protected Map handleGetAllMessages()
    {
        final boolean normalize = this.normalizeMessages();
        final Map messages = (normalize) ? (Map)new TreeMap() : (Map)new LinkedHashMap();

        if (this.isApplicationUseCase())
        {
            final List useCases = this.getAllUseCases();
            for (int i = 0; i < useCases.size(); i++)
View Full Code Here


    /**
     * @see org.andromda.metafacades.uml.FrontEndActionState#getExceptions()
     */
    public java.util.List getExceptions()
    {
        final Map exceptionsMap = new LinkedHashMap();
        final Collection outgoing = getOutgoing();
        for (final Iterator iterator = outgoing.iterator(); iterator.hasNext();)
        {
            final TransitionFacade transition = (TransitionFacade)iterator.next();
            if (transition instanceof StrutsExceptionHandler)
            {
                exceptionsMap.put(((StrutsExceptionHandler)transition).getExceptionKey(), transition);
            }
        }
        return new ArrayList(exceptionsMap.values());
    }
View Full Code Here

    {
        try
        {
            final File earDirectory =
                new File(this.project.getBuild().getDirectory() + '/' + project.getBuild().getFinalName());
            final Map artifacts = new LinkedHashMap();
            for (final Iterator iterator = this.getExplodedModuleArtifacts().iterator(); iterator.hasNext();)
            {
                final Artifact artifact = (Artifact)iterator.next();
                artifacts.put(
                    artifact.getFile().toString().replaceAll(
                        ".*(\\\\|//)",
                        ""),
                    artifact);
            }

            if (earDirectory.exists() && earDirectory.isDirectory())
            {
                String linkCommand;
                if (isWindows)
                {
                    linkCommand = LN_WINDOWS;
                    final File executableFile =
                        new File(System.getProperty("java.io.tmpdir") + '/' + System.getProperty("user.name"),
                            LN_WINDOWS);
                    if (!executableFile.exists())
                    {
                        final URL resource =
                            Thread.currentThread().getContextClassLoader().getResource(LN_WINDOWS);
                        FileUtils.copyURLToFile(
                            resource,
                            executableFile);
                    }
                    linkCommand = executableFile.toString();
                }
                else
                {
                    linkCommand = LN_UNIX;
                }
                final File[] files = earDirectory.listFiles();
                final File explodedEarDirectory = new File(earDirectory + "-exploded");
                explodedEarDirectory.mkdirs();
                for (int ctr = 0; ctr < files.length; ctr++)
                {
                    final File file = files[ctr];
                    final String fileName = file.toString().replaceAll(
                            ".*(\\\\|//)",
                            "");
                    final Artifact artifact = (Artifact)artifacts.get(fileName);
                    if (artifact == null)
                    {
                        if (file.isFile())
                        {
                            FileUtils.copyFileToDirectory(
View Full Code Here

     * @param cartridges the cartridges loaded.
     * @return the loaded cartridge map.
     */
    private Map loadCartridgesByNamespace(final Collection cartridges)
    {
        final Map cartridgesByNamespace = new LinkedHashMap();
        for (final Iterator iterator = cartridges.iterator(); iterator.hasNext();)
        {
            final Cartridge cartridge = (Cartridge)iterator.next();
            cartridgesByNamespace.put(cartridge.getNamespace(), cartridge);
        }
        return cartridgesByNamespace;
    }
View Full Code Here

     *
     * @see org.andromda.metafacades.uml.FrontEndControllerOperation#getFormFields()
     */
    public List getFormFields()
    {
        final Map formFieldsMap = new LinkedHashMap();

        // for quick lookup we use a hashset for the argument names, we only consider parameters with a name
        // which is also present in this set
        final Set argumentNames = new LinkedHashSet();
        final Collection arguments = this.getArguments();
        for (final Iterator argumentIterator = arguments.iterator(); argumentIterator.hasNext();)
        {
            final ModelElementFacade element = (ModelElementFacade)argumentIterator.next();
            argumentNames.add(element.getName());
        }

        // get all actions deferring to this operation
        final List deferringActions = this.getDeferringActions();
        for (int i = 0; i < deferringActions.size(); i++)
        {
            final StrutsAction action = (StrutsAction)deferringActions.get(i);
            // store the action parameters
            final List actionFormFields = action.getActionFormFields();
            for (int j = 0; j < actionFormFields.size(); j++)
            {
                final ModelElementFacade parameter = (ModelElementFacade)actionFormFields.get(j);
                if (argumentNames.contains(parameter.getName()))
                {
                    formFieldsMap.put(parameter.getName(), parameter);
                }
            }
            // get all forwards and overwrite when we find a table (or add when not yet present)
            final List forwards = action.getActionForwards();
            for (int j = 0; j < forwards.size(); j++)
            {
                final StrutsForward forward = (StrutsForward)forwards.get(j);
                // only consider forwards directly entering a page
                if (forward.isEnteringPage())
                {
                    final List pageVariables = forward.getForwardParameters();
                    for (int k = 0; k < pageVariables.size(); k++)
                    {
                        final StrutsParameter pageVariable = (StrutsParameter)pageVariables.get(k);
                        if (argumentNames.contains(pageVariable.getName()))
                        {
                            if (!formFieldsMap.containsKey(pageVariable.getName()) || pageVariable.isTable())
                            {
                                formFieldsMap.put(pageVariable.getName(), pageVariable);
                            }
                        }
                    }
                }
            }
        }

        // since all arguments need to be present we add those that haven't yet been stored in the map
        for (final Iterator argumentIterator = arguments.iterator(); argumentIterator.hasNext();)
        {
            final StrutsParameter argument = (StrutsParameter)argumentIterator.next();
            if (!formFieldsMap.containsKey(argument.getName()))
            {
                formFieldsMap.put(argument.getName(), argument);
            }
        }

        return new ArrayList(formFieldsMap.values());
    }
View Full Code Here

    private Map getNamespaceElements(final String namespace)
    {
        Map namespaceElements = (Map)this.allElements.get(namespace);
        if (namespaceElements == null)
        {
            namespaceElements = new LinkedHashMap();
            this.allElements.put(
                namespace,
                namespaceElements);
        }
        return namespaceElements;
View Full Code Here

     *
     * @return the map containing all properties
     */
    public Map getAllProperties()
    {
        final Map allProperties = new LinkedHashMap();
        for (final Iterator iterator = this.locations.iterator(); iterator.hasNext();)
        {
            final String location = (String)iterator.next();
            final List resources =
                ResourceUtils.getDirectoryContents(
                    ResourceUtils.toURL(location),
                    true,
                    LOCATION_PATTERNS);
            if (resources != null)
            {
                for (final Iterator resourceIterator = resources.iterator(); resourceIterator.hasNext();)
                {
                    final String path = (String)resourceIterator.next();
                    final URL resource = ResourceUtils.toURL(path);
                    final Properties properties = new Properties();
                    InputStream stream = null;
                    try
                    {
                        stream = resource.openStream();
                        properties.load(stream);
                        allProperties.putAll(properties);
                    }
                    catch (final Exception exception)
                    {
                        // - ignore
                    }
                    finally
                    {
                        try
                        {
                            stream.close();
                            stream = null;
                        }
                        catch (IOException exception)
                        {
                            // - ignore
                        }
                    }
                }
            }
        }
        allProperties.putAll(this.properties);
        return allProperties;
    }
View Full Code Here

    {
        if (this.types.isEmpty())
        {
            throw new AndroMDAppException("No '" + DESCRIPTOR + "' descriptor files could be found");
        }
        final Map properties = new LinkedHashMap();
        for (final Iterator iterator = this.configurations.iterator(); iterator.hasNext();)
        {
            Configuration configuration = (Configuration)iterator.next();
            properties.putAll(configuration.getAllProperties());
        }
        final String applicationType = (String)properties.get(APPLICATION_TYPE);
        final Set validTypes = this.types.keySet();
        AndroMDAppType andromdapp = (AndroMDAppType)this.types.get(applicationType);
        if (andromdapp == null)
        {
            if (this.types.size() > 1)
View Full Code Here

        {
            messages = Collections.EMPTY_MAP;
        }
        else
        {
            messages = new LinkedHashMap(); // we want to keep the order

            for (final Iterator iterator = taggedValues.iterator(); iterator.hasNext();)
            {
                final String value = (String)iterator.next();
                messages.put(StringUtilsHelper.toResourceMessageKey(value), value);
View Full Code Here

     * @throws MojoExecutionException
     */
    private Map collectProjects(final String modules)
        throws MojoExecutionException
    {
        final Map projects = new LinkedHashMap();
        final Map poms = getModulePoms(modules);

        if (!poms.isEmpty())
        {
            for (final Iterator iterator = poms.keySet().iterator(); iterator.hasNext();)
            {
                final File pom = (File)iterator.next();
                try
                {
                    final MavenProject project = ProjectUtils.getProject(
                            this.projectBuilder,
                            this.session,
                            pom,
                            this.getLog());
                    if (project != null)
                    {
                        if (this.getLog().isDebugEnabled())
                        {
                            this.getLog().debug("Adding project " + project.getId());
                        }
                        projects.put(
                            project,
                            poms.get(pom));
                    }
                    else
                    {
View Full Code Here

TOP

Related Classes of java.util.LinkedHashMap$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.