Package com.sun.jersey.spi.template

Examples of com.sun.jersey.spi.template.ResolvedViewable


    public void writeTo(Viewable v,
            Class<?> type, Type genericType, Annotation[] annotations,
            MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
            OutputStream entityStream) throws IOException {
        final ResolvedViewable rv = resolve(v);
        if (rv == null)
            throw new IOException("The template name, " +
                    v.getTemplateName() +
                    ", could not be resolved to a fully qualified template name");

        rv.writeTo(entityStream);
    }
View Full Code Here


                context.getMatchResult().group(1) :
                "";

            // Resolve the viewable
            Viewable v = new Viewable(templatePath, resource);
            ResolvedViewable rv = tc.resolveViewable(v);
            if (rv == null) {
                return false;
            }

            // If an internal match resource request then always return true
            if (request.getMethod().equals(WebApplicationContext.HTTP_METHOD_MATCH_RESOURCE)) {
                return true;
            }

            if (context.isTracingEnabled()) {
                context.trace(String.format("accept implicit view: \"%s\" -> %s, %s",
                        templatePath,
                        ReflectionHelper.objectToString(resource),
                        rv.getTemplateName()));
            }

            // Push the response filters
            context.pushContainerResponseFilters(responseFilters);
View Full Code Here

   
    private ResolvedViewable resolveAbsoluteViewable(Viewable v) {
        for (ViewProcessor vp : getViewProcessors()) {
            Object resolvedTemplateObject = vp.resolve(v.getTemplateName());
            if (resolvedTemplateObject != null) {
                return new ResolvedViewable(vp, resolvedTemplateObject, v);
            }
        }

        return null;
    }
View Full Code Here

            String absolutePath = getAbsolutePath(c, path, '/');

            for (ViewProcessor vp : getViewProcessors()) {
                Object resolvedTemplateObject = vp.resolve(absolutePath);
                if (resolvedTemplateObject != null) {
                    return new ResolvedViewable(vp, resolvedTemplateObject, v, c);
                }
            }
        }

        // Find in flat files
        for (Class c = resolvingClass; c != Object.class; c = c.getSuperclass()) {
            String absolutePath = getAbsolutePath(c, path, '.');

            for (ViewProcessor vp : getViewProcessors()) {
                Object resolvedTemplateObject = vp.resolve(absolutePath);
                if (resolvedTemplateObject != null) {
                    return new ResolvedViewable(vp, resolvedTemplateObject, v, c);
                }
            }
        }

        return null;
View Full Code Here

    public void writeTo(Viewable v,
            Class<?> type, Type genericType, Annotation[] annotations,
            MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
            OutputStream entityStream) throws IOException {
        final ResolvedViewable rv = resolve(v);
        if (rv == null)
            throw new IOException("The template name, " +
                    v.getTemplateName() +
                    ", could not be resolved to a fully qualified template name");

        rv.writeTo(entityStream);
    }
View Full Code Here

                context.getMatchResult().group(1) :
                "";

            // Resolve the viewable
            Viewable v = new Viewable(templatePath, resource);
            ResolvedViewable rv = tc.resolveViewable(v);
            if (rv == null) {
                return false;
            }

            // If an internal match resource request then always return true
            if (request.getMethod().equals(WebApplicationContext.HTTP_METHOD_MATCH_RESOURCE)) {
                return true;
            }

            if (context.isTracingEnabled()) {
                context.trace(String.format("accept implicit view: \"%s\" -> %s, %s",
                        templatePath,
                        ReflectionHelper.objectToString(resource),
                        rv.getTemplateName()));
            }

            // Push the response filters
            context.pushContainerResponseFilters(responseFilters);
View Full Code Here

   
    private ResolvedViewable resolveAbsoluteViewable(Viewable v) {
        for (ViewProcessor vp : getViewProcessors()) {
            Object resolvedTemplateObject = vp.resolve(v.getTemplateName());
            if (resolvedTemplateObject != null) {
                return new ResolvedViewable(vp, resolvedTemplateObject, v);
            }
        }

        return null;
    }
View Full Code Here

            String absolutePath = getAbsolutePath(c, path, '/');

            for (ViewProcessor vp : getViewProcessors()) {
                Object resolvedTemplateObject = vp.resolve(absolutePath);
                if (resolvedTemplateObject != null) {
                    return new ResolvedViewable(vp, resolvedTemplateObject, v, c);
                }
            }
        }

        // Find in flat files
        for (Class c = resolvingClass; c != Object.class; c = c.getSuperclass()) {
            String absolutePath = getAbsolutePath(c, path, '.');

            for (ViewProcessor vp : getViewProcessors()) {
                Object resolvedTemplateObject = vp.resolve(absolutePath);
                if (resolvedTemplateObject != null) {
                    return new ResolvedViewable(vp, resolvedTemplateObject, v, c);
                }
            }
        }

        return null;
View Full Code Here

TOP

Related Classes of com.sun.jersey.spi.template.ResolvedViewable

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.