Examples of FilterParser


Examples of aQute.bnd.osgi.resource.FilterParser

     * @param req
     *            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

Examples of aQute.bnd.osgi.resource.FilterParser

                    String category = FilterParser.namespaceToCategory(namespace);
                    if (category != null && category.length() > 0)
                        label.append(category + ": ", StyledString.QUALIFIER_STYLER);
                }

                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);
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.mapgen.FilterParser

    try {
      Collection<Filter> includes = new ArrayList<Filter>();
      Collection<Filter> excludes = new ArrayList<Filter>();
      if (cmd.contains(schemasArg)) {
        String spec = withIndirection(cmd.getArg(schemasArg).getValue());
        includes.add(new FilterParser(spec).parseSchemaFilter());
      }
      if (cmd.contains(tablesArg)) {
        String spec = withIndirection(cmd.getArg(tablesArg).getValue());
        includes.add(new FilterParser(spec).parseTableFilter(true));
      }
      if (cmd.contains(columnsArg)) {
        String spec = withIndirection(cmd.getArg(columnsArg).getValue());
        includes.add(new FilterParser(spec).parseColumnFilter(true));
      }
      if (cmd.contains(skipSchemasArg)) {
        String spec = withIndirection(cmd.getArg(skipSchemasArg).getValue());
        excludes.add(new FilterParser(spec).parseSchemaFilter());
      }
      if (cmd.contains(skipTablesArg)) {
        String spec = withIndirection(cmd.getArg(skipTablesArg).getValue());
        excludes.add(new FilterParser(spec).parseTableFilter(false));
      }
      if (cmd.contains(skipColumnsArg)) {
        String spec = withIndirection(cmd.getArg(skipColumnsArg).getValue());
        excludes.add(new FilterParser(spec).parseColumnFilter(false));
      }
      if (!includes.isEmpty() || !excludes.isEmpty()) {
        loader.setFilter(new FilterIncludeExclude(
            includes.isEmpty() ? Filter.ALL : FilterMatchAny.create(includes),
                FilterMatchAny.create(excludes)));
View Full Code Here

Examples of net.asfun.jangod.parse.FilterParser

  public static Object compute(String varString, JangodInterpreter interpreter) throws InterpretException {
    if ( ( varString.startsWith(Constants.STR_SINGLE_QUOTE) &&varString.endsWith(Constants.STR_SINGLE_QUOTE) ) ||
        ( varString.startsWith(Constants.STR_DOUBLE_QUOTE) && varString.endsWith(Constants.STR_DOUBLE_QUOTE) ) ) {
      return varString.substring(1, varString.length()-1);
    }
    FilterParser fp = new FilterParser(varString);
    try {
      fp.parse();
    } catch (ParseException e) {
      throw new InterpretException(e.getMessage());
    }
    Object var = interpreter.retraceVariable(fp.getVariable());
    List<String> filters = fp.getFilters();
    if ( filters.isEmpty() ) {
      return var;
    }
    List<String[]> argss = fp.getArgss();
    String[] args;
    Filter filter;
    for(int i=0; i<filters.size(); i++) {
      filter = FilterLibrary.getFilter(filters.get(i));
      if ( filter == null ) {
View Full Code Here

Examples of org.apache.blur.manager.BlurFilterCache.FilterParser

    final BaseFieldManager fieldManager = getFieldManager(new WhitespaceAnalyzer(LUCENE_VERSION));

    Filter filter = QueryParserUtil.parseFilter(TABLE, TEST_FILTER, false, fieldManager, defaultBlurFilterCache,
        tableContext);
    Filter filterToRun = defaultBlurFilterCache.storePreFilter(TABLE, TEST_FILTER, filter, new FilterParser() {
      @Override
      public Query parse(String query) throws ParseException {
        return new SuperParser(LUCENE_VERSION, fieldManager, false, null, ScoreType.CONSTANT, tableContext
            .getDefaultPrimeDocTerm()).parse(query);
      }
View Full Code Here

Examples of org.apache.directory.shared.ldap.filter.FilterParser

     * @throws DecoderException
     */
    public static Filter convertToSharedLdapFilter( String filter ) throws IOException, ParseException,
        DecoderException
    {
        FilterParser filterParser = new FilterParserImpl();

        ExprNode exprNode = filterParser.parse( filter );

        return convertToSharedLdapFilter( exprNode );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.filter.FilterParser

     * @throws DecoderException
     */
    public static Filter convertToSharedLdapFilter( String filter ) throws IOException, ParseException,
        DecoderException
    {
        FilterParser filterParser = new FilterParserImpl();

        ExprNode exprNode = filterParser.parse( filter );

        return convertToSharedLdapFilter( exprNode );
    }
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.parser.FilterParser

      FilterLexer lexer = new FilterLexer(cs);

      CommonTokenStream tokens = new CommonTokenStream();
      tokens.setTokenSource (lexer);

      FilterParser parser = new FilterParser(tokens);

      try {
        parser.filter();
      } catch(RecognitionException re) {
        throw new MetaException("Error parsing partition filter : " + re);
      }

      String jdoFilter = parser.tree.generateJDOFilter(table, params);
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.parser.FilterParser

    boolean doTrace = LOG.isDebugEnabled();
    boolean doUseDirectSql = canUseDirectSql(allowSql);
    dbName = dbName.toLowerCase();
    tblName = tblName.toLowerCase();
    List<Partition> results = null;
    FilterParser parser = null;
    if (filter != null && filter.length() != 0) {
      LOG.debug("Filter specified is " + filter);
      parser = getFilterParser(filter);
    }
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.parser.FilterParser

    FilterLexer lexer = new FilterLexer(cs);

    CommonTokenStream tokens = new CommonTokenStream();
    tokens.setTokenSource (lexer);

    FilterParser parser = new FilterParser(tokens);

    try {
      parser.filter();
    } catch(RecognitionException re) {
      throw new MetaException("Error parsing partition filter : " + re);
    }

    if (lexer.errorMsg != null) {
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.