org.davesag.generica.core
Class AbstractText

java.lang.Object
  extended byorg.davesag.generica.core.AbstractDateStamped
      extended byorg.davesag.generica.core.AbstractContent
          extended byorg.davesag.generica.core.AbstractExtensibleContent
              extended byorg.davesag.generica.core.AbstractText
All Implemented Interfaces:
Authorable, Content, DateStamped, Extensible, Localisable, Persistable, Serializable
Direct Known Subclasses:
Comment, SiteCopy, Story

public abstract class AbstractText
extends AbstractExtensibleContent
implements Authorable

This abstract AbstractText bean is the root of all textual persistable, extensible authorable items.

Since:
Generica 0.0.1
Version:
CVS Revision $Id: AbstractText.java,v 1.14 2004/04/06 15:40:40 davesag Exp $
Author:
Dave Sag http://www.davesag.com
See Also:
Serialized Form

Field Summary
protected  User theAuthor
          the AbstractText's author
protected  String theText
          the actual text of the AbstractText
protected  String theTitle
          the title of this AbstractText
 
Fields inherited from class org.davesag.generica.core.AbstractExtensibleContent
theMetaData
 
Fields inherited from class org.davesag.generica.core.AbstractContent
theCountryCode, theLanguageCode
 
Fields inherited from class org.davesag.generica.core.AbstractDateStamped
theCreated, theId, theLastModified
 
Constructor Summary
AbstractText()
          null constructor required by hibernate.
AbstractText(String title, User author, String text, Locale loc)
          constructor takes a title, author, text and iso language code.
AbstractText(String title, User author, String text, String lang)
          constructor takes a title, author, text and iso language code.
 
Method Summary
 boolean equals(Object o)
          Tests if the supplied object is equal to this AbstractText, ie do they have the same Id?
 User getAuthor()
          Get the author of this text.
 String getText()
          Get the actual text of this text.
 String getTitle()
          Get the title of this text.
 void setAuthor(User author)
          Set the AbstractText's author.
 void setText(String text)
          Set the text of this AbstractText.
 void setTitle(String title)
          Set the AbstractText's title.
 
Methods inherited from class org.davesag.generica.core.AbstractExtensibleContent
addMetaData, getMetaData, getMetaData, removeMetaData, setMetaData
 
Methods inherited from class org.davesag.generica.core.AbstractContent
getCountryCode, getLanguageCode, getLocale, hashcode, setCountryCode, setLanguageCode, setLocale, toString
 
Methods inherited from class org.davesag.generica.core.AbstractDateStamped
getCreated, getId, getLastModified, setCreated, setId, setLastModified, setTemplateId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.davesag.generica.core.DateStamped
getCreated, getLastModified, setCreated, setLastModified
 

Field Detail

theAuthor

protected User theAuthor
the AbstractText's author


theTitle

protected String theTitle
the title of this AbstractText


theText

protected String theText
the actual text of the AbstractText

Constructor Detail

AbstractText

public AbstractText()
null constructor required by hibernate.


AbstractText

public AbstractText(String title,
                    User author,
                    String text,
                    String lang)
constructor takes a title, author, text and iso language code.

Parameters:
title - The name of the AbstractText.
author - The User who wrote the AbstractText.
text - The actual text of the AbstractText.
lang - The ISO Language Codeof the AbstractText.

AbstractText

public AbstractText(String title,
                    User author,
                    String text,
                    Locale loc)
constructor takes a title, author, text and iso language code.

Parameters:
title - The name of the AbstractText.
author - The User who wrote the AbstractText.
text - The actual text of the AbstractText.
loc - The Locale used to determone the ISO Language Code of the AbstractText.
Method Detail

getAuthor

public User getAuthor()
Get the author of this text.

Specified by:
getAuthor in interface Authorable
Returns:
The author of this AbstractText.

setAuthor

public void setAuthor(User author)
Set the AbstractText's author.

Specified by:
setAuthor in interface Authorable
Parameters:
author - The User who wrote this this AbstractText.

getTitle

public String getTitle()
Get the title of this text.

Returns:
The title of this AbstractText. In practice you would use StringUtils.escapeString to display this on a web page or in an rss feed.
Hibernate Property:
length = "255"

setTitle

public void setTitle(String title)
Set the AbstractText's title.

Parameters:
title - The title of this AbstractText.

getText

public String getText()
Get the actual text of this text.

Returns:
The text of this AbstractText. Never Null.
Hibernate Property:
length = "32000"

setText

public void setText(String text)
Set the text of this AbstractText.

Parameters:
text - The text of this AbstractText.

equals

public boolean equals(Object o)
Tests if the supplied object is equal to this AbstractText, ie do they have the same Id?

Overrides:
equals in class AbstractExtensibleContent
Parameters:
o - The object to test against this AbstractText. Must also be a AbstractText to make sense.
Returns:
true if the two users have the same id.


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.