• 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/sitemesh/compatability/DecoratorMapper2DecoratorSelector.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 * Copyright 2011-2026 Hazendaz
4
 */
5
package com.opensymphony.sitemesh.compatability;
6

7
import com.opensymphony.module.sitemesh.DecoratorMapper;
8
import com.opensymphony.sitemesh.Content;
9
import com.opensymphony.sitemesh.Decorator;
10
import com.opensymphony.sitemesh.DecoratorSelector;
11
import com.opensymphony.sitemesh.SiteMeshContext;
12
import com.opensymphony.sitemesh.webapp.SiteMeshWebAppContext;
13
import com.opensymphony.sitemesh.webapp.decorator.NoDecorator;
14

15
import jakarta.servlet.http.HttpServletRequest;
16

17
/**
18
 * Adapts a SiteMesh 2 {@link DecoratorMapper} to a SiteMesh 2 {@link DecoratorSelector}.
19
 *
20
 * @author Joe Walnes
21
 *
22
 * @since SiteMesh 3
23
 */
24
public class DecoratorMapper2DecoratorSelector implements DecoratorSelector {
25

26
    /** The decorator mapper. */
27
    private final DecoratorMapper decoratorMapper;
28

29
    /**
30
     * Instantiates a new decorator mapper 2 decorator selector.
31
     *
32
     * @param decoratorMapper
33
     *            the decorator mapper
34
     */
35
    public DecoratorMapper2DecoratorSelector(DecoratorMapper decoratorMapper) {
×
36
        this.decoratorMapper = decoratorMapper;
×
37
    }
×
38

39
    @Override
40
    public Decorator selectDecorator(Content content, SiteMeshContext context) {
41
        SiteMeshWebAppContext webAppContext = (SiteMeshWebAppContext) context;
×
42
        HttpServletRequest request = webAppContext.getRequest();
×
43
        com.opensymphony.module.sitemesh.Decorator decorator = decoratorMapper.getDecorator(request,
×
44
                new Content2HTMLPage(content, request));
45
        if (decorator == null || decorator.getPage() == null) {
×
46
            return new NoDecorator();
×
47
        }
48
        return new OldDecorator2NewDecorator(decorator);
×
49
    }
50

51
}
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