Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.devtools.wiki
Class TempWebContent  view TempWebContent download TempWebContent.java

java.lang.Object
  extended byorg.devtools.wiki.TempWebContent
All Implemented Interfaces:
org.devtools.webtrans.WebContent

public class TempWebContent
extends java.lang.Object
implements org.devtools.webtrans.WebContent

A temporary WebContent object. There is no hookup to a persistence layer, so any changes made will not be saved. This is useful for performing transient changes that result in a WebContent object, without the overhead of hitting a disk or other Persister type.


Field Summary
private  java.lang.String content
           
private  org.devtools.util.debug.Debugger D
           
private  java.util.Properties props
           
private  java.lang.String title
           
private  java.lang.String URL
           
 
Constructor Summary
TempWebContent()
          Constructs a blank WebContent object.
TempWebContent(org.devtools.webtrans.WebContent c)
          Constructs a temporary WebContent object which behaves exactly like the given WebContent, except that no changes made to the TempWebContent will be saved.
 
Method Summary
 java.lang.String getContent()
          Returns the content of the document.

 java.lang.String getProperty(java.lang.String key)
          Returns the value of a property that was earlier bound to this object via a setProperty call.
 java.util.Enumeration getPropertyNames()
          Returns an Enumeration of all of the names of the properties that this content has set.
 java.lang.String getTitle()
          Returns a string representing the title of this content.
 java.lang.String getURL()
          Returns the absolute URL that would, when prepended with an appropriate protocol, machine, and port, get you this content object from the persister.
 void setContent(java.lang.String content)
          Sets the content of this document to the given String.
 void setProperty(java.lang.String key, java.lang.String value)
          Binds a named property to this Web resource object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

title

private java.lang.String title

URL

private java.lang.String URL

content

private java.lang.String content

props

private java.util.Properties props

D

private org.devtools.util.debug.Debugger D
Constructor Detail

TempWebContent

public TempWebContent()
Constructs a blank WebContent object.


TempWebContent

public TempWebContent(org.devtools.webtrans.WebContent c)
               throws org.devtools.webtrans.PersistenceException
Constructs a temporary WebContent object which behaves exactly like the given WebContent, except that no changes made to the TempWebContent will be saved.

Method Detail

getContent

public java.lang.String getContent()
                            throws org.devtools.webtrans.PersistenceException
Returns the content of the document.

Specified by:
getContent in interface org.devtools.webtrans.WebContent

getProperty

public java.lang.String getProperty(java.lang.String key)
                             throws org.devtools.webtrans.PersistenceException
Returns the value of a property that was earlier bound to this object via a setProperty call.

Since the properties for this object may not have been loaded when this object was created, this method may load properties from the Persister before returning to the caller. Hence the possibility of a PersistenceException.

Specified by:
getProperty in interface org.devtools.webtrans.WebContent

getPropertyNames

public java.util.Enumeration getPropertyNames()
                                       throws org.devtools.webtrans.PersistenceException
Returns an Enumeration of all of the names of the properties that this content has set.

Specified by:
getPropertyNames in interface org.devtools.webtrans.WebContent

getTitle

public java.lang.String getTitle()
Returns a string representing the title of this content. The title string should be human-readable and displayable in both the TITLE tag and (maybe) at the top of the page.

If I ruled the world, the title would *have* to be the same as the relative part of the URL, so that users could easily refer to the page.

Specified by:
getTitle in interface org.devtools.webtrans.WebContent

getURL

public java.lang.String getURL()
Returns the absolute URL that would, when prepended with an appropriate protocol, machine, and port, get you this content object from the persister.

Specified by:
getURL in interface org.devtools.webtrans.WebContent

setContent

public void setContent(java.lang.String content)
                throws org.devtools.webtrans.PersistenceException
Sets the content of this document to the given String. The old contents are blown away.

Specified by:
setContent in interface org.devtools.webtrans.WebContent

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
                 throws org.devtools.webtrans.PersistenceException
Binds a named property to this Web resource object. This is useful for tagging objects with information such as author, last modified date, etc.

Since the properties for this object may not have been loaded when this object was created, this method may load properties from the Persister before returning to the caller. Hence the possibility of a PersistenceException.

Specified by:
setProperty in interface org.devtools.webtrans.WebContent