001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.examples.bean.atom; 018 019import org.apache.juneau.html.*; 020 021/** 022 * Atom feed HTML example. 023 * 024 * <h5 class='section'>See Also:</h5><ul> 025 * </ul> 026 */ 027public class AtomHtmlExample { 028 029 /** 030 * HTML Atom feed example. 031 * 032 * @param args Unused. 033 * @throws Exception Unused. 034 */ 035 public static void main(String[] args) throws Exception { 036 037 var feed = AtomFeed.getAtomFeed(); 038 039 // Example with no namespaces 040 // Create a serializer with readable output, no namespaces yet. 041 var s = HtmlSerializer.create().sq().ws().build(); 042 043 //Produces 044 /** 045 * <table> 046 * <tr> 047 * <td>title</td> 048 * <td> 049 * <table> 050 * <tr> 051 * <td>text</td> 052 * <td>Juneau ATOM specification</td> 053 * </tr> 054 * </table> 055 * </td> 056 * </tr> 057 * <tr> 058 * <td>updated</td> 059 * <td>2016-01-02T03:04:05Z</td> 060 * </tr> 061 * <tr> 062 * <td>links</td> 063 * <td> 064 * <table _type='array'> 065 * <tr> 066 * <th>rel</th> 067 * <th>href</th> 068 * <th>hreflang</th> 069 * <th>type</th> 070 * </tr> 071 * <tr> 072 * <td>alternate</td> 073 * <td><a href='http://juneau.apache.org'>http://juneau.apache.org</a></td> 074 * <td>en</td> 075 * <td>text/html</td> 076 * </tr> 077 * <tr> 078 * <td>self</td> 079 * <td><a href='http://juneau.apache.org/feed.atom'>http://juneau.apache.org/feed.atom</a></td> 080 * <td><null/></td> 081 * <td>application/atom+xml</td> 082 * </tr> 083 * </table> 084 * </td> 085 * </tr> 086 * <tr> 087 * <td>id</td> 088 * <td> 089 * <table> 090 * <tr> 091 * <td>text</td> 092 * <td>tag:juneau.apache.org</td> 093 * </tr> 094 * </table> 095 * </td> 096 * </tr> 097 * <tr> 098 * <td>subtitle</td> 099 * <td> 100 * <table> 101 * <tr> 102 * <td>text</td> 103 * <td>Describes <em>stuff</em> about Juneau</td> 104 * </tr> 105 * <tr> 106 * <td>type</td> 107 * <td>html</td> 108 * </tr> 109 * </table> 110 * </td> 111 * </tr> 112 * <tr> 113 * <td>generator</td> 114 * <td> 115 * <table> 116 * <tr> 117 * <td>version</td> 118 * <td>1.0</td> 119 * </tr> 120 * <tr> 121 * <td>text</td> 122 * <td>Juneau</td> 123 * </tr> 124 * <tr> 125 * <td>uri</td> 126 * <td><a href='http://juneau.apache.org'>http://juneau.apache.org</a></td> 127 * </tr> 128 * </table> 129 * </td> 130 * </tr> 131 * <tr> 132 * <td>entries</td> 133 * <td> 134 * <table _type='array'> 135 * <tr> 136 * <th>title</th> 137 * <th>updated</th> 138 * <th>links</th> 139 * <th>contributors</th> 140 * <th>authors</th> 141 * <th>id</th> 142 * <th>content</th> 143 * </tr> 144 * <tr> 145 * <td> 146 * <table> 147 * <tr> 148 * <td>text</td> 149 * <td>Juneau ATOM specification snapshot</td> 150 * </tr> 151 * </table> 152 * </td> 153 * <td>2016-01-02T03:04:05Z</td> 154 * <td> 155 * <table _type='array'> 156 * <tr> 157 * <th>rel</th> 158 * <th>href</th> 159 * <th>type</th> 160 * <th>length</th> 161 * </tr> 162 * <tr> 163 * <td>alternate</td> 164 * <td><a href='http://juneau.apache.org/juneau.atom'>http://juneau.apache.org/juneau.atom</a></td> 165 * <td>text/html</td> 166 * <td><null/></td> 167 * </tr> 168 * <tr> 169 * <td>enclosure</td> 170 * <td><a href='http://juneau.apache.org/audio/juneau_podcast.mp3'>http://juneau.apache.org/audio/juneau_podcast.mp3</a></td> 171 * <td>audio/mpeg</td> 172 * <td>1337</td> 173 * </tr> 174 * </table> 175 * </td> 176 * <td> 177 * <table _type='array'> 178 * <tr> 179 * <th>uri</th> 180 * <th>email</th> 181 * <th>name</th> 182 * </tr> 183 * <tr> 184 * <td><a href='http://juneau.apache.org'>http://juneau.apache.org</a></td> 185 * <td>janesmith@apache.org</td> 186 * <td>Jane Smith</td> 187 * </tr> 188 * </table> 189 * </td> 190 * <td> 191 * <table _type='array'> 192 * <tr> 193 * <th>name</th> 194 * </tr> 195 * <tr> 196 * <td>John Smith</td> 197 * </tr> 198 * </table> 199 * </td> 200 * <td> 201 * <table> 202 * <tr> 203 * <td>text</td> 204 * <td>tag:juneau.sample.com,2013:1.2345</td> 205 * </tr> 206 * </table> 207 * </td> 208 * <td>2016-01-02T03:04:05Z</td> 209 * <td> 210 * <table> 211 * <tr> 212 * <td>lang</td> 213 * <td>en</td> 214 * </tr> 215 * <tr> 216 * <td>base</td> 217 * <td><a href='http://www.apache.org/'>http://www.apache.org/</a></td> 218 * </tr> 219 * <tr> 220 * <td>text</td> 221 * <td><div><p><i>[Update: Juneau supports ATOM.]</i></p></div></td> 222 * </tr> 223 * <tr> 224 * <td>type</td> 225 * <td>xhtml</td> 226 * </tr> 227 * </table> 228 * </td> 229 * </tr> 230 * </table> 231 * </td> 232 * </tr> 233 * </table> 234 */ 235 System.out.print(s.serialize(feed)); 236 } 237}