Package java.util

Examples of java.util.LinkedHashSet$MyIterator


    protected static void copyProperties(
        final Object from,
        final Object to)
        throws Exception
    {
        final Set methods = new LinkedHashSet();
        loadSuperMethods(
            from.getClass(),
            methods);
        for (final Iterator iterator = methods.iterator(); iterator.hasNext();)
        {
            final Method method = (Method)iterator.next();

            final String methodName = method.getName();
            final String getPrefix = "get";
View Full Code Here


                    final URL resourceDirectory = resourceDirectories[ctr];
                    final List contents = ResourceUtils.getDirectoryContents(
                            resourceDirectory,
                            false,
                            null);
                    final Set newContents = new LinkedHashSet();
                    locations.put(
                        location,
                        newContents);
                    for (final ListIterator contentsIterator = contents.listIterator(); contentsIterator.hasNext();)
                    {
                        final String path = (String)contentsIterator.next();
                        if (!path.endsWith(FORWARD_SLASH))
                        {
                            boolean hasNewPath = false;
                            for (final Iterator mappingIterator = this.mappings.iterator(); mappingIterator.hasNext();)
                            {
                                final Mapping mapping = (Mapping)mappingIterator.next();
                                String newPath = mapping.getMatch(path);
                                if (newPath != null && newPath.length() > 0)
                                {
                                    final URL absolutePath = ResourceUtils.getResource(path);
                                    if (absolutePath != null)
                                    {
                                        newPath =
                                            this.getTemplateEngine().getEvaluatedExpression(
                                                newPath,
                                                this.templateContext);
                                        ResourceWriter.instance().writeUrlToFile(
                                            absolutePath,
                                            ResourceUtils.normalizePath(TEMPORARY_MERGE_LOCATION + '/' + newPath));
                                        newContents.add(newPath);
                                        hasNewPath = true;
                                    }
                                }
                            }
                            if (!hasNewPath)
                            {
                                newContents.add(path);
                            }
                        }
                    }
                }
            }
View Full Code Here

     *
     * @see org.andromda.metafacades.uml.FrontEndUseCase#getActions()
     */
    public List getActions()
    {
        final Collection actions = new LinkedHashSet();

        final Collection pages = getPages();
        for (final Iterator pageIterator = pages.iterator(); pageIterator.hasNext();)
        {
            final StrutsJsp jsp = (StrutsJsp)pageIterator.next();
            actions.addAll(jsp.getActions());
        }

        final StrutsActivityGraph graph = (StrutsActivityGraph)getActivityGraph();
        if (graph != null)
        {
            final StrutsAction action = graph.getFirstAction();
            if (action != null) actions.add(action);
        }

        return new ArrayList(actions);
    }
View Full Code Here

     * @throws MalformedURLException
     */
    protected void initializeClassLoader(final List classpathFiles)
        throws MalformedURLException
    {
        final Set classpathUrls = new LinkedHashSet();
        classpathUrls.add(new File(this.project.getBuild().getOutputDirectory()).toURI().toURL());
        if (classpathFiles != null && classpathFiles.size() > 0)
        {
            for (int ctr = 0; ctr < classpathFiles.size(); ++ctr)
            {
                final File file = new File((String)classpathFiles.get(ctr));
                if (this.getLog().isDebugEnabled())
                {
                    getLog().debug("adding to classpath '" + file + "'");
                }
                classpathUrls.add(file.toURI().toURL());
            }
        }
        final URLClassLoader loader =
            new URLClassLoader((URL[])classpathUrls.toArray(new URL[0]),
                Thread.currentThread().getContextClassLoader());
        Thread.currentThread().setContextClassLoader(loader);
    }
View Full Code Here

     *
     * @see org.andromda.metafacades.uml.FrontEndActionState#getContainerActions()
     */
    public List getContainerActions()
    {
        final Collection actionSet = new LinkedHashSet();

        final StateMachineFacade stateMachineFacade = this.getStateMachine();
        if (stateMachineFacade instanceof ActivityGraphFacade)
        {
            final ActivityGraphFacade activityGraph = (ActivityGraphFacade)stateMachineFacade;
            final UseCaseFacade useCase = activityGraph.getUseCase();

            if (useCase instanceof StrutsUseCase)
            {
                final Collection actions = ((StrutsUseCase)useCase).getActions();
                for (final Iterator actionIterator = actions.iterator(); actionIterator.hasNext();)
                {
                    final StrutsAction action = (StrutsAction)actionIterator.next();
                    if (action.getActionStates().contains(this))
                    {
                        actionSet.add(action);
                    }
                }
            }
        }
        return new ArrayList(actionSet);
View Full Code Here

        final ClassifierFacade facade,
        final boolean includeSuperclasses)
    {
        try
        {
            final Set declarationSet = new LinkedHashSet();
            if (this.featureMap == null)
            {
                this.featureMap = new HashMap();
                if (includeSuperclasses && this.getGeneralizations() != null)
                {
View Full Code Here

    /**
     * @see org.andromda.cartridges.meta.metafacades.MetafacadeLogic#getAllParents()
     */
    protected Collection handleGetAllParents()
    {
        Set allParents = new LinkedHashSet();
        final Collection parents = this.getGeneralizations();
        allParents.addAll(parents);
        for (final Iterator iterator = parents.iterator(); iterator.hasNext();)
        {
            final Object object = iterator.next();
            if (object instanceof Metafacade)
            {
                final Metafacade metafacade = (Metafacade)object;
                allParents.addAll(metafacade.getAllParents());   
            }
        }
        return allParents;
    }
View Full Code Here

     *
     * @see org.andromda.metafacades.uml.FrontEndControllerOperation#getDeferringActions()
     */
    public java.util.List getDeferringActions()
    {
        final Collection deferringActions = new LinkedHashSet();

        final FrontEndActivityGraph graph = getActivityGraph();
        if (graph != null)
        {
            final Collection actionStates = graph.getActionStates();
            for (final Iterator actionStateIterator = actionStates.iterator(); actionStateIterator.hasNext();)
            {
                final Object actionStateObject = actionStateIterator.next();
                if (actionStateObject instanceof StrutsActionState)
                {
                    final StrutsActionState actionState = (StrutsActionState)actionStateObject;
                    final Collection controllerCalls = actionState.getControllerCalls();
                    for (final Iterator controllerCallIterator = controllerCalls.iterator();
                         controllerCallIterator.hasNext();)
                    {
                        final OperationFacade operation = (OperationFacade)controllerCallIterator.next();
                        if (this.equals(operation))
                        {
                            deferringActions.addAll(actionState.getContainerActions());
                        }
                    }
                }
            }

            final Collection transitions = graph.getTransitions();
            for (final Iterator transitionIterator = transitions.iterator(); transitionIterator.hasNext();)
            {
                final StrutsForward transition = (StrutsForward)transitionIterator.next();
                final EventFacade event = transition.getTrigger();
                if (event instanceof StrutsTrigger)
                {
                    final StrutsTrigger trigger = (StrutsTrigger)event;
                    final FrontEndControllerOperation operation = trigger.getControllerCall();
                    if (this.equals(operation))
                    {
                        // we have two types of controller calls: the ones in action states and the ones for decisions
                        final StateVertexFacade source = transition.getSource();
                        if (source instanceof StrutsActionState)
                        {
                            final StrutsActionState sourceActionState = (StrutsActionState)source;
                            deferringActions.addAll(sourceActionState.getContainerActions());
                        }

                        // test for decision
                        final StateVertexFacade target = transition.getTarget();
                        if (target instanceof StrutsPseudostate)
                        {
                            final StrutsPseudostate targetPseudoState = (StrutsPseudostate)target;
                            if (targetPseudoState.isDecisionPoint())
                            {
                                deferringActions.addAll(targetPseudoState.getContainerActions());
                            }
                        }
                    }
                }
            }
View Full Code Here

    {
        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);
                            }
View Full Code Here

    /**
     * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsController#getDeferringActions()
     */
    public List getDeferringActions()
    {
        final Collection deferringActions = new LinkedHashSet();

        final Collection operations = getOperations();
        for (final Iterator operationIterator = operations.iterator(); operationIterator.hasNext();)
        {
            final StrutsControllerOperation operation = (StrutsControllerOperation)operationIterator.next();
            deferringActions.addAll(operation.getDeferringActions());
        }
        return new ArrayList(deferringActions);
    }
View Full Code Here

TOP

Related Classes of java.util.LinkedHashSet$MyIterator

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.