net.sourceforge.pebble.decorator
Class ContentDecoratorChain

java.lang.Object
  extended by net.sourceforge.pebble.decorator.ContentDecoratorChain
All Implemented Interfaces:
ContentDecorator

public class ContentDecoratorChain
extends java.lang.Object
implements ContentDecorator

Manages a list of content decorators at runtime.

Author:
Simon Brown

Constructor Summary
ContentDecoratorChain(Blog blog)
          Creates a new chain.
 
Method Summary
 void add(ContentDecorator decorator)
          Adds a new decorator.
 void decorate(ContentDecoratorContext context, BlogEntry blogEntry)
          Decorates the specified blog entry.
 void decorate(ContentDecoratorContext context, Comment comment)
          Decorates the specified comment.
static void decorate(ContentDecoratorContext context, java.util.List blogEntries)
          Decorates the specified blog entries.
 void decorate(ContentDecoratorContext context, StaticPage staticPage)
          Decorates the specified static page.
 void decorate(ContentDecoratorContext context, TrackBack trackBack)
          Decorates the specified TrackBack.
 Blog getBlog()
          Gets the blog to which this decorator is associated.
 java.util.List getContentDecorators()
          Gets the list of decorators in use.
 java.util.List<ContentDecorator> getDecorators()
          Gets the list of content decorators.
 void setBlog(Blog blog)
          Sets the blog to which this decorator is associated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentDecoratorChain

public ContentDecoratorChain(Blog blog)
Creates a new chain.

Method Detail

add

public void add(ContentDecorator decorator)
Adds a new decorator.

Parameters:
decorator - a ContentDecorator instance

getContentDecorators

public java.util.List getContentDecorators()
Gets the list of decorators in use.


decorate

public void decorate(ContentDecoratorContext context,
                     BlogEntry blogEntry)
Decorates the specified blog entry.

Specified by:
decorate in interface ContentDecorator
Parameters:
context - the context in which the decoration is running
blogEntry - the blog entry to be decorated

decorate

public void decorate(ContentDecoratorContext context,
                     Comment comment)
Decorates the specified comment.

Specified by:
decorate in interface ContentDecorator
Parameters:
context - the context in which the decoration is running
comment - the comment to be decorated

decorate

public void decorate(ContentDecoratorContext context,
                     TrackBack trackBack)
Decorates the specified TrackBack.

Specified by:
decorate in interface ContentDecorator
Parameters:
context - the context in which the decoration is running
trackBack - the TrackBack to be decorated

decorate

public void decorate(ContentDecoratorContext context,
                     StaticPage staticPage)
Decorates the specified static page.

Specified by:
decorate in interface ContentDecorator
Parameters:
context - the context in which the decoration is running
staticPage - the static page to be decorated

getBlog

public Blog getBlog()
Gets the blog to which this decorator is associated.

Specified by:
getBlog in interface ContentDecorator
Returns:
a Blog instance

setBlog

public void setBlog(Blog blog)
Sets the blog to which this decorator is associated.

Specified by:
setBlog in interface ContentDecorator
Parameters:
blog - a Blog instance

getDecorators

public java.util.List<ContentDecorator> getDecorators()
Gets the list of content decorators.

Returns:
a List of ContentDecorator instances

decorate

public static void decorate(ContentDecoratorContext context,
                            java.util.List blogEntries)
Decorates the specified blog entries.

Parameters:
blogEntries - a List of BlogEntry instances


Copyright © 2003-2006, Simon Brown. All Rights Reserved.