View Javadoc
1   /*
2    * #%L
3    * wcm.io
4    * %%
5    * Copyright (C) 2019 wcm.io
6    * %%
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * #L%
19   */
20  package io.wcm.handler.commons.dom;
21  
22  import org.osgi.annotation.versioning.ProviderType;
23  
24  /**
25   * Html map element.
26   */
27  @ProviderType
28  @SuppressWarnings("java:S110") // # parent inheritance
29  public final class Map extends AbstractNonSelfClosingHtmlElement {
30  
31    private static final long serialVersionUID = 1L;
32  
33    private static final String ELEMENT_NAME = "map";
34    private static final String ATTRIBUTE_NAME = "name";
35  
36    /**
37     * Initializes html element.
38     */
39    public Map() {
40      super(ELEMENT_NAME);
41    }
42  
43    /**
44     * Html "name" attribute.
45     * @return Value of attribute
46     */
47    public String getMapName() {
48      return getAttributeValue(ATTRIBUTE_NAME);
49    }
50  
51    /**
52     * Html "name" attribute.
53     * @param value Value of attribute
54     * @return Self reference
55     */
56    public Map setMapName(String value) {
57      setAttribute(ATTRIBUTE_NAME, value);
58      return this;
59    }
60  
61    // -- overwrite methods for builder pattern with covariant return types --
62  
63    @Override
64    protected Map setEmptyAttributeValueAsBoolean(String attributeName, boolean value) {
65      return (Map)super.setEmptyAttributeValueAsBoolean(attributeName, value);
66    }
67  
68    @Override
69    public Map setId(String value) {
70      return (Map)super.setId(value);
71    }
72  
73    @Override
74    public Map setCssClass(String value) {
75      return (Map)super.setCssClass(value);
76    }
77  
78    @Override
79    public Map addCssClass(String value) {
80      return (Map)super.addCssClass(value);
81    }
82  
83    @Override
84    public Map setStyleString(String value) {
85      return (Map)super.setStyleString(value);
86    }
87  
88    @Override
89    public Map setStyle(String styleAttribute, String styleValue) {
90      return (Map)super.setStyle(styleAttribute, styleValue);
91    }
92  
93    @Override
94    public Map setTitle(String value) {
95      return (Map)super.setTitle(value);
96    }
97  
98    @Override
99    public Map setData(String attributeName, String value) {
100     return (Map)super.setData(attributeName, value);
101   }
102 
103   @Override
104   public Map setAttributeValueAsLong(String name, long value) {
105     return (Map)super.setAttributeValueAsLong(name, value);
106   }
107 
108   @Override
109   public Map setText(String text) {
110     return (Map)super.setText(text);
111   }
112 
113 }