Map.java

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

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

  29.   private static final String ELEMENT_NAME = "map";
  30.   private static final String ATTRIBUTE_NAME = "name";

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

  37.   /**
  38.    * Html "name" attribute.
  39.    * @return Value of attribute
  40.    */
  41.   public String getMapName() {
  42.     return getAttributeValue(ATTRIBUTE_NAME);
  43.   }

  44.   /**
  45.    * Html "name" attribute.
  46.    * @param value Value of attribute
  47.    * @return Self reference
  48.    */
  49.   public Map setMapName(String value) {
  50.     setAttribute(ATTRIBUTE_NAME, value);
  51.     return this;
  52.   }

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

  54.   @Override
  55.   protected Map setEmptyAttributeValueAsBoolean(String attributeName, boolean value) {
  56.     return (Map)super.setEmptyAttributeValueAsBoolean(attributeName, value);
  57.   }

  58.   @Override
  59.   public Map setId(String value) {
  60.     return (Map)super.setId(value);
  61.   }

  62.   @Override
  63.   public Map setCssClass(String value) {
  64.     return (Map)super.setCssClass(value);
  65.   }

  66.   @Override
  67.   public Map addCssClass(String value) {
  68.     return (Map)super.addCssClass(value);
  69.   }

  70.   @Override
  71.   public Map setStyleString(String value) {
  72.     return (Map)super.setStyleString(value);
  73.   }

  74.   @Override
  75.   public Map setStyle(String styleAttribute, String styleValue) {
  76.     return (Map)super.setStyle(styleAttribute, styleValue);
  77.   }

  78.   @Override
  79.   public Map setTitle(String value) {
  80.     return (Map)super.setTitle(value);
  81.   }

  82.   @Override
  83.   public Map setData(String attributeName, String value) {
  84.     return (Map)super.setData(attributeName, value);
  85.   }

  86.   @Override
  87.   public Map setAttributeValueAsLong(String name, long value) {
  88.     return (Map)super.setAttributeValueAsLong(name, value);
  89.   }

  90.   @Override
  91.   public Map setText(String text) {
  92.     return (Map)super.setText(text);
  93.   }

  94. }