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.*; 016 017/** 018 * DTO for an HTML {@doc ExtHTML5.sections#the-article-element <article>} 019 * element. 020 * 021 * <ul class='seealso'> 022 * <li class='link'>{@doc DtoHtml5} 023 * </ul> 024 */ 025@Bean(typeName="article") 026public class Article extends HtmlElementMixed { 027 028 /** 029 * Creates an empty {@link Article} element. 030 */ 031 public Article() {} 032 033 /** 034 * Creates an {@link Article} element with the specified child nodes. 035 * 036 * @param children The child nodes. 037 */ 038 public Article(Object...children) { 039 children(children); 040 } 041 042 /** 043 * Adds a header node to this element. 044 * 045 * @param children The children inside the header node. 046 * @return This object (for method chaining). 047 */ 048 public Article header(Object...children) { 049 super.child(HtmlBuilder.header(children)); 050 return this; 051 } 052 053 /** 054 * Adds a footer node to this element. 055 * 056 * @param children The children inside the footer node. 057 * @return This object (for method chaining). 058 */ 059 public Article footer(Object...children) { 060 super.child(HtmlBuilder.footer(children)); 061 return this; 062 } 063 064 /** 065 * Adds a link node to this element. 066 * 067 * @param link The link node to add to this article. 068 * @return This object (for method chaining). 069 */ 070 public Article link(Link link) { 071 super.child(link); 072 return this; 073 } 074 075 /** 076 * Adds a section node to this element. 077 * 078 * @param section The section node to add to this article. 079 * @return This object (for method chaining). 080 */ 081 public Article section(Section section) { 082 super.child(section); 083 return this; 084 } 085 086 087 //----------------------------------------------------------------------------------------------------------------- 088 // Overridden methods 089 //----------------------------------------------------------------------------------------------------------------- 090 091 @Override /* HtmlElement */ 092 public final Article _class(String _class) { 093 super._class(_class); 094 return this; 095 } 096 097 @Override /* HtmlElement */ 098 public final Article id(String id) { 099 super.id(id); 100 return this; 101 } 102 103 @Override /* HtmlElement */ 104 public final Article style(String style) { 105 super.style(style); 106 return this; 107 } 108 109 @Override /* HtmlElementMixed */ 110 public Article children(Object...children) { 111 super.children(children); 112 return this; 113 } 114 115 @Override /* HtmlElementMixed */ 116 public Article child(Object child) { 117 super.child(child); 118 return this; 119 } 120}