Package org.osgi.framework

Examples of org.osgi.framework.InvalidSyntaxException


        {
            return new Lesser(attribute, (String) value);
        }
        else
        {
            throw new InvalidSyntaxException("Did not expect substr value", state.getExpression());
        }
    }
View Full Code Here


            while (Character.isWhitespace(expression.charAt(pointer))) pointer++;
        }

        public void eat(String pattern) throws InvalidSyntaxException
        {
            if (!expression.startsWith(pattern, pointer)) throw new InvalidSyntaxException("Expected '" + pattern + "'", expression);
            pointer += pattern.length();
        }
View Full Code Here

        {
            int start = pointer;

            while (isValidAttributeChar(expression.charAt(pointer))) pointer++;

            if (start == pointer) throw new InvalidSyntaxException("Invalid attribute name", expression);

            return expression.substring(start, pointer);
        }
View Full Code Here

                    }
                }
            }
            catch (StringIndexOutOfBoundsException e)
            {
                throw new InvalidSyntaxException("Invalid escaping of value", expression);
            }

            values.add(builder.toString());

            if (values.size() == 1)
View Full Code Here

    String filterString = content.getAttribute(FILTER);
    if (filterString != null) {
      try {
        this.filter = FrameworkUtil.createFilter(filterString);
      } catch (InvalidSyntaxException ise) {       
        throw new InvalidSyntaxException("Failed to create filter for " + service, ise.getFilter(), ise.getCause());
      }
    }
  }
View Full Code Here

    when( mockContext.getServiceReferences( String.class, null ) ).thenReturn( Collections.singletonList( ref ) );
    when( mockContext.getService( ref ) ).thenReturn( "SomeString" );

    when( mockContext.getServiceReferences( java.lang.Integer.class, null ) )
      .thenThrow( new InvalidSyntaxException( "bad", "call" ) );

    OSGIObjectFactory factory = new OSGIObjectFactory( mockContext );
    String actual = factory.get( String.class, session );
    Integer missing = factory.get( Integer.class, session );
View Full Code Here

    ServiceReference<String> ref = Mockito.mock( ServiceReference.class );
    ServiceReference<String> ref2 = Mockito.mock( ServiceReference.class );

    when( mockContext.getServiceReferences( String.class, null ) ).thenReturn( Arrays.asList( ref, ref2 ) );
    when( mockContext.getServiceReferences( Integer.class, null ) )
      .thenThrow( new InvalidSyntaxException( "bad", "call" ) );
    when( mockContext.getService( ref ) ).thenReturn( "SomeString" );
    when( mockContext.getService( ref2 ) ).thenReturn( "SomeString2" );

    OSGIObjectFactory factory = new OSGIObjectFactory( mockContext );
    List<String> actual = factory.getAll( String.class, session );
View Full Code Here

    BundleContext mockContext = Mockito.mock( BundleContext.class );
    ServiceReference<String> ref = Mockito.mock( ServiceReference.class );

    when( mockContext.getServiceReferences( String.class, null ) ).thenReturn( Collections.singletonList( ref ) );
    when( mockContext.getServiceReferences( Integer.class, null ) )
      .thenThrow( new InvalidSyntaxException( "bad", "call" ) );

    when( mockContext.getService( ref ) ).thenReturn( "SomeString" );

    // props
    when( ref.getPropertyKeys() ).thenReturn( new String[] { "prop1", "prop2" } );
View Full Code Here

    ServiceReference<String> ref = (ServiceReference<String>) Mockito.mock( ServiceReference.class );
    ServiceReference<String> ref2 = Mockito.mock( ServiceReference.class );

    when( mockContext.getServiceReferences( String.class, "(&(name=foo))" ) ).thenReturn( Arrays.asList( ref, ref2 ) );
    when( mockContext.getServiceReferences( Integer.class, null ) )
      .thenThrow( new InvalidSyntaxException( "bad", "call" ) );

    when( mockContext.getService( ref ) ).thenReturn( "SomeString" );
    when( mockContext.getService( ref2 ) ).thenReturn( "SomeString2" );

    // props
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

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.