Examples of PathPattern


Examples of org.glassfish.jersey.uri.PathPattern

            this.names = immutableCopy(names);
            this.path = path;
            this.pathPattern = (path == null || path.isEmpty()) ?
                    PathPattern.OPEN_ROOT_PATH_PATTERN :
                    new PathPattern(path, PathPattern.RightHandPath.capturingZeroOrMoreSegments);
            this.resourceMethods = Resource.immutableCopy(resourceMethods);
            this.locator = locator;
            this.childResources = Collections.unmodifiableList(childResources); // no need to deep-copy the list

            this.handlerClasses = Resource.immutableCopy(handlerClasses);
View Full Code Here

Examples of org.glassfish.jersey.uri.PathPattern


    }

    private void process(String str) {
        PathPattern pattern = new PathPattern(str);

        System.out.println("template: " + pattern.getTemplate().toString());
        System.out.println("pattern: " + pattern.toString());
    }
View Full Code Here

Examples of org.glassfish.jersey.uri.PathPattern

            final Set<Object> handlerInstances) {

        this.names = names;
        this.path = path;
        this.pathPattern = (path == null || path.isEmpty()) ?
                PathPattern.OPEN_ROOT_PATH_PATTERN : new PathPattern(path, PathPattern.RightHandPath.capturingZeroOrMoreSegments);
        this.resourceMethods = resourceMethods;
        this.subResourceLocator = subResourceLocator;
        this.childResources = childResources;

        this.handlerClasses = handlerClasses;
View Full Code Here

Examples of org.glassfish.jersey.uri.PathPattern

    @Inject
    private MatchResultInitializerRouter.Builder initializerFactory;

    @Override
    public RouteToBuilder<PathPattern> route(String pattern) {
        return route(new PathPattern(pattern));
    }
View Full Code Here

Examples of org.glassfish.jersey.uri.PathPattern

    public RouteToBuilder<PathPattern> route(PathPattern pattern) {
        return new AbstractRouteToPathBuilder<PathPattern>(locator, pattern) {

            @Override
            public RouteToBuilder<PathPattern> route(String pattern) {
                return super.route(new PathPattern(pattern));
            }

            @Override
            public Router build() {
                return acceptorFactory.build(acceptedRoutes());
View Full Code Here

Examples of org.glassfish.jersey.uri.PathPattern

            PushMatchedRuntimeResourceRouter resourcePushingRouter = pushedMatchedRuntimeResourceBuilder.build(resource);

            // resource methods
            if (resource.getResourceMethods().size() > 0) {
                final List<MethodAcceptorPair> methodAcceptors = createAcceptors(resource, subResourceMode);
                final PathPattern resourceClosedPattern =
                        (subResourceMode) ? PathPattern.END_OF_PATH_PATTERN : PathPattern.asClosed(resource.getPathPattern());

                lastRoutedBuilder = routeMethodAcceptor(
                        lastRoutedBuilder,
                        resourceClosedPattern,
                        uriPushingRouter,
                        resourcePushingRouter,
                        methodSelectingAcceptorBuilder.build(workers, methodAcceptors), subResourceMode);
            }

            RouteToPathBuilder<PathPattern> srRoutedBuilder = null;
            if (resource.getChildRuntimeResources().size() > 0) {
                for (RuntimeResource child : resource.getChildRuntimeResources()) {
                    final PathPattern childOpenPattern = child.getPathPattern();
                    final PathPattern childClosedPattern = PathPattern.asClosed(childOpenPattern);
                    PushMatchedRuntimeResourceRouter childResourcePushingRouter =
                            pushedMatchedRuntimeResourceBuilder.build(child);

                    // sub resource methods
                    if (child.getResourceMethods().size() > 0) {
                        final List<MethodAcceptorPair> childMethodAcceptors = createAcceptors(child, subResourceMode);

                        srRoutedBuilder = routedBuilder(srRoutedBuilder)
                                .route(childClosedPattern)
                                .to(uriPushingRouter)
                                .to(childResourcePushingRouter)
                                .to(methodSelectingAcceptorBuilder.build(workers, childMethodAcceptors));
                    }

                    // sub resource locator
                    if (child.getResourceLocator() != null) {
                        PushMatchedTemplateRouter locTemplateRouter = getTemplateRouterForChildLocator(subResourceMode, child);

                        srRoutedBuilder = routedBuilder(srRoutedBuilder)
                                .route(childOpenPattern)
                                .to(uriPushingRouter)
                                .to(locTemplateRouter)
                                .to(childResourcePushingRouter)
                                .to(createSingleMethodAcceptor(child.getResourceLocator()));
                    }
                }
            }

            // resource locator with empty path
            if (resource.getResourceLocator() != null) {
                final PushMatchedTemplateRouter resourceTemplateRouter = getTemplateRouter(subResourceMode,
                        getLocatorResource(resource).getPathPattern().getTemplate(),
                        PathPattern.OPEN_ROOT_PATH_PATTERN.getTemplate());

                srRoutedBuilder = routedBuilder(srRoutedBuilder)
                        .route(PathPattern.OPEN_ROOT_PATH_PATTERN)
                        .to(uriPushingRouter)
                        .to(resourceTemplateRouter)
                        .to(createSingleMethodAcceptor(resource.getResourceLocator()));
            }

            if (srRoutedBuilder != null) {
                final PathPattern resourceOpenPattern =
                        (subResourceMode) ? PathPattern.OPEN_ROOT_PATH_PATTERN : resource.getPathPattern();

                lastRoutedBuilder = routeMethodAcceptor(
                        lastRoutedBuilder, resourceOpenPattern, uriPushingRouter, resourcePushingRouter,
                        srRoutedBuilder.build(), subResourceMode);
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.