EMMA Coverage Report (generated Fri Sep 15 10:32:43 EDT 2006)
[all classes][org.apache.pluto.driver.url]

COVERAGE SUMMARY FOR SOURCE FILE [PortalURLFactory.java]

nameclass, %method, %block, %line, %
PortalURLFactory.java0%   (0/1)0%   (0/4)0%   (0/32)0%   (0/10)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PortalURLFactory0%   (0/1)0%   (0/4)0%   (0/32)0%   (0/10)
<static initializer> 0%   (0/1)0%   (0/8)0%   (0/2)
PortalURLFactory (): void 0%   (0/1)0%   (0/3)0%   (0/2)
createPortalURL (HttpServletRequest): PortalURL 0%   (0/1)0%   (0/19)0%   (0/5)
getFactory (): PortalURLFactory 0%   (0/1)0%   (0/2)0%   (0/1)

1/*
2 * Copyright 2003,2004 The Apache Software Foundation.
3 * 
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 * 
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 * 
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.apache.pluto.driver.url;
17 
18import javax.servlet.http.HttpServletRequest;
19 
20/**
21 * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
22 * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>
23 */
24public class PortalURLFactory {
25 
26    private static final String KEY = PortalURL.class.getName();
27    
28    /** The singleton factory instance. */
29    private static final PortalURLFactory FACTORY = new PortalURLFactory();
30    
31    
32    // Constructor -------------------------------------------------------------
33    
34    /**
35     * Private constructor that prevents external instantiation.
36     */
37    private PortalURLFactory() {
38            // Do nothing.
39    }
40    
41    /**
42     * Returns the singleton factory instance.
43     * @return the singleton factory instance.
44     */
45    public static PortalURLFactory getFactory() {
46        return FACTORY;
47    }
48    
49    
50    // Public Methods ----------------------------------------------------------
51    
52    /**
53     * Creates a portal URL from the servlet request. If the servlet request
54     * does not contain a portal URL (in request scope), the method creates a
55     * portal URL and saves it into the request scope.
56     * @param request  the servlet request.
57     * @return a portal URL created from the servlet request.
58     */
59    public PortalURL createPortalURL(HttpServletRequest request) {
60            PortalURL portalURL = (PortalURL) request.getAttribute(KEY);
61        if (portalURL == null) {
62            portalURL = PortalURLParser.getParser().parse(request);
63            request.setAttribute(KEY, portalURL);
64        }
65        return (PortalURL) portalURL.clone();
66    }
67 
68}

[all classes][org.apache.pluto.driver.url]
EMMA 2.0.5312 (C) Vladimir Roubtsov