Examples of InvalidSyntaxException


Examples of org.osgi.framework.InvalidSyntaxException

        case ')': {
          break parseloop;
        }

        case '(': {
          throw new InvalidSyntaxException("Invalid value: " + filterstring.substring(pos), filterstring);
        }

        case '\\': {
          pos++;
          c = filterChars[pos];
          /* fall through into default */
        }

        default: {
          sb.append(c);
          pos++;
          break;
        }
        }
      }

      if (sb.length() == 0) {
        throw new InvalidSyntaxException("Missing value: " + filterstring.substring(pos), filterstring);
      }

      // TODO Substitute filter
      String ret = Util.toStringAttrValue(Substitute.substitute(null, sb.toString(), component));
      if (ret == null) {
        throw new InvalidSyntaxException("Substitution failed. Missing value: " + filterstring.substring(pos), filterstring);
      }
      return ret;

    }
View Full Code Here

Examples of org.osgi.framework.InvalidSyntaxException

            {
                filter = SimpleFilter.parse(expr);
            }
            catch (Exception ex)
            {
                throw new InvalidSyntaxException(ex.getMessage(), expr);
            }
        }

        // Ask the service registry for all matching service references.
        final List refList = m_registry.getServiceReferences(className, filter);
View Full Code Here

Examples of org.osgi.framework.InvalidSyntaxException

        {
            m_filter = SimpleFilter.parse(filterStr);
        }
        catch (Throwable th)
        {
            throw new InvalidSyntaxException(th.getMessage(), filterStr);
        }
    }
View Full Code Here

Examples of org.osgi.framework.InvalidSyntaxException

            {
                simple = SimpleFilter.parse(filter);
            }
            catch (Exception ex)
            {
                throw new InvalidSyntaxException(ex.getMessage(), filter);
            }
        }
        List<ServiceReference> result = m_reg.getServiceReferences(clazz,
                simple);
        return result.isEmpty() ? null : result
View Full Code Here

Examples of org.osgi.framework.InvalidSyntaxException

            {
                filter = SimpleFilter.parse(expr);
            }
            catch (Exception ex)
            {
                throw new InvalidSyntaxException(ex.getMessage(), expr);
            }
        }

        // Ask the service registry for all matching service references.
        final List refList = m_registry.getServiceReferences(className, filter);
View Full Code Here

Examples of org.osgi.framework.InvalidSyntaxException

        int start = filter.indexOf(VARIABLE_START);
        int end = filter.indexOf(VARIABLE_END, start);
        while (start != -1) {
            // Unfinished variable
            if (end == -1) {
                throw new InvalidSyntaxException("The filter contains an unfinished variable", filter);
            }

            String key = filter.substring(start + VARIABLE_START.length(), end);

            // Error detection :
            // Empty variable.
            if (key.length() == 0) {
                throw new InvalidSyntaxException("The filter variable '${}' is not a valid " +
                        "variable", filter);
            }
            // Variable with spaces.
            Character forbidden = containsForbiddenCharacter(key);
            if (forbidden != null) {
                throw new InvalidSyntaxException("The filter variable '${" + key + "}' contains a forbidden " +
                        "character : '" + forbidden + "'", filter);
            }


            variables.add(key);
View Full Code Here

Examples of org.osgi.framework.InvalidSyntaxException

    protected void parse(FilterImpl parent) throws InvalidSyntaxException {
      try {
        parse_filter(parent);
      } catch (ArrayIndexOutOfBoundsException e) {
        throw new InvalidSyntaxException(Msg.FILTER_TERMINATED_ABRUBTLY, filterstring);
      }

      if (pos != filter.length) {
        throw new InvalidSyntaxException(NLS.bind(Msg.FILTER_TRAILING_CHARACTERS, String.valueOf(pos)), filterstring);
      }
    }
View Full Code Here

Examples of org.osgi.framework.InvalidSyntaxException

    protected void parse_filter(FilterImpl parent) throws InvalidSyntaxException {
      skipWhiteSpace();

      if (filter[pos] != '(') {
        throw new InvalidSyntaxException(NLS.bind(Msg.FILTER_MISSING_LEFTPAREN, String.valueOf(pos)), filterstring);
      }

      pos++;

      parse_filtercomp(parent);

      skipWhiteSpace();

      if (filter[pos] != ')') {
        throw new InvalidSyntaxException(NLS.bind(Msg.FILTER_MISSING_RIGHTPAREN, String.valueOf(pos)), filterstring);
      }

      pos++;

      skipWhiteSpace();
View Full Code Here

Examples of org.osgi.framework.InvalidSyntaxException

    protected void parse_and(FilterImpl parent) throws InvalidSyntaxException {
      skipWhiteSpace();

      if (filter[pos] != '(') {
        throw new InvalidSyntaxException(NLS.bind(Msg.FILTER_MISSING_LEFTPAREN, String.valueOf(pos)), filterstring);
      }

      ArrayList operands = new ArrayList(10);

      while (filter[pos] == '(') {
View Full Code Here

Examples of org.osgi.framework.InvalidSyntaxException

    protected void parse_or(FilterImpl parent) throws InvalidSyntaxException {
      skipWhiteSpace();

      if (filter[pos] != '(') {
        throw new InvalidSyntaxException(NLS.bind(Msg.FILTER_MISSING_LEFTPAREN, String.valueOf(pos)), filterstring);
      }

      ArrayList operands = new ArrayList(10);

      while (filter[pos] == '(') {
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.