Span.java

  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. import org.osgi.annotation.versioning.ProviderType;

  22. /**
  23.  * Html span element.
  24.  */
  25. @ProviderType
  26. @SuppressWarnings("java:S110") // # parent inheritance
  27. public final class Span extends AbstractNonSelfClosingHtmlElement {
  28.   private static final long serialVersionUID = 1L;

  29.   private static final String ELEMENT_NAME = "span";

  30.   /**
  31.    * Initializes html element.
  32.    */
  33.   public Span() {
  34.     super(ELEMENT_NAME);
  35.   }

  36.   /**
  37.    * Initializes html element.
  38.    * @param text Text
  39.    */
  40.   public Span(String text) {
  41.     super(ELEMENT_NAME);
  42.     setText(text);
  43.   }

  44.   // -- overwrite methods for builder pattern with covariant return types --

  45.   @Override
  46.   protected Span setEmptyAttributeValueAsBoolean(String attributeName, boolean value) {
  47.     return (Span)super.setEmptyAttributeValueAsBoolean(attributeName, value);
  48.   }

  49.   @Override
  50.   public Span setId(String value) {
  51.     return (Span)super.setId(value);
  52.   }

  53.   @Override
  54.   public Span setCssClass(String value) {
  55.     return (Span)super.setCssClass(value);
  56.   }

  57.   @Override
  58.   public Span addCssClass(String value) {
  59.     return (Span)super.addCssClass(value);
  60.   }

  61.   @Override
  62.   public Span setStyleString(String value) {
  63.     return (Span)super.setStyleString(value);
  64.   }

  65.   @Override
  66.   public Span setStyle(String styleAttribute, String styleValue) {
  67.     return (Span)super.setStyle(styleAttribute, styleValue);
  68.   }

  69.   @Override
  70.   public Span setTitle(String value) {
  71.     return (Span)super.setTitle(value);
  72.   }

  73.   @Override
  74.   public Span setData(String attributeName, String value) {
  75.     return (Span)super.setData(attributeName, value);
  76.   }

  77.   @Override
  78.   public Span setAttributeValueAsLong(String name, long value) {
  79.     return (Span)super.setAttributeValueAsLong(name, value);
  80.   }

  81.   @Override
  82.   public Span setText(String text) {
  83.     return (Span)super.setText(text);
  84.   }

  85. }