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 text only. 020 * 021 * <h5 class='section'>See Also:</h5> 022 * <ul class='doctree'> 023 * <li class='link'><a class='doclink' href='../../../../../overview-summary.html#juneau-dto.HTML5'>Overview > juneau-dto > HTML5</a> 024 * </ul> 025 */ 026public class HtmlElementText extends HtmlElement { 027 028 private Object text; 029 030 /** 031 * Returns the inner text of this element. 032 * 033 * @return The inner text of this element, or <jk>null</jk> if no text is set. 034 */ 035 @Xml(format=XmlFormat.TEXT) 036 @BeanProperty("c") 037 public Object getText() { 038 return text; 039 } 040 041 /** 042 * Sets the inner text of this element. 043 * 044 * @param text The inner text of this element, or <jk>null</jk> if no text is set. 045 * @return This object (for method chaining). 046 */ 047 @BeanProperty("c") 048 public HtmlElement setText(Object text) { 049 this.text = text; 050 return this; 051 } 052 053 /** 054 * Sets the text node on this element. 055 * 056 * @param text The text node to add to this element. 057 * @return This object (for method chaining). 058 */ 059 public HtmlElement text(Object text) { 060 this.text = text; 061 return this; 062 } 063}