001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.dto.html5;
014
015import org.apache.juneau.annotation.*;
016import org.apache.juneau.xml.annotation.*;
017
018/**
019 * A subclass of HTML elements that contain <a href="https://www.w3.org/TR/html51/syntax.html#raw-text raw text}
020 * only.
021 *
022 * <h5 class='section'>See Also:</h5>
023 * <ul class='doctree'>
024 *    <li class='link'>{@doc juneau-dto.HTML5}
025 * </ul>
026 */
027public class HtmlElementRawText extends HtmlElement {
028
029   private Object text;
030
031   /**
032    * Returns the inner text of this element.
033    *
034    * @return The inner text of this element, or <jk>null</jk> if no text is set.
035    */
036   @Xml(format=XmlFormat.TEXT_PWS)
037   @BeanProperty("c")
038   public Object getText() {
039      return text;
040   }
041
042   /**
043    * Sets the inner text of this element.
044    *
045    * @param text The inner text of this element, or <jk>null</jk> if no text is set.
046    * @return This object (for method chaining).
047    */
048   @BeanProperty("c")
049   public HtmlElement setText(Object text) {
050      this.text = text;
051      return this;
052   }
053
054   /**
055    * Sets the text node on this element.
056    *
057    * @param text The text node to add to this element.
058    * @return This object (for method chaining).
059    */
060   public HtmlElement text(Object text) {
061      this.text = text;
062      return this;
063   }
064}