| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.devacfr.maven.skins.reflow.model; |
| 17 |
|
|
| 18 |
|
import static java.util.Objects.requireNonNull; |
| 19 |
|
|
| 20 |
|
import com.google.common.base.Strings; |
| 21 |
|
import com.google.common.collect.Lists; |
| 22 |
|
import java.util.List; |
| 23 |
|
import javax.annotation.Nonnull; |
| 24 |
|
import org.apache.maven.doxia.site.SiteModel; |
| 25 |
|
import org.codehaus.plexus.util.xml.Xpp3Dom; |
| 26 |
|
import org.devacfr.maven.skins.reflow.ISkinConfig; |
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
@author |
| 32 |
|
@since |
| 33 |
|
|
| |
|
| 73,5% |
Uncovered Elements: 9 (34) |
Complexity: 8 |
Complexity Density: 0,33 |
|
| 34 |
|
public class Footer extends BsComponent { |
| 35 |
|
|
| 36 |
|
|
| 37 |
|
private static final String COMPONENT = "footer"; |
| 38 |
|
|
| 39 |
|
|
| 40 |
|
private final List<Column> columns = Lists.newArrayList(); |
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
@param |
| 46 |
|
|
| 47 |
|
|
| |
|
| 77,4% |
Uncovered Elements: 7 (31) |
Complexity: 7 |
Complexity Density: 0,3 |
|
| 48 |
30 |
public Footer(@Nonnull final ISkinConfig config) {... |
| 49 |
30 |
super(config, COMPONENT); |
| 50 |
30 |
requireNonNull(config); |
| 51 |
30 |
final SiteModel model = requireNonNull(config.getSiteModel()); |
| 52 |
30 |
this.setTheme(config.getAttributeValue(COMPONENT, "theme", String.class, "light")); |
| 53 |
30 |
this.setBackground(config.getAttributeValue(COMPONENT, "background", String.class, "light")); |
| 54 |
30 |
this.setCssClass(config.getAttributeValue(COMPONENT, "cssClass", String.class, null)); |
| 55 |
|
|
| 56 |
30 |
final Xpp3Dom bottomNav = config.get("bottomNav"); |
| 57 |
|
|
| 58 |
30 |
if (model.getBody() != null && model.getBody().getMenus() != null) { |
| 59 |
11 |
final List<org.apache.maven.doxia.site.Menu> menus = model.getBody().getMenus(); |
| 60 |
11 |
if (bottomNav != null && bottomNav.getChildren().length > 0) { |
| 61 |
|
|
| 62 |
11 |
for (final Xpp3Dom col : bottomNav.getChildren()) { |
| 63 |
33 |
final String regex = col.getValue(); |
| 64 |
33 |
if (Strings.isNullOrEmpty(regex)) { |
| 65 |
0 |
continue; |
| 66 |
|
} |
| 67 |
33 |
final List<Menu> amenus = Lists.newArrayList(); |
| 68 |
33 |
for (final org.apache.maven.doxia.site.Menu menu : menus) { |
| 69 |
|
|
| 70 |
165 |
if (Menu.matches(regex, menu)) { |
| 71 |
55 |
amenus.add(new Menu(config, menu)); |
| 72 |
|
} |
| 73 |
|
} |
| 74 |
33 |
this.columns.add(new Column(config, amenus)); |
| 75 |
|
} |
| 76 |
|
} else { |
| 77 |
0 |
final List<Menu> amenus = Lists.newArrayList(); |
| 78 |
0 |
for (final org.apache.maven.doxia.site.Menu menu : menus) { |
| 79 |
0 |
amenus.add(new Menu(config, menu)); |
| 80 |
|
} |
| 81 |
0 |
this.columns.add(new Column(config, amenus)); |
| 82 |
|
} |
| 83 |
|
} |
| 84 |
|
} |
| 85 |
|
|
| 86 |
|
|
| 87 |
|
@return@link |
| 88 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 89 |
0 |
public List<Column> getColumns() {... |
| 90 |
0 |
return columns; |
| 91 |
|
} |
| 92 |
|
|
| 93 |
|
|
| 94 |
|
@author |
| 95 |
|
@since |
| 96 |
|
|
| |
|
| 66,7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0,5 |
|
| 97 |
|
public static class Column { |
| 98 |
|
|
| 99 |
|
|
| 100 |
|
private final List<Menu> menus; |
| 101 |
|
|
| 102 |
|
|
| 103 |
|
@param |
| 104 |
|
|
| 105 |
|
@param |
| 106 |
|
|
| 107 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
|
| 108 |
33 |
public Column(@Nonnull final ISkinConfig config, @Nonnull final List<Menu> menus) {... |
| 109 |
33 |
requireNonNull(config); |
| 110 |
33 |
requireNonNull(menus); |
| 111 |
33 |
this.menus = menus; |
| 112 |
|
} |
| 113 |
|
|
| 114 |
|
|
| 115 |
|
@return@link |
| 116 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 117 |
0 |
public List<Menu> getMenus() {... |
| 118 |
0 |
return menus; |
| 119 |
|
} |
| 120 |
|
} |
| 121 |
|
} |