2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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 * ============LICENSE_END====================================================
22 package org.onap.aaf.misc.xgen.html;
24 import java.io.Writer;
26 import org.onap.aaf.misc.xgen.Mark;
28 public class HTML4Gen extends HTMLGen {
29 private final static String DOCTYPE =
31 "<!DOCTYPE HTML PUBLIC " +
32 "\"-//W3C//DTD HTML 4.01 Transitional//EN\" " +
33 "\"http://www.w3.org/TR/html3/loose.dtd\">";
34 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" +
35 " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
37 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"" +
38 " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
40 public HTML4Gen(Writer w) {
45 public HTMLGen html(String ... attrib) {
46 forward.println(DOCTYPE);
47 return incr("html","xmlns=http://www.w3.org/1999/xhtml","xml:lang=en","lang=en");
53 Mark head = new Mark("head");
59 public Mark body(String ... attrs) {
60 Mark body = new Mark("body");
61 incr(body,"body",attrs);
66 public HTML4Gen charset(String charset) {
67 forward.append("<meta http-equiv=\"Content-type\" content=\"text.hml; charset=");
68 forward.append(charset);
69 forward.append("\">");
75 public Mark header(String ... attribs) {
76 String[] a = new String[attribs.length+1];
78 System.arraycopy(attribs, 0, a, 1, attribs.length);
83 public Mark footer(String ... attribs) {
84 String[] a = new String[attribs.length+1];
86 System.arraycopy(attribs, 0, a, 1, attribs.length);
91 public Mark section(String ... attribs) {
92 String[] a = new String[attribs.length+1];
94 System.arraycopy(attribs, 0, a, 1, attribs.length);
99 public Mark article(String ... attribs) {
100 String[] a = new String[attribs.length+1];
102 System.arraycopy(attribs, 0, a, 1, attribs.length);
107 public Mark aside(String ... attribs) {
108 String[] a = new String[attribs.length+1];
110 System.arraycopy(attribs, 0, a, 1, attribs.length);
115 public Mark nav(String ... attribs) {
116 String[] a = new String[attribs.length+1];
118 System.arraycopy(attribs, 0, a, 1, attribs.length);
123 // protected void importCSS(Imports imports) {
124 // if(imports.css.size()==1) {
125 // cssInline(imports.css.get(0));
127 // text("<style type=\"text/css\">");
128 // prettyln(forward);
130 // for(String str : imports.css) {
131 // forward.print("@import url(\"");
132 // forward.print(imports.themePath(null));
133 // forward.print(str);
134 // forward.print("\");");
135 // prettyln(forward);
138 // forward.print("</style>");
139 // prettyln(forward);