Examples of matchCase()


Examples of org.osgi.framework.Filter.matchCase()

        dictionary.put("service.pid", "USB-1232312452");
        dictionary.put("vendor", "ibm");
        filter = new DefaultFilter(parser.parse(" ( & (service.pid=USB-1232312452)( | (vendor~=ericsson)( vendor  ~=ibm) ) ) "));
        Assert.assertEquals("(&(service.pid=USB-1232312452)(|(vendor~=ericsson)(vendor~=ibm)))", filter.toString());

        Assert.assertTrue(filter.matchCase(dictionary));

        dictionary.put("vendor", "ericssin");
        filter = new DefaultFilter(parser.parse(" ( & (service.pid=USB-1232312452)( | (   vendor   ~=ericsson)(vendor~=ibm) ) ) "));

        Assert.assertFalse(filter.matchCase(dictionary));
View Full Code Here

Examples of org.osgi.framework.Filter.matchCase()

        Assert.assertTrue(filter.matchCase(dictionary));

        dictionary.put("vendor", "ericssin");
        filter = new DefaultFilter(parser.parse(" ( & (service.pid=USB-1232312452)( | (   vendor   ~=ericsson)(vendor~=ibm) ) ) "));

        Assert.assertFalse(filter.matchCase(dictionary));

        dictionary.put("vendor", "ericssin01");
        filter = new DefaultFilter(parser.parse(" ( & (service.pid=USB-1232312452)( | (vendor~=ericsson01)(vendor~=ibm) ) (!(vendor=ibm))) "));

        Assert.assertTrue(filter.matchCase(dictionary));
View Full Code Here

Examples of org.osgi.framework.Filter.matchCase()

        Assert.assertFalse(filter.matchCase(dictionary));

        dictionary.put("vendor", "ericssin01");
        filter = new DefaultFilter(parser.parse(" ( & (service.pid=USB-1232312452)( | (vendor~=ericsson01)(vendor~=ibm) ) (!(vendor=ibm))) "));

        Assert.assertTrue(filter.matchCase(dictionary));

        dictionary.put("present", "oohrah");
        filter = new DefaultFilter(parser.parse(" ( present =*) "));

        Assert.assertTrue(filter.matchCase(dictionary));
View Full Code Here

Examples of org.osgi.framework.Filter.matchCase()

        Assert.assertTrue(filter.matchCase(dictionary));

        dictionary.put("present", "oohrah");
        filter = new DefaultFilter(parser.parse(" ( present =*) "));

        Assert.assertTrue(filter.matchCase(dictionary));

        dictionary.put("substr", "How now brown cow");
        filter = new DefaultFilter(parser.parse(" ( substr =*no*brown*) "));

        Assert.assertTrue(filter.matchCase(dictionary));
View Full Code Here

Examples of org.osgi.framework.Filter.matchCase()

        properties);
    /*
     * we can use matchCase here since properties already supports case
     * insensitive key lookup.
     */
    return f.matchCase(d);
  }

  /**
   * Returns the string representation of this EndpointDescription.
   *
 
View Full Code Here

Examples of org.osgi.framework.Filter.matchCase()

    Filter f = filter;
    if (f == null) {
      // it's "*"
      return true;
    }
    return f.matchCase(requested.getProperties());
  }

  /**
   * Returns the canonical string representation of the actions. Always
   * returns present actions in the following canonical order:
View Full Code Here

Examples of org.osgi.framework.Filter.matchCase()

    public List<ArtifactObject> lrp(String filter) throws Exception {
        Filter f = m_context.createFilter(filter);
        List<ArtifactObject> rps = m_artifactRepository.getResourceProcessors();
        List<ArtifactObject> res = new LinkedList<ArtifactObject>();
        for (ArtifactObject rp : rps) {
            if (f.matchCase(rp.getDictionary())) {
                res.add(rp);
            }
        }
        return res;
    }
View Full Code Here

Examples of org.osgi.framework.Filter.matchCase()

            return !copy.isEmpty();
        }

        Filter f = FrameworkUtil.createFilter(filter);
        for (Dictionary<String, String> entry : copy) {
            if (f.matchCase(entry)) {
                return true;
            }
        }

        return false;
View Full Code Here

Examples of org.osgi.framework.Filter.matchCase()

        List<Map<String, String>> result = new ArrayList<Map<String, String>>();

        Filter f = FrameworkUtil.createFilter(filter);
        for (Dictionary<String, String> entry : copy) {
            if (f.matchCase(entry)) {
                result.add(toMap(entry));
                m_queue.remove(entry);
            }
        }
View Full Code Here

Examples of org.osgi.framework.Filter.matchCase()

        properties);
    /*
     * we can use matchCase here since properties already supports case
     * insensitive key lookup.
     */
    return f.matchCase(d);
  }

  /**
   * Returns the string representation of this EndpointDescription.
   *
 
View Full Code Here
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.