Android UriPatternMatcher - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android UriPatternMatcher class.

This code example shows how to use the following methods:
 
    @Test 
    public void testRegisterUnregister() throws Exception { 
        final HttpAsyncRequestHandler<?> h = Mockito.mock(HttpAsyncRequestHandler.class);
 
        final UriPatternMatcher<HttpAsyncRequestHandler<?>> matcher = Mockito.spy(
                new UriPatternMatcher<HttpAsyncRequestHandler<?>>());
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper(matcher);
 
        registry.register("/h1", h);
        registry.unregister("/h1");
 
        Mockito.verify(matcher).register("/h1", h);
        Mockito.verify(matcher).unregister("/h1"); 
    } 
 
    @Test 
    public void testLookup() throws Exception { 
        final UriPatternMatcher<HttpAsyncRequestHandler<?>> matcher = Mockito.spy(
                new UriPatternMatcher<HttpAsyncRequestHandler<?>>());
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
 
    @Test 
    public void testRegisterUnregister() throws Exception { 
        final HttpAsyncRequestHandler<?> h = Mockito.mock(HttpAsyncRequestHandler.class);
 
        final UriPatternMatcher<HttpAsyncRequestHandler<?>> matcher = Mockito.spy(
                new UriPatternMatcher<HttpAsyncRequestHandler<?>>());
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper(matcher);
 
        registry.register("/h1", h);
        registry.unregister("/h1");
 
        Mockito.verify(matcher).register("/h1", h);
        Mockito.verify(matcher).unregister("/h1"); 
    } 
 
    @Test 
    public void testLookup() throws Exception { 
        final UriPatternMatcher<HttpAsyncRequestHandler<?>> matcher = Mockito.spy(
                new UriPatternMatcher<HttpAsyncRequestHandler<?>>());
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
        super(); 
        this.matcher = Args.notNull(matcher, "Pattern matcher");
    } 
 
    public UriHttpAsyncRequestHandlerMapper() { 
        this(new UriPatternMatcher<HttpAsyncRequestHandler<?>>());
    } 
 
    /** 
     * Registers the given {@link HttpAsyncRequestHandler} as a handler for URIs 
     * matching the given pattern. 
     * 
     * @param pattern the pattern to register the handler for. 
     * @param handler the handler. 
     */ 
    public void register(final String pattern, final HttpAsyncRequestHandler<?> handler) {
        matcher.register(pattern, handler);
    } 
 
    /** 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
    private final UriPatternMatcher protectedURIs;
     
    @Inject 
    public AuthenticationInterceptorImpl(Authenticator authenticator) {
        this.authenticator = authenticator;
        protectedURIs = new UriPatternMatcher();
    } 
 
    public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
        if (request == null) {
            throw new IllegalArgumentException("HTTP request may not be null");
        } 
        if (context == null) {
            throw new IllegalArgumentException("HTTP context may not be null");
        } 
         
        ServerAuthState authState = new ServerAuthState();
        ServerAuthScheme authScheme = new BasicServerAuthScheme(authenticator);
        authState.setScheme(authScheme);  // TODO other schemes, scheme registry, etc
        context.setAttribute(ServerAuthState.AUTH_STATE, authState);
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
        super(); 
        this.matcher = Args.notNull(matcher, "Pattern matcher");
    } 
 
    public UriHttpAsyncRequestHandlerMapper() { 
        this(new UriPatternMatcher<HttpAsyncRequestHandler<?>>());
    } 
 
    /** 
     * Registers the given {@link HttpAsyncRequestHandler} as a handler for URIs 
     * matching the given pattern. 
     * 
     * @param pattern the pattern to register the handler for. 
     * @param handler the handler. 
     */ 
    public void register(final String pattern, final HttpAsyncRequestHandler<?> handler) {
        matcher.register(pattern, handler);
    } 
 
    /** 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Android UriPatternMatcher Methods: