org.davesag.generica.core
Class AbstractExtensibleContent

java.lang.Object
  extended byorg.davesag.generica.core.AbstractDateStamped
      extended byorg.davesag.generica.core.AbstractContent
          extended byorg.davesag.generica.core.AbstractExtensibleContent
All Implemented Interfaces:
Content, DateStamped, Extensible, Localisable, Persistable, Serializable
Direct Known Subclasses:
AbstractText, Category, Media, MediaType

public abstract class AbstractExtensibleContent
extends AbstractContent
implements Extensible

The AbstractExtensibleContent bean provides a handy abstract root for all extensible core classes.

Since:
Visuality Lite 1.0.0
Version:
CVS Revision $Id: AbstractExtensibleContent.java,v 1.6 2004/04/08 13:19:07 davesag Exp $
Author:
Dave Sag http://www.davesag.com
See Also:
Serialized Form

Field Summary
protected  Map theMetaData
          a map of application definable meta-data
 
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
AbstractExtensibleContent()
          default constructor
AbstractExtensibleContent(Locale loc)
          constructor takes a locale.
AbstractExtensibleContent(String lang)
          constructor takes a language code.
 
Method Summary
 void addMetaData(String key, String metadata)
          Add a piece of MetaData to this AbstractExtensibleContent.
 boolean equals(Object o)
          Tests if the supplied object is equal to this AbstractExtensibleContent, ie do they have the same Id?
 Map getMetaData()
          Get the Map of MetaData about this text.
 Object getMetaData(Object key)
          returns the metadata for the particular key.
 void removeMetaData(String key)
          Remove a piece of MetaData from this AbstractExtensibleContent.
 void setMetaData(Map metadata)
          Set this AbstractExtensibleContent's MetaData Map.
 
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

theMetaData

protected Map theMetaData
a map of application definable meta-data

Constructor Detail

AbstractExtensibleContent

public AbstractExtensibleContent()
default constructor


AbstractExtensibleContent

public AbstractExtensibleContent(String lang)
constructor takes a language code.

Parameters:
lang - The ISO Language Code.

AbstractExtensibleContent

public AbstractExtensibleContent(Locale loc)
constructor takes a locale.

Parameters:
loc - The Locale.
Method Detail

getMetaData

public Map getMetaData()
Get the Map of MetaData about this text.

Specified by:
getMetaData in interface Extensible
Returns:
The Map of MetaData about this AbstractExtensibleContent.

getMetaData

public Object getMetaData(Object key)
returns the metadata for the particular key.

Specified by:
getMetaData in interface Extensible
Parameters:
key - The key to the bit of meta data you want.
Returns:
The Value corresponding to the key.
Hibernate Map:
table = "content_metadata" cascade="all" lazy="true"

setMetaData

public void setMetaData(Map metadata)
Set this AbstractExtensibleContent's MetaData Map.

Specified by:
setMetaData in interface Extensible
Parameters:
metadata - The Map of meta data for this AbstractExtensibleContent.

addMetaData

public void addMetaData(String key,
                        String metadata)
Add a piece of MetaData to this AbstractExtensibleContent.

Specified by:
addMetaData in interface Extensible
Parameters:
key - The key under which to file the meta data. If the key is already there the value will replace the existing value.
metadata - The meta data to add.

removeMetaData

public void removeMetaData(String key)
Remove a piece of MetaData from this AbstractExtensibleContent.

Specified by:
removeMetaData in interface Extensible
Parameters:
key - The MetaData key to remove.

equals

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

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


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