//# 0 errors, 128 messages
//#
package net.sourceforge.pebble.decorator;
    //#readmoredecorator.java:1:1: class: net.sourceforge.pebble.decorator.ReadMoreDecorator
    //#readmoredecorator.java:1:1: method: net.sourceforge.pebble.decorator.ReadMoreDecorator.net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init

import net.sourceforge.pebble.api.decorator.ContentDecoratorContext;
import net.sourceforge.pebble.domain.Blog;
import net.sourceforge.pebble.domain.BlogEntry;
import net.sourceforge.pebble.util.I18n;

/**
 * Adds a read more link :
 *  - when the entry is aggregated
 *  - when an excerpt is present, in the summary view
 *
 * @author Simon Brown
 */
public class ReadMoreDecorator extends ContentDecoratorSupport {
    //#readmoredecorator.java:15: method: void net.sourceforge.pebble.decorator.ReadMoreDecorator.net.sourceforge.pebble.decorator.ReadMoreDecorator()
    //#input(void net.sourceforge.pebble.decorator.ReadMoreDecorator()): this
    //#readmoredecorator.java:15: end of method: void net.sourceforge.pebble.decorator.ReadMoreDecorator.net.sourceforge.pebble.decorator.ReadMoreDecorator()


  /**
   * Decorates the specified blog entry.
   *
   * @param context   the context in which the decoration is running
   * @param blogEntry the blog entry to be decorated
   */
  public void decorate(ContentDecoratorContext context, BlogEntry blogEntry) {
    Blog blog = blogEntry.getBlog();
    //#readmoredecorator.java:25: method: void net.sourceforge.pebble.decorator.ReadMoreDecorator.decorate(ContentDecoratorContext, BlogEntry)
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.__Tag
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.blog
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.blog.__Tag
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.blog.id
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.blog.permalinkProvider.__Tag
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.body
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.excerpt
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.originalPermalink
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.propertyChangeSupport
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): context
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): context.__Tag
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): context.view
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/Configuration.__Descendant_Table[net/sourceforge/pebble/Configuration]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/Configuration.__Descendant_Table[others]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/Configuration.__Dispatch_Table.getUrl()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/Configuration.__Dispatch_Table.isVirtualHostingEnabled()Z
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/api/decorator/ContentDecoratorContext.__Descendant_Table[net/sourceforge/pebble/api/decorator/ContentDecoratorContext]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/api/decorator/ContentDecoratorContext.__Descendant_Table[others]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/api/decorator/ContentDecoratorContext.__Dispatch_Table.getView()I
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/api/permalink/PermalinkProvider.__Descendant_Table[net/sourceforge/pebble/api/permalink/PermalinkProvider]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/api/permalink/PermalinkProvider.__Descendant_Table[others]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/api/permalink/PermalinkProvider.__Dispatch_Table.getPermalink(Lnet/sourceforge/pebble/domain/BlogEntry;)Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/Blog.__Descendant_Table[net/sourceforge/pebble/domain/Blog]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/Blog.__Descendant_Table[others]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/Blog.__Dispatch_Table.getId()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/Blog.__Dispatch_Table.getPermalinkProvider()Lnet/sourceforge/pebble/api/permalink/PermalinkProvider;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/Blog.__Dispatch_Table.getUrl()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[net/sourceforge/pebble/domain/BlogEntry]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogEntry.__Descendant_Table[others]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getBlog()Lnet/sourceforge/pebble/domain/Blog;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getBody()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getExcerpt()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getLocalPermalink()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getOriginalPermalink()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.getPermalink()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.isAggregated()Z
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.setBody(Ljava/lang/String;)V
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogEntry.__Dispatch_Table.setExcerpt(Ljava/lang/String;)V
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogManager.__Descendant_Table[net/sourceforge/pebble/domain/BlogManager]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogManager.__Descendant_Table[others]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogManager.__Dispatch_Table.isMultiBlog()Z
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogManager.instance
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogManager.instance.__Tag
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/BlogManager.instance.multiBlog
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/PageBasedContent.__Descendant_Table[net/sourceforge/pebble/domain/BlogEntry]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/PageBasedContent.__Descendant_Table[net/sourceforge/pebble/domain/PageBasedContent]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/PageBasedContent.__Descendant_Table[net/sourceforge/pebble/domain/StaticPage]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/PageBasedContent.__Descendant_Table[others]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/PageBasedContent.__Dispatch_Table.getLocalPermalink()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/PageBasedContent.__Dispatch_Table.getOriginalPermalink()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/PageBasedContent.__Dispatch_Table.isAggregated()Z
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/StaticPage.__Descendant_Table[net/sourceforge/pebble/domain/StaticPage]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/StaticPage.__Descendant_Table[others]
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/StaticPage.__Dispatch_Table.getBlog()Lnet/sourceforge/pebble/domain/Blog;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/StaticPage.__Dispatch_Table.getLocalPermalink()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/StaticPage.__Dispatch_Table.getOriginalPermalink()Ljava/lang/String;
    //#input(void decorate(ContentDecoratorContext, BlogEntry)): net/sourceforge/pebble/domain/StaticPage.__Dispatch_Table.isAggregated()Z
    //#output(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.body
    //#output(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.excerpt
    //#output(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.permalink
    //#pre[1] (void decorate(ContentDecoratorContext, BlogEntry)): blogEntry != null
    //#pre[2] (void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.__Tag == net/sourceforge/pebble/domain/BlogEntry
    //#pre[9] (void decorate(ContentDecoratorContext, BlogEntry)): init'ed(blogEntry.originalPermalink)
    //#pre[18] (void decorate(ContentDecoratorContext, BlogEntry)): init'ed(blogEntry.excerpt)
    //#pre[3] (void decorate(ContentDecoratorContext, BlogEntry)): (soft) blogEntry.blog != null
    //#pre[4] (void decorate(ContentDecoratorContext, BlogEntry)): (soft) blogEntry.blog.__Tag == net/sourceforge/pebble/domain/Blog
    //#pre[5] (void decorate(ContentDecoratorContext, BlogEntry)): (soft) init'ed(blogEntry.blog.id)
    //#pre[10] (void decorate(ContentDecoratorContext, BlogEntry)): (soft) blogEntry.propertyChangeSupport != null
    //#pre[11] (void decorate(ContentDecoratorContext, BlogEntry)): (soft) context != null
    //#pre[12] (void decorate(ContentDecoratorContext, BlogEntry)): (soft) context.__Tag == net/sourceforge/pebble/api/decorator/ContentDecoratorContext
    //#pre[13] (void decorate(ContentDecoratorContext, BlogEntry)): (soft) init'ed(context.view)
    //#pre[14] (void decorate(ContentDecoratorContext, BlogEntry)): (soft) net/sourceforge/pebble/domain/BlogManager.instance != null
    //#pre[15] (void decorate(ContentDecoratorContext, BlogEntry)): (soft) net/sourceforge/pebble/domain/BlogManager.instance.__Tag == net/sourceforge/pebble/domain/BlogManager
    //#pre[16] (void decorate(ContentDecoratorContext, BlogEntry)): (soft) init'ed(net/sourceforge/pebble/domain/BlogManager.instance.multiBlog)
    //#pre[17] (void decorate(ContentDecoratorContext, BlogEntry)): (soft) init'ed(blogEntry.body)
    //#post(void decorate(ContentDecoratorContext, BlogEntry)): (soft) init'ed(blogEntry.body)
    //#post(void decorate(ContentDecoratorContext, BlogEntry)): init'ed(blogEntry.excerpt)
    //#post(void decorate(ContentDecoratorContext, BlogEntry)): possibly_updated(blogEntry.permalink)
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:getBlog
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:getLocalPermalink
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:getUrl
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:java.lang.String:valueOf
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:java.beans.PropertyChangeSupport:firePropertyChange
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:java.lang.String:indexOf
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:net.sourceforge.pebble.PebbleContext:getInstance
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:net.sourceforge.pebble.PebbleContext:getConfiguration
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:java.lang.String:length
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:getPermalinkProvider
    //#unanalyzed(void decorate(ContentDecoratorContext, BlogEntry)): Effects-of-calling:getPermalink
    //#test_vector(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.originalPermalink: Addr_Set{null}, Inverse{null}
    //#test_vector(void decorate(ContentDecoratorContext, BlogEntry)): context.view: {-2_147_483_648..-1, 1..4_294_967_295}, {0}
    //#test_vector(void decorate(ContentDecoratorContext, BlogEntry)): blogEntry.excerpt: Addr_Set{null}, Inverse{null}
    //#test_vector(void decorate(ContentDecoratorContext, BlogEntry)): java.lang.String:length(...)@27: {0}, {1..4_294_967_295}

    if ((blogEntry.getExcerpt() != null && blogEntry.getExcerpt().length() > 0 && context.getView() == ContentDecoratorContext.SUMMARY_VIEW)) {
      StringBuffer buf = new StringBuffer();
      buf.append(blogEntry.getExcerpt());

      buf.append("<p><a href=\"");
      buf.append(blogEntry.getPermalink());
      buf.append("\">");
      buf.append(I18n.getMessage(blog, "common.readMore"));
    //#readmoredecorator.java:34: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.util.I18n:getMessage(Blog, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.decorator.ReadMoreDecorator
    //#    method: void decorate(ContentDecoratorContext, BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.util.I18n:getMessage(Blog, String)
      buf.append("</a></p>");

      blogEntry.setExcerpt(buf.toString());
    } else if (blogEntry.isAggregated()) {
      StringBuffer buf = new StringBuffer();
      buf.append(blogEntry.getBody());

      buf.append("<p><a href=\"");
      buf.append(blogEntry.getPermalink());
      buf.append("\">");
      buf.append(I18n.getMessage(blog, "common.readMore"));
    //#readmoredecorator.java:45: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.util.I18n:getMessage(Blog, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.decorator.ReadMoreDecorator
    //#    method: void decorate(ContentDecoratorContext, BlogEntry)
    //#    unanalyzed callee: String net.sourceforge.pebble.util.I18n:getMessage(Blog, String)
      buf.append("</a></p>");

      blogEntry.setBody(buf.toString());
    }
  }
    //#readmoredecorator.java:50: end of method: void net.sourceforge.pebble.decorator.ReadMoreDecorator.decorate(ContentDecoratorContext, BlogEntry)

}    //#output(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Descendant_Table[net/sourceforge/pebble/decorator/ReadMoreDecorator]
    //#output(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.decorate(Lnet/sourceforge/pebble/api/decorator/ContentDecoratorContext;Lnet/sourceforge/pebble/domain/BlogEntry;)V
    //#output(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.decorate(Lnet/sourceforge/pebble/api/decorator/ContentDecoratorContext;Lnet/sourceforge/pebble/domain/Comment;)V
    //#output(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.decorate(Lnet/sourceforge/pebble/api/decorator/ContentDecoratorContext;Lnet/sourceforge/pebble/domain/StaticPage;)V
    //#output(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.decorate(Lnet/sourceforge/pebble/api/decorator/ContentDecoratorContext;Lnet/sourceforge/pebble/domain/TrackBack;)V
    //#output(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.getBlog()Lnet/sourceforge/pebble/domain/Blog;
    //#output(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.setBlog(Lnet/sourceforge/pebble/domain/Blog;)V
    //#output(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): net/sourceforge/pebble/api/decorator/ContentDecorator.__Descendant_Table[net/sourceforge/pebble/decorator/ReadMoreDecorator]
    //#output(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): net/sourceforge/pebble/decorator/ContentDecoratorSupport.__Descendant_Table[net/sourceforge/pebble/decorator/ReadMoreDecorator]
    //#post(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Descendant_Table[net/sourceforge/pebble/decorator/ReadMoreDecorator] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): net/sourceforge/pebble/api/decorator/ContentDecorator.__Descendant_Table[net/sourceforge/pebble/decorator/ReadMoreDecorator] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): net/sourceforge/pebble/decorator/ContentDecoratorSupport.__Descendant_Table[net/sourceforge/pebble/decorator/ReadMoreDecorator] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.decorate(Lnet/sourceforge/pebble/api/decorator/ContentDecoratorContext;Lnet/sourceforge/pebble/domain/BlogEntry;)V == &decorate
    //#post(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.decorate(Lnet/sourceforge/pebble/api/decorator/ContentDecoratorContext;Lnet/sourceforge/pebble/domain/Comment;)V == &net/sourceforge/pebble/decorator/ContentDecoratorSupport.decorate
    //#post(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.decorate(Lnet/sourceforge/pebble/api/decorator/ContentDecoratorContext;Lnet/sourceforge/pebble/domain/StaticPage;)V == &net/sourceforge/pebble/decorator/ContentDecoratorSupport.decorate
    //#post(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.decorate(Lnet/sourceforge/pebble/api/decorator/ContentDecoratorContext;Lnet/sourceforge/pebble/domain/TrackBack;)V == &net/sourceforge/pebble/decorator/ContentDecoratorSupport.decorate
    //#post(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.getBlog()Lnet/sourceforge/pebble/domain/Blog; == &net/sourceforge/pebble/decorator/ContentDecoratorSupport.getBlog
    //#post(net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init): __Dispatch_Table.setBlog(Lnet/sourceforge/pebble/domain/Blog;)V == &net/sourceforge/pebble/decorator/ContentDecoratorSupport.setBlog
    //#readmoredecorator.java:: end of method: net.sourceforge.pebble.decorator.ReadMoreDecorator.net.sourceforge.pebble.decorator.ReadMoreDecorator__static_init
    //#readmoredecorator.java:: end of class: net.sourceforge.pebble.decorator.ReadMoreDecorator
