Package org.apache.tapestry.ioc

Examples of org.apache.tapestry.ioc.IdMatcher


    private Collection<DependencyNode<T>> findDependencies(String sourceId, String patternList)
    {
        String sourceModuleId = IOCUtilities.extractModuleId(sourceId);

        IdMatcher matcher = buildMatcherForPattern(sourceModuleId, patternList);

        Collection<DependencyNode<T>> result = newList();

        for (String id : _dependencyNodesById.keySet())
        {
            if (sourceId.equals(id)) continue;

            if (matcher.matches(id)) result.add(_dependencyNodesById.get(id));
        }

        return result;
    }


    {
        List<IdMatcher> matchers = newList();

        for (String pattern : patternList.split(","))
        {
            IdMatcher matcher = new IdMatcherImpl(IOCUtilities.toQualifiedId(
                    sourceModuleId,
                    pattern.trim()));
            matchers.add(matcher);
        }

    }

    @Test(dataProvider = "id_match_values")
    public void id_match(String pattern, boolean expectedMatch)
    {
        IdMatcher matcher = new IdMatcherImpl(pattern);

        Assert.assertEquals(matcher.matches("foo.bar.Baz"), expectedMatch);
    }

        List<IdMatcher> matchers = CollectionFactory.newList();

        for (String pattern : notNull(patterns, "patterns"))
        {
            IdMatcher matcher = new IdMatcherImpl(pattern);
            matchers.add(matcher);
        }

        _idMatcher = new OrIdMatcher(matchers);

TOP

Related Classes of org.apache.tapestry.ioc.IdMatcher

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.