org.osgi.framework.Filter.matchCase()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中org.osgi.framework.Filter.matchCase()方法的一些代码示例,展示了Filter.matchCase()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Filter.matchCase()方法的具体详情如下:
包路径:org.osgi.framework.Filter
类名称:Filter
方法名:matchCase

Filter.matchCase介绍

[英]Filter using a Dictionary. This Filter is executed using the specified Dictionary's keys and values. The keys are looked up in a normal manner respecting case.
[中]使用字典进行筛选。使用指定字典的键和值执行此筛选器。钥匙是按照正常的方式查找的。

代码示例

代码示例来源:origin: org.osgi/org.osgi.compendium

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new FilterProperties(topic, properties));
}

代码示例来源:origin: org.osgi/org.osgi.compendium

/**
 * Internal implies method. Used by the implies and the permission
 * collection implies methods.
 * 
 * @param requested The requested EndpointPermission which has already be
 *        validated as a proper argument. The requested EndpointPermission
 *        must not have a filter expression.
 * @param effective The effective actions with which to start.
 * @return {@code true} if the specified permission is implied by this
 *         object; {@code false} otherwise.
 */
boolean implies0(EndpointPermission requested, int effective) {
  /* check actions first - much faster */
  effective |= action_mask;
  final int desired = requested.action_mask;
  if ((effective & desired) != desired) {
    return false;
  }
  /* if we have no filter */
  Filter f = filter;
  if (f == null) {
    // it's "*"
    return true;
  }
  return f.matchCase(requested.getProperties());
}

代码示例来源:origin: org.osgi/org.osgi.compendium

/**
 * Tests the properties of this {@code EndpointDescription} against the
 * given filter using a case insensitive match.
 * 
 * @param filter The filter to test.
 * @return {@code true} If the properties of this
 *         {@code EndpointDescription} match the filter, {@code false}
 *         otherwise.
 * @throws IllegalArgumentException If {@code filter} contains an invalid
 *         filter string that cannot be parsed.
 */
public boolean matches(String filter) {
  Filter f;
  try {
    f = FrameworkUtil.createFilter(filter);
  } catch (InvalidSyntaxException e) {
    IllegalArgumentException iae = new IllegalArgumentException(e.getMessage());
    iae.initCause(e);
    throw iae;
  }
  Dictionary<String, Object> d = new UnmodifiableDictionary<String, Object>(properties);
  /*
   * we can use matchCase here since properties already supports case
   * insensitive key lookup.
   */
  return f.matchCase(d);
}

代码示例来源:origin: org.apache.felix/org.osgi.compendium

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new UnmodifiableDictionary(properties));
}

代码示例来源:origin: org.apache.aries.application/org.apache.aries.application.resolver.obr

public boolean matchCase(Dictionary dictionary)
{
 return delgate.matchCase(dictionary);
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-aries-resolver

public boolean matchCase(Dictionary dictionary)
{
 return delgate.matchCase(dictionary);
}

代码示例来源:origin: apache/aries

public boolean matchCase(Dictionary dictionary)
{
 return delgate.matchCase(dictionary);
}

代码示例来源:origin: org.osgi/osgi.cmpn

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new FilterProperties(topic, properties));
}

代码示例来源:origin: org.osgi/org.osgi.enterprise

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new FilterProperties(topic, properties));
}

代码示例来源:origin: org.eclipse.osgi/org.eclipse.osgi.services

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new UnmodifiableDictionary(properties));
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.osgi.services

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new FilterProperties(topic, properties));
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi.services

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new FilterProperties(topic, properties));
}

代码示例来源:origin: org.osgi/osgi.enterprise

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new FilterProperties(topic, properties));
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new FilterProperties(topic, properties));
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new FilterProperties(topic, properties));
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new FilterProperties(topic, properties));
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new FilterProperties(topic, properties));
}

代码示例来源:origin: apache/ace

/**
 * Tests this event's properties against the given filter using a case
 * sensitive match.
 * 
 * @param filter The filter to test.
 * @return true If this event's properties match the filter, false
 *         otherwise.
 */
public final boolean matches(Filter filter) {
  return filter.matchCase(new FilterProperties(topic, properties));
}

代码示例来源:origin: apache/ace

@Override
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<>();
  for (ArtifactObject rp : rps) {
    if (f.matchCase(rp.getDictionary())) {
      res.add(rp);
    }
  }
  return res;
}

代码示例来源:origin: apache/ace

@Descriptor("returns the script definition from the queue matching a given filter, if available")
public Map<String, String>[] get(@Descriptor("Represents an OSGi-filter to match against the script definitions") String filter) throws Exception {
  List<Dictionary<String, String>> copy = new ArrayList<>(m_queue);
  List<Map<String, String>> result = new ArrayList<>();
  Filter f = FrameworkUtil.createFilter(filter);
  for (Dictionary<String, String> entry : copy) {
    if (f.matchCase(entry)) {
      result.add(toMap(entry));
      m_queue.remove(entry);
    }
  }
  return result.toArray(new Map[result.size()]);
}

相关文章

微信公众号

最新文章

更多