//# 0 errors, 88 messages
//#
/*
    //#abstractfeedview.java:1:1: class: net.sourceforge.pebble.web.view.impl.AbstractFeedView
    //#abstractfeedview.java:1:1: method: net.sourceforge.pebble.web.view.impl.AbstractFeedView.net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init
 * Copyright (c) 2003-2006, Simon Brown
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   - Neither the name of Pebble nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package net.sourceforge.pebble.web.view.impl;

import net.sourceforge.pebble.Constants;
import net.sourceforge.pebble.api.decorator.ContentDecoratorContext;
import net.sourceforge.pebble.decorator.ContentDecoratorChain;
import net.sourceforge.pebble.domain.AbstractBlog;
import net.sourceforge.pebble.web.view.XmlView;

import java.util.List;

/**
 * Base class for newsfeed views.
 *
 * @author    Simon Brown
 */
public abstract class AbstractFeedView extends XmlView {
    //#abstractfeedview.java:47: method: void net.sourceforge.pebble.web.view.impl.AbstractFeedView.net.sourceforge.pebble.web.view.impl.AbstractFeedView()
    //#input(void net.sourceforge.pebble.web.view.impl.AbstractFeedView()): this
    //#unanalyzed(void net.sourceforge.pebble.web.view.impl.AbstractFeedView()): Effects-of-calling:net.sourceforge.pebble.web.view.View
    //#abstractfeedview.java:47: end of method: void net.sourceforge.pebble.web.view.impl.AbstractFeedView.net.sourceforge.pebble.web.view.impl.AbstractFeedView()

  /**
   * Gets the content type of this view.
   *
   * @return the content type as a String
   */
  public String getContentType() {
    AbstractBlog blog = (AbstractBlog)getModel().get(Constants.BLOG_KEY);
    //#abstractfeedview.java:55: method: String net.sourceforge.pebble.web.view.impl.AbstractFeedView.getContentType()
    //#abstractfeedview.java:55: Warning: suspicious precondition
    //#    the precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.web.view.impl.AbstractFeedView
    //#    method: String getContentType()
    //#    suspicious precondition index: [2]
    //#input(String getContentType()): __Descendant_Table[net/sourceforge/pebble/web/view/impl/AbstractFeedView]
    //#input(String getContentType()): __Descendant_Table[net/sourceforge/pebble/web/view/impl/AtomResponsesView]
    //#input(String getContentType()): __Descendant_Table[net/sourceforge/pebble/web/view/impl/AtomView]
    //#input(String getContentType()): __Descendant_Table[others]
    //#input(String getContentType()): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(String getContentType()): net/sourceforge/pebble/web/model/Model.__Descendant_Table[net/sourceforge/pebble/web/model/Model]
    //#input(String getContentType()): net/sourceforge/pebble/web/model/Model.__Descendant_Table[others]
    //#input(String getContentType()): net/sourceforge/pebble/web/model/Model.__Dispatch_Table.get(Ljava/lang/String;)Ljava/lang/Object;
    //#input(String getContentType()): net/sourceforge/pebble/web/view/impl/AtomResponsesView.__Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(String getContentType()): net/sourceforge/pebble/web/view/impl/AtomView.__Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(String getContentType()): this
    //#input(String getContentType()): this.__Tag
    //#input(String getContentType()): this.model
    //#input(String getContentType()): this.model.__Tag
    //#input(String getContentType()): this.model.data
    //#output(String getContentType()): return_value
    //#pre[2] (String getContentType()): this.__Tag in {net/sourceforge/pebble/web/view/impl/AbstractFeedView, net/sourceforge/pebble/web/view/impl/AtomResponsesView, net/sourceforge/pebble/web/view/impl/AtomView}
    //#pre[3] (String getContentType()): this.model != null
    //#pre[4] (String getContentType()): this.model.__Tag == net/sourceforge/pebble/web/model/Model
    //#pre[5] (String getContentType()): this.model.data != null
    //#presumption(String getContentType()): java.util.HashMap:get(...)@63 != null
    //#post(String getContentType()): return_value != null
    //#unanalyzed(String getContentType()): Effects-of-calling:java.util.HashMap:get
    return "application/xml; charset=" + blog.getCharacterEncoding();
    //#abstractfeedview.java:56: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.AbstractBlog:getCharacterEncoding()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.view.impl.AbstractFeedView
    //#    method: String getContentType()
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.AbstractBlog:getCharacterEncoding()
    //#abstractfeedview.java:56: end of method: String net.sourceforge.pebble.web.view.impl.AbstractFeedView.getContentType()
  }

  /**
   * Prepares the view for presentation.
   */
  public void prepare() {
    ContentDecoratorContext context = new ContentDecoratorContext();
    //#abstractfeedview.java:63: method: void net.sourceforge.pebble.web.view.impl.AbstractFeedView.prepare()
    //#abstractfeedview.java:63: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.api.decorator.ContentDecoratorContext()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.view.impl.AbstractFeedView
    //#    method: void prepare()
    //#    unanalyzed callee: void net.sourceforge.pebble.api.decorator.ContentDecoratorContext()
    //#abstractfeedview.java:63: Warning: suspicious precondition
    //#    the precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.web.view.impl.AbstractFeedView
    //#    method: void prepare()
    //#    suspicious precondition index: [2]
    //#input(void prepare()): __Descendant_Table[net/sourceforge/pebble/web/view/impl/AbstractFeedView]
    //#input(void prepare()): __Descendant_Table[net/sourceforge/pebble/web/view/impl/AtomResponsesView]
    //#input(void prepare()): __Descendant_Table[net/sourceforge/pebble/web/view/impl/AtomView]
    //#input(void prepare()): __Descendant_Table[others]
    //#input(void prepare()): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(void prepare()): net/sourceforge/pebble/web/model/Model.__Descendant_Table[net/sourceforge/pebble/web/model/Model]
    //#input(void prepare()): net/sourceforge/pebble/web/model/Model.__Descendant_Table[others]
    //#input(void prepare()): net/sourceforge/pebble/web/model/Model.__Dispatch_Table.get(Ljava/lang/String;)Ljava/lang/Object;
    //#input(void prepare()): net/sourceforge/pebble/web/model/Model.__Dispatch_Table.put(Ljava/lang/String;Ljava/lang/Object;)V
    //#input(void prepare()): net/sourceforge/pebble/web/view/impl/AtomResponsesView.__Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(void prepare()): net/sourceforge/pebble/web/view/impl/AtomView.__Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(void prepare()): this
    //#input(void prepare()): this.__Tag
    //#input(void prepare()): this.model
    //#input(void prepare()): this.model.__Tag
    //#input(void prepare()): this.model.data
    //#pre[2] (void prepare()): this.__Tag in {net/sourceforge/pebble/web/view/impl/AbstractFeedView, net/sourceforge/pebble/web/view/impl/AtomResponsesView, net/sourceforge/pebble/web/view/impl/AtomView}
    //#pre[3] (void prepare()): this.model != null
    //#pre[4] (void prepare()): this.model.__Tag == net/sourceforge/pebble/web/model/Model
    //#pre[5] (void prepare()): this.model.data != null
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.HashMap:get
    //#unanalyzed(void prepare()): Effects-of-calling:java.util.HashMap:put
    context.setView(ContentDecoratorContext.SUMMARY_VIEW);
    //#abstractfeedview.java:64: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.api.decorator.ContentDecoratorContext:setView(int)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.view.impl.AbstractFeedView
    //#    method: void prepare()
    //#    unanalyzed callee: void net.sourceforge.pebble.api.decorator.ContentDecoratorContext:setView(int)
    context.setMedia(ContentDecoratorContext.NEWS_FEED);
    //#abstractfeedview.java:65: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.api.decorator.ContentDecoratorContext:setMedia(int)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.view.impl.AbstractFeedView
    //#    method: void prepare()
    //#    unanalyzed callee: void net.sourceforge.pebble.api.decorator.ContentDecoratorContext:setMedia(int)

    List blogEntries = (List)getModel().get(Constants.BLOG_ENTRIES);
    ContentDecoratorChain.decorate(context, blogEntries);
    //#abstractfeedview.java:68: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.decorator.ContentDecoratorChain:decorate(ContentDecoratorContext, List)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.view.impl.AbstractFeedView
    //#    method: void prepare()
    //#    unanalyzed callee: void net.sourceforge.pebble.decorator.ContentDecoratorChain:decorate(ContentDecoratorContext, List)
    getModel().put(Constants.BLOG_ENTRIES, blogEntries);
  }
    //#abstractfeedview.java:70: end of method: void net.sourceforge.pebble.web.view.impl.AbstractFeedView.prepare()

}    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Descendant_Table[net/sourceforge/pebble/web/view/impl/AbstractFeedView]
    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.dispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljavax/servlet/ServletContext;)V
    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.getContentType()Ljava/lang/String;
    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.getServletContext()Ljavax/servlet/ServletContext;
    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.getUri()Ljava/lang/String;
    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.prepare()V
    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.setModel(Lnet/sourceforge/pebble/web/model/Model;)V
    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.setServletContext(Ljavax/servlet/ServletContext;)V
    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): net/sourceforge/pebble/web/view/JspView.__Descendant_Table[net/sourceforge/pebble/web/view/impl/AbstractFeedView]
    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): net/sourceforge/pebble/web/view/View.__Descendant_Table[net/sourceforge/pebble/web/view/impl/AbstractFeedView]
    //#output(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): net/sourceforge/pebble/web/view/XmlView.__Descendant_Table[net/sourceforge/pebble/web/view/impl/AbstractFeedView]
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Descendant_Table[net/sourceforge/pebble/web/view/impl/AbstractFeedView] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): net/sourceforge/pebble/web/view/JspView.__Descendant_Table[net/sourceforge/pebble/web/view/impl/AbstractFeedView] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): net/sourceforge/pebble/web/view/View.__Descendant_Table[net/sourceforge/pebble/web/view/impl/AbstractFeedView] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): net/sourceforge/pebble/web/view/XmlView.__Descendant_Table[net/sourceforge/pebble/web/view/impl/AbstractFeedView] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.dispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljavax/servlet/ServletContext;)V == &net/sourceforge/pebble/web/view/XmlView.dispatch
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.getContentType()Ljava/lang/String; == &getContentType
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model; == &net/sourceforge/pebble/web/view/View.getModel
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.getServletContext()Ljavax/servlet/ServletContext; == &net/sourceforge/pebble/web/view/View.getServletContext
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.getUri()Ljava/lang/String; == &net/sourceforge/pebble/web/view/JspView.getUri
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.prepare()V == &prepare
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.setModel(Lnet/sourceforge/pebble/web/model/Model;)V == &net/sourceforge/pebble/web/view/View.setModel
    //#post(net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init): __Dispatch_Table.setServletContext(Ljavax/servlet/ServletContext;)V == &net/sourceforge/pebble/web/view/View.setServletContext
    //#abstractfeedview.java:: end of method: net.sourceforge.pebble.web.view.impl.AbstractFeedView.net.sourceforge.pebble.web.view.impl.AbstractFeedView__static_init
    //#abstractfeedview.java:: end of class: net.sourceforge.pebble.web.view.impl.AbstractFeedView
