Package aQute.bnd.osgi.resource.FilterParser

Examples of aQute.bnd.osgi.resource.FilterParser.Expression


     *            The requirement searched
     * @return a query string where p: is for package and bsn: is for bundle symbolic name.
     */
    public static String requirementToUrl(Requirement req) throws IOException {
        FilterParser fp = new FilterParser();
        Expression expression = fp.parse(req);

        String s = expression.query();

        return "http://jpm4j.org/#!/search?q=" + URLEncoder.encode(s, "UTF-8");
    }
View Full Code Here


                FilterParser fp = new FilterParser();
                String filterStr = requirement.getDirectives().get("filter");
                if (filterStr == null) {
                    label.append("<no filter>", UIConstants.ERROR_STYLER);
                } else {
                    Expression exp = fp.parse(filter);
                    if (exp instanceof WithRangeExpression) {
                        label.append(((WithRangeExpression) exp).printExcludingRange(), UIConstants.BOLD_STYLER);
                        RangeExpression range = ((WithRangeExpression) exp).getRangeExpression();
                        if (range != null)
                            label.append(" ").append(formatRangeString(range), StyledString.COUNTER_STYLER);
                    } else {
                        label.append(exp.toString());
                    }
                }
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
View Full Code Here

        .parse("(&(osgi.wiring.package=package)(|(|(c=4)))(!(version>=2.0.0))(!(a=3))(version>=1.0.0))");
    System.out.println(exp);
  }

  public void testReduce() throws IOException {
    Expression exp = fp.parse("(&(osgi.wiring.package=package)(!(version>=2.0.0))(version>=1.0.0))");
    System.out.println(exp);
  }
View Full Code Here

    Expression exp = fp.parse("(&(osgi.wiring.package=package)(!(version>=2.0.0))(version>=1.0.0))");
    System.out.println(exp);
  }

  public void testVoidRange() throws IOException {
    Expression exp = fp.parse("(&(osgi.wiring.package=package)(version>=0.0.0))");
    System.out.println(exp);
  }
View Full Code Here

    Expression exp = fp.parse("(&(osgi.wiring.package=package)(version>=0.0.0))");
    System.out.println(exp);
  }

  public void testIdentity() throws IOException {
    Expression exp = fp.parse("(&(osgi.identity=identity)(version>=0.0.0))");
    System.out.println(exp);
    exp = fp.parse("(&(osgi.identity=identity)(!(version>=2.0.0))(version>=1.0.0))");
    System.out.println(exp);
  }
View Full Code Here

   * this works.
   *
   * @throws IOException
   */
  public void testCache() throws IOException {
    Expression exp = fp.parse("(&(osgi.wiring.package=a)(version>=1)(!(version>=2.0.0)))");
    Expression exp2 = fp.parse("(&(osgi.wiring.package=b)(version>=1.1)(!(version>=2.0.0)))");
    assertNotNull(exp2);
    assertNotNull(exp);
  }
View Full Code Here

TOP

Related Classes of aQute.bnd.osgi.resource.FilterParser.Expression

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.