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<?>>());
5
CodeRank
Experience pair programming with AI  Get Codota for Java
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<?>>());
4
CodeRank
Experience pair programming with AI  Get Codota for Java
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);
    } 
 
    /** 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
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);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
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);
    } 
 
    /** 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	public static class MHttpRequestHandlerRegistry extends HttpRequestHandlerRegistry {
 
		private final UriPatternMatcher matcher;
 
		public MHttpRequestHandlerRegistry() { 
			matcher = new UriPatternMatcher();
		} 
 
		public synchronized void register(final String pattern, final HttpRequestHandler handler) {
			matcher.register(pattern, handler);
		} 
 
		public synchronized void unregister(final String pattern) {
			matcher.unregister(pattern);
		} 
 
		public synchronized void setHandlers(@SuppressWarnings("rawtypes") final Map map) {
			matcher.setHandlers(map);
		} 
 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Android UriPatternMatcher Methods: