Examples of match()


Examples of org.apache.abdera.i18n.templates.Route.match()

   
    HashMapContext ctx = new HashMapContext();
    ctx.put("collection", "test");
    assertEquals("/test", route.expand(ctx));
   
    assertTrue(route.match("/foo"));
    assertFalse(route.match("/foo/test"));
    assertFalse(route.match("foo"));
   
    Map<String, String> vars = route.parse("/test");
    assertEquals("test", vars.get("collection"));

Examples of org.apache.batik.css.engine.sac.ExtendedSelector.match()

                StyleRule style = (StyleRule)r;
                SelectorList sl = style.getSelectorList();
                int slen = sl.getLength();
                for (int j = 0; j < slen; j++) {
                    ExtendedSelector s = (ExtendedSelector)sl.item(j);
                    if (s.match(elt, pseudo)) {
                        rules.add(style);
                    }
                }
                break;

Examples of org.apache.batik.css.sac.ExtendedSelector.match()

    CSSOMStyleRule sr = (CSSOMStyleRule)rule;
    SelectorList sl = sr.getSelectors();
    int slen = sl.getLength();
    for (int j = 0; j < slen; j++) {
        ExtendedSelector s = (ExtendedSelector)sl.item(j);
        if (s.match(e, pe)) {
                        sr.setBaseURI(buri);
      rl.append(rule);
        }
    }
    break;

Examples of org.apache.cayenne.exp.Expression.match()

        assertFalse("Failed: " + notBetween, notBetween.match(match2));

        Painting match3 = new Painting();
        match3.setEstimatedPrice(new BigDecimal(11));
        assertTrue("Failed: " + between, between.match(match3));
        assertFalse("Failed: " + notBetween, notBetween.match(match3));
    }

    public void testEvaluateIN() throws Exception {
        Expression in = new ASTIn(new ASTObjPath("estimatedPrice"), new ASTList(
                new Object[] {

Examples of org.apache.clerezza.triaxrs.util.URITemplate.match()

  public void simpleParameterizedeMatching() {
    URITemplate template1 = new URITemplate("widgets/{id}");
    Assert.assertEquals("Hello", template1.match(
        "widgets/Hello").getParameters().get("id"));
    URITemplate template2 = new URITemplate("widgets/{id}/{id2}");
    Assert.assertEquals("foo", template2.match(
        "widgets/foo/bar").getParameters().get("id"));
    Assert.assertEquals("foo", template2.match(
    "widgets/foo/bar/ignore").getParameters().get("id"));
    SortedSet<URITemplate> set = new TreeSet<URITemplate>();
    set.add(template1);

Examples of org.apache.cocoon.matching.Matcher.match()

            result = this.threadSafeMatcher.match(resolvedPattern, objectModel, resolvedParams);
        } else {
            // Get matcher from selector
            Matcher matcher = (Matcher)this.selector.select(this.componentName);
            try {
                result = matcher.match(resolvedPattern, objectModel, resolvedParams);
            } finally {
                this.selector.release(matcher);
            }
        }

Examples of org.apache.cocoon.sitemap.matcher.WildcardMatcher.match()

public class WildcardMatcherTest {

    @Test
    public void testMatcher() {
        WildcardMatcher matcher = new WildcardMatcher();
        Map<String, String> result = matcher.match("*/{name}/**/{id}", "abc/def/ghi/jkl/5");
        Assert.assertEquals("A parameter 'name' is expected.", "def", result.get("name"));
        Assert.assertEquals("A parameter 'id' is expected.", "5", result.get("id"));
        Assert.assertEquals("A result value '1' is expected.", "abc", result.get("1"));
        Assert.assertEquals("A result value '2' is expected.", "def", result.get("2"));
        Assert.assertEquals("A result value '3' is expected.", "ghi/jkl", result.get("3"));

Examples of org.apache.cocoon.sitemap.node.MatchNode.MatcherContext.match()

    @Test
    public void endsWithMatchingAttribute() throws Exception {
        MatchNode matchNode = new MatchNode();
        PrivateAccessor.setField(matchNode, "endsWith", ".xml");
        MatcherContext matcherContext = matchNode.lookupMatcherContext();
        Map<String, String> matches = matcherContext.match("abc.xml");
        assertTrue(matches.containsValue("abc.xml"));
        assertTrue(matches.containsValue("abc"));
        assertEquals(2, matches.size());
    }

Examples of org.apache.commons.digester.Rules.match()

     * @param path the digester path to add rule at
     * @param rule the <code>Rule</code> to add
     */
    protected void addRule(String path, Rule rule) {
        Rules rules = digester.getRules();
        List matches = rules.match(null, path);
        if ( matches.isEmpty() ) {
            if ( log.isDebugEnabled() ) {
                log.debug( "Adding digester rule for path: " + path + " rule: " + rule );
            }
            digester.addRule( path, rule );

Examples of org.apache.commons.digester3.RegexRules.match()

        rules.add( "/a/d", new TestRule( "beta" ) );
        rules.add( "/b", new TestRule( "gamma" ) );

        // now test a few patterns
        // check that all are return in the order which they were added
        List<Rule> matches = rules.match( "", "x/g/e", null, null );
        assertEquals( "Wrong number of rules returned (1)", 3, matches.size() );
        assertEquals( "Rule Out Of Order (1)", "alpha", ( (TestRule) matches.get( 0 ) ).getIdentifier() );
        assertEquals( "Rule Out Of Order (2)", "beta", ( (TestRule) matches.get( 1 ) ).getIdentifier() );
        assertEquals( "Rule Out Of Order (3)", "gamma", ( (TestRule) matches.get( 2 ) ).getIdentifier() );
TOP
Copyright © 2018 www.massapi.com. 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.