01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings.header;
14:
15: import org.wings.io.Device;
16:
17: import java.io.IOException;
18: import java.io.Serializable;
19:
20: /**
21: * Include a <code><META></code>-element inside the HTML header of rendered page.
22: *
23: * @author Holger Engels
24: */
25: public class Meta implements Header, Serializable {
26: protected String httpEquiv;
27: protected String name;
28: protected String lang;
29: protected String content;
30:
31: public Meta(String httpEquiv, String name, String lang,
32: String content) {
33: this .httpEquiv = httpEquiv;
34: this .name = name;
35: this .lang = lang;
36: this .content = content;
37: }
38:
39: public Meta(String name, String lang, String content) {
40: this (null, name, lang, content);
41:
42: }
43:
44: public void setName(String name) {
45: this .name = name;
46: }
47:
48: public String getName() {
49: return name;
50: }
51:
52: public void setLang(String lang) {
53: this .lang = lang;
54: }
55:
56: public String getLang() {
57: return lang;
58: }
59:
60: public void setContent(String content) {
61: this .content = content;
62: }
63:
64: public String getContent() {
65: return content;
66: }
67:
68: public String getHttpEquiv() {
69: return httpEquiv;
70: }
71:
72: public void setHttpEquiv(String pHttpEquiv) {
73: httpEquiv = pHttpEquiv;
74: }
75:
76: public void write(Device d) throws IOException {
77: d.print("<meta");
78: if (httpEquiv != null)
79: d.print(" http-equiv=\"" + httpEquiv + "\"");
80: if (name != null)
81: d.print(" name=\"" + name + "\"");
82: if (lang != null)
83: d.print(" lang=\"" + lang + "\"");
84: if (content != null)
85: d.print(" content=\"" + content + "\"");
86: d.print("/>");
87: }
88: }
|