View Javadoc

1   /*
2   Wotonomy: OpenStep design patterns for pure Java applications.
3   Copyright (C) 2000 Blacksmith, Inc.
4   
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License as published by the Free Software Foundation; either
8   version 2.1 of the License, or (at your option) any later version.
9   
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  Lesser General Public License for more details.
14  
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, see http://www.gnu.org
17  */
18  
19  package net.wotonomy.web;
20  
21  /***
22  * This class represents a static portion of a web page.
23  * Package access only, as it is not in the specification.
24  *
25  * @author michael@mpowers.net
26  * @author $Author: cgruber $
27  * @version $Revision: 893 $
28  */
29  class WOStaticElement extends WOElement
30  {
31  	String content;
32  
33  	/***
34  	* Default constructor.  
35  	*/
36  	public WOStaticElement()
37  	{
38  		content = null;
39  	}
40  	
41  	/***
42  	* Returns a static element representing the specified content.
43  	*/
44  	public WOStaticElement( String aContentString )
45  	{
46  		this();
47  		content = aContentString;
48  	}
49  
50      /***
51      * Overridden to append the content string..
52      */
53      public void appendToResponse (WOResponse aResponse, WOContext aContext)
54      {
55      	aResponse.appendContentString( content );
56      }
57      
58   
59      public WOResponse generateResponse() 
60      {
61          WOResponse r = new WOResponse();
62          if (content != null) 
63          {
64              r.appendContentString(content);
65          }
66          return r;
67      }
68      
69      
70  }