• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / sitemesh2 / 59

22 Mar 2026 02:30AM UTC coverage: 40.347%. Remained the same
59

push

github

hazendaz
[mvn] Update maven wrapper

698 of 1891 branches covered (36.91%)

Branch coverage included in aggregate %.

1555 of 3693 relevant lines covered (42.11%)

0.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/opensymphony/module/sitemesh/mapper/InlineDecoratorMapper.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 * Copyright 2011-2026 Hazendaz
4
 */
5
/*
6
 * Title:        InlineDecoratorMapper
7
 * Description:
8
 *
9
 * This software is published under the terms of the OpenSymphony Software
10
 * License version 1.1, of which a copy has been included with this
11
 * distribution in the LICENSE.txt file.
12
 */
13

14
package com.opensymphony.module.sitemesh.mapper;
15

16
import com.opensymphony.module.sitemesh.Decorator;
17
import com.opensymphony.module.sitemesh.Page;
18
import com.opensymphony.module.sitemesh.RequestConstants;
19
import com.opensymphony.module.sitemesh.factory.FactoryException;
20

21
import jakarta.servlet.http.HttpServletRequest;
22

23
/**
24
 * The InlineDecoratorMapper is used to determine the correct Decorator when using inline decorators.
25
 * <p>
26
 * It will check the request attribute value defined by the key
27
 * {@link com.opensymphony.module.sitemesh.RequestConstants#DECORATOR} and use the appropriate named Decorator. This is
28
 * passed across from the page:applyDecorator tag.
29
 *
30
 * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
31
 *
32
 * @see com.opensymphony.module.sitemesh.DecoratorMapper
33
 */
34
public class InlineDecoratorMapper extends AbstractDecoratorMapper implements RequestConstants {
×
35
    @Override
36
    public Decorator getDecorator(HttpServletRequest request, Page page) {
37
        Decorator result = null;
×
38
        if (request.getAttribute(DECORATOR) != null) {
×
39
            // Retrieve name of decorator to use from request
40
            String decoratorName = (String) request.getAttribute(DECORATOR);
×
41
            result = getNamedDecorator(request, decoratorName);
×
42
            if (result == null) {
×
43
                throw new FactoryException("Cannot locate inline Decorator: " + decoratorName);
×
44
            }
45
        }
46
        return result == null ? super.getDecorator(request, page) : result;
×
47
    }
48
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc