View Javadoc
1   /*
2    * #%L
3    * wcm.io
4    * %%
5    * Copyright (C) 2014 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 span element.
26   */
27  @ProviderType
28  @SuppressWarnings("java:S110") // # parent inheritance
29  public final class Span extends AbstractNonSelfClosingHtmlElement {
30  
31    private static final long serialVersionUID = 1L;
32  
33    private static final String ELEMENT_NAME = "span";
34  
35    /**
36     * Initializes html element.
37     */
38    public Span() {
39      super(ELEMENT_NAME);
40    }
41  
42    /**
43     * Initializes html element.
44     * @param text Text
45     */
46    public Span(String text) {
47      super(ELEMENT_NAME);
48      setText(text);
49    }
50  
51    // -- overwrite methods for builder pattern with covariant return types --
52  
53    @Override
54    protected Span setEmptyAttributeValueAsBoolean(String attributeName, boolean value) {
55      return (Span)super.setEmptyAttributeValueAsBoolean(attributeName, value);
56    }
57  
58    @Override
59    public Span setId(String value) {
60      return (Span)super.setId(value);
61    }
62  
63    @Override
64    public Span setCssClass(String value) {
65      return (Span)super.setCssClass(value);
66    }
67  
68    @Override
69    public Span addCssClass(String value) {
70      return (Span)super.addCssClass(value);
71    }
72  
73    @Override
74    public Span setStyleString(String value) {
75      return (Span)super.setStyleString(value);
76    }
77  
78    @Override
79    public Span setStyle(String styleAttribute, String styleValue) {
80      return (Span)super.setStyle(styleAttribute, styleValue);
81    }
82  
83    @Override
84    public Span setTitle(String value) {
85      return (Span)super.setTitle(value);
86    }
87  
88    @Override
89    public Span setData(String attributeName, String value) {
90      return (Span)super.setData(attributeName, value);
91    }
92  
93    @Override
94    public Span setAttributeValueAsLong(String name, long value) {
95      return (Span)super.setAttributeValueAsLong(name, value);
96    }
97  
98    @Override
99    public Span setText(String text) {
100     return (Span)super.setText(text);
101   }
102 
103 }