Skip to content

Package: VirtualSiteNode

VirtualSiteNode

nameinstructionbranchcomplexitylinemethod
VirtualSiteNode(SiteNode, ResourcePath, ResourceProperties)
M: 0 C: 28
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
as(As.Type)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
as(Class)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
asMany(As.Type)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
asMany(Class)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
findChildren()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getFile()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getLayout()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getProperties()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPropertyGroup(Id)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getRelativeUri()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getSite()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isPlaceHolder()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
maybeAs(As.Type)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
maybeAs(Class)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
toString()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * #%L
3: * *********************************************************************************************************************
4: *
5: * NorthernWind - lightweight CMS
6: * http://northernwind.tidalwave.it - git clone https://bitbucket.org/tidalwave/northernwind-src.git
7: * %%
8: * Copyright (C) 2011 - 2023 Tidalwave s.a.s. (http://tidalwave.it)
9: * %%
10: * *********************************************************************************************************************
11: *
12: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
13: * the License. You may obtain a copy of the License at
14: *
15: * http://www.apache.org/licenses/LICENSE-2.0
16: *
17: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
18: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
19: * specific language governing permissions and limitations under the License.
20: *
21: * *********************************************************************************************************************
22: *
23: *
24: * *********************************************************************************************************************
25: * #L%
26: */
27: package it.tidalwave.northernwind.frontend.ui.spi;
28:
29: import javax.annotation.Nonnull;
30: import it.tidalwave.util.As;
31: import it.tidalwave.util.Finder;
32: import it.tidalwave.util.Id;
33: import it.tidalwave.northernwind.core.model.ResourceFile;
34: import it.tidalwave.northernwind.core.model.ResourcePath;
35: import it.tidalwave.northernwind.core.model.ResourceProperties;
36: import it.tidalwave.northernwind.core.model.Site;
37: import it.tidalwave.northernwind.core.model.SiteNode;
38: import it.tidalwave.northernwind.frontend.ui.Layout;
39: import it.tidalwave.northernwind.frontend.ui.ViewController;
40: import lombok.Getter;
41: import lombok.RequiredArgsConstructor;
42: import lombok.experimental.Delegate;
43:
44: /***********************************************************************************************************************
45: *
46: * A convenient implementation of {@link SiteNode} for {@link ViewController#findVirtualSiteNodes()}.
47: *
48: * @see ViewController#findVirtualSiteNodes()
49: *
50: * @author Fabrizio Giudici
51: *
52: **********************************************************************************************************************/
53: @RequiredArgsConstructor
54: public class VirtualSiteNode implements SiteNode
55: {
56: @Nonnull
57: private final SiteNode parentSiteNode;
58:
59: @Getter @Nonnull
60: private final ResourcePath relativeUri;
61:
62: @Getter @Nonnull
63: private final ResourceProperties properties;
64:
65: @Delegate
66: private final As asSupport = As.forObject(this);
67:
68: @Override @Nonnull
69: public Site getSite()
70: {
71: return parentSiteNode.getSite();
72: }
73:
74: // TODO: perhaps the methods below could be implemented by delegating to the first real SiteNode up in the
75: // hierarchy.
76: @Nonnull
77: @Override
78: public Layout getLayout()
79: {
80: throw new UnsupportedOperationException("Not supported.");
81: }
82:
83: @Nonnull
84: @Override
85: public ResourceFile getFile()
86: {
87: throw new UnsupportedOperationException("Not supported.");
88: }
89:
90: @Nonnull
91: @Override
92: public ResourceProperties getPropertyGroup (@Nonnull final Id id)
93: {
94: throw new UnsupportedOperationException("Not supported.");
95: }
96:
97: @Override
98: public boolean isPlaceHolder()
99: {
100: throw new UnsupportedOperationException("Not supported.");
101: }
102:
103: @Override @Nonnull
104: public Finder<SiteNode> findChildren()
105: {
106: throw new UnsupportedOperationException("Not supported.");
107: }
108:
109: @Override @Nonnull
110: public String toString()
111: {
112: return "VirtualSiteNode(" + relativeUri + ')';
113: }
114: }