KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > header > Meta


1 /*
2  * $Id: Meta.java,v 1.3 2004/12/01 07:54:08 hengels Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.header;
15
16 import org.wings.Renderable;
17 import org.wings.io.Device;
18
19 import java.io.IOException JavaDoc;
20
21 /**
22  * @author <a HREF="mailto:hengels@mercatis.de">Holger Engels</a>
23  * @version $Revision: 1.3 $
24  */

25 public class Meta implements Renderable {
26     protected String JavaDoc httpEquiv;
27     protected String JavaDoc name;
28     protected String JavaDoc lang;
29     protected String JavaDoc content;
30
31     public Meta(String JavaDoc httpEquiv, String JavaDoc name, String JavaDoc lang, String JavaDoc content) {
32         this.httpEquiv = httpEquiv;
33         this.name = name;
34         this.lang = lang;
35         this.content = content;
36     }
37
38     public Meta(String JavaDoc name, String JavaDoc lang, String JavaDoc content) {
39         this(null, name, lang, content);
40
41     }
42
43     public void setName(String JavaDoc name) {
44         this.name = name;
45     }
46
47     public String JavaDoc getName() {
48         return name;
49     }
50
51     public void setLang(String JavaDoc lang) {
52         this.lang = lang;
53     }
54
55     public String JavaDoc getLang() {
56         return lang;
57     }
58
59     public void setContent(String JavaDoc content) {
60         this.content = content;
61     }
62
63     public String JavaDoc getContent() {
64         return content;
65     }
66
67     public String JavaDoc getHttpEquiv() {
68         return httpEquiv;
69     }
70
71     public void setHttpEquiv(String JavaDoc pHttpEquiv) {
72         httpEquiv = pHttpEquiv;
73     }
74
75     public void write(Device d)
76             throws IOException JavaDoc {
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 }
89
90
91
Popular Tags