| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||||
| WOStaticElement |
|
| 1.25;1.25 |
| 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 | 0 | public WOStaticElement() |
| 37 | 0 | { |
| 38 | 0 | content = null; |
| 39 | 0 | } |
| 40 | ||
| 41 | /** |
|
| 42 | * Returns a static element representing the specified content. |
|
| 43 | */ |
|
| 44 | public WOStaticElement( String aContentString ) |
|
| 45 | { |
|
| 46 | 0 | this(); |
| 47 | 0 | content = aContentString; |
| 48 | 0 | } |
| 49 | ||
| 50 | /** |
|
| 51 | * Overridden to append the content string.. |
|
| 52 | */ |
|
| 53 | public void appendToResponse (WOResponse aResponse, WOContext aContext) |
|
| 54 | { |
|
| 55 | 0 | aResponse.appendContentString( content ); |
| 56 | 0 | } |
| 57 | ||
| 58 | ||
| 59 | public WOResponse generateResponse() |
|
| 60 | { |
|
| 61 | 0 | WOResponse r = new WOResponse(); |
| 62 | 0 | if (content != null) |
| 63 | { |
|
| 64 | 0 | r.appendContentString(content); |
| 65 | } |
|
| 66 | 0 | return r; |
| 67 | } |
|
| 68 | ||
| 69 | ||
| 70 | } |