Package org.osgi.framework

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


            {
                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

        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

    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

    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

    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

    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

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

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

      FilterImpl child = new FilterImpl();
      parse_filter(child);
View Full Code Here

            return;
          }
      }

      throw new InvalidSyntaxException(NLS.bind(Msg.FILTER_INVALID_OPERATOR, String.valueOf(pos)), filterstring);
    }
View Full Code Here

      }

      int length = end - begin;

      if (length == 0) {
        throw new InvalidSyntaxException(NLS.bind(Msg.FILTER_MISSING_ATTR, String.valueOf(pos)), filterstring);
      }

      return new String(filter, begin, length);
    }
View Full Code Here

TOP

Related Classes of org.osgi.framework.InvalidSyntaxException

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.