//# 0 errors, 96 messages
//#
/*
    //#xmlview.java:1:1: class: net.sourceforge.pebble.web.view.XmlView
    //#xmlview.java:1:1: method: net.sourceforge.pebble.web.view.XmlView.net.sourceforge.pebble.web.view.XmlView__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;

import net.sourceforge.pebble.Constants;
import net.sourceforge.pebble.domain.Blog;
import net.sourceforge.pebble.domain.AbstractBlog;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Represents an XML view component, implemented by a JSP
 * and prepares the model for display.
 *
 * @author    Simon Brown
 */
public abstract class XmlView extends JspView {
    //#xmlview.java:51: method: void net.sourceforge.pebble.web.view.XmlView.net.sourceforge.pebble.web.view.XmlView()
    //#input(void net.sourceforge.pebble.web.view.XmlView()): this
    //#unanalyzed(void net.sourceforge.pebble.web.view.XmlView()): Effects-of-calling:net.sourceforge.pebble.web.view.View
    //#xmlview.java:51: end of method: void net.sourceforge.pebble.web.view.XmlView.net.sourceforge.pebble.web.view.XmlView()

  /**
   * Gets the content type of this view.
   *
   * @return the content type as a String
   */
  public String getContentType() {
    Blog blog = (Blog)getModel().get(Constants.BLOG_KEY);
    //#xmlview.java:59: method: String net.sourceforge.pebble.web.view.XmlView.getContentType()
    //#xmlview.java:59: Warning: suspicious precondition
    //#    the precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.web.view.XmlView
    //#    method: String getContentType()
    //#    suspicious precondition index: [2]
    //#input(String getContentType()): __Descendant_Table[net/sourceforge/pebble/web/view/XmlView]
    //#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/AbstractFeedView.__Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#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, net/sourceforge/pebble/web/view/XmlView}
    //#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();
    //#xmlview.java:60: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.Blog:getCharacterEncoding()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.view.XmlView
    //#    method: String getContentType()
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.Blog:getCharacterEncoding()
    //#xmlview.java:60: end of method: String net.sourceforge.pebble.web.view.XmlView.getContentType()
  }

  /**
   * Dispatches this view.
   *
   * @param request  the HttpServletRequest instance
   * @param response the HttpServletResponse instance
   * @param context
   */
  public void dispatch(HttpServletRequest request, HttpServletResponse response, ServletContext context) throws ServletException {
    try {
      RequestDispatcher dispatcher = context.getRequestDispatcher(getUri());
    //#xmlview.java:72: method: void net.sourceforge.pebble.web.view.XmlView.dispatch(HttpServletRequest, HttpServletResponse, ServletContext)
    //#xmlview.java:72: Warning: method not available
    //#    -- call on String getUri()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.view.XmlView
    //#    method: void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)
    //#    unanalyzed callee: String getUri()
    //#xmlview.java:72: Warning: suspicious precondition
    //#    the precondition for this.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.web.view.XmlView
    //#    method: void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)
    //#    suspicious precondition index: [5]
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): __Descendant_Table[net/sourceforge/pebble/web/view/XmlView]
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): __Descendant_Table[net/sourceforge/pebble/web/view/impl/AbstractFeedView]
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): __Descendant_Table[net/sourceforge/pebble/web/view/impl/AtomResponsesView]
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): __Descendant_Table[net/sourceforge/pebble/web/view/impl/AtomView]
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): __Descendant_Table[others]
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): __Dispatch_Table.getUri()Ljava/lang/String;
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): context
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): net/sourceforge/pebble/web/model/Model.__Descendant_Table[net/sourceforge/pebble/web/model/Model]
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): net/sourceforge/pebble/web/model/Model.__Descendant_Table[others]
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): net/sourceforge/pebble/web/model/Model.__Dispatch_Table.get(Ljava/lang/String;)Ljava/lang/Object;
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): net/sourceforge/pebble/web/view/impl/AbstractFeedView.__Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): net/sourceforge/pebble/web/view/impl/AbstractFeedView.__Dispatch_Table.getUri()Ljava/lang/String;
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): net/sourceforge/pebble/web/view/impl/AtomResponsesView.__Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): net/sourceforge/pebble/web/view/impl/AtomResponsesView.__Dispatch_Table.getUri()Ljava/lang/String;
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): net/sourceforge/pebble/web/view/impl/AtomView.__Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): net/sourceforge/pebble/web/view/impl/AtomView.__Dispatch_Table.getUri()Ljava/lang/String;
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): request
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): response
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): this
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): this.__Tag
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): this.model
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): this.model.__Tag
    //#input(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): this.model.data
    //#pre[1] (void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): context != null
    //#pre[5] (void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): this.__Tag in {net/sourceforge/pebble/web/view/impl/AbstractFeedView, net/sourceforge/pebble/web/view/impl/AtomResponsesView, net/sourceforge/pebble/web/view/impl/AtomView, net/sourceforge/pebble/web/view/XmlView}
    //#pre[6] (void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): this.model != null
    //#pre[7] (void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): this.model.__Tag == net/sourceforge/pebble/web/model/Model
    //#pre[8] (void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): this.model.data != null
    //#presumption(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): java.util.HashMap:get(...)@63 != null
    //#presumption(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): javax.servlet.ServletContext:getRequestDispatcher(...)@72 != null
    //#unanalyzed(void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)): Effects-of-calling:java.util.HashMap:get
      dispatcher.include(request, response);
    } catch (IOException ioe) {
      throw new ServletException(ioe);
    } finally {
      AbstractBlog blog = (AbstractBlog)getModel().get(Constants.BLOG_KEY);
      blog.log(request, HttpServletResponse.SC_OK);
    //#xmlview.java:78: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.AbstractBlog:log(HttpServletRequest, int)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.view.XmlView
    //#    method: void dispatch(HttpServletRequest, HttpServletResponse, ServletContext)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.AbstractBlog:log(HttpServletRequest, int)
    }
  }
    //#xmlview.java:80: end of method: void net.sourceforge.pebble.web.view.XmlView.dispatch(HttpServletRequest, HttpServletResponse, ServletContext)

}
    //#output(net.sourceforge.pebble.web.view.XmlView__static_init): __Descendant_Table[net/sourceforge/pebble/web/view/XmlView]
    //#output(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.dispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljavax/servlet/ServletContext;)V
    //#output(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.getContentType()Ljava/lang/String;
    //#output(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#output(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.getServletContext()Ljavax/servlet/ServletContext;
    //#output(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.getUri()Ljava/lang/String;
    //#output(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.prepare()V
    //#output(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.setModel(Lnet/sourceforge/pebble/web/model/Model;)V
    //#output(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.setServletContext(Ljavax/servlet/ServletContext;)V
    //#output(net.sourceforge.pebble.web.view.XmlView__static_init): net/sourceforge/pebble/web/view/JspView.__Descendant_Table[net/sourceforge/pebble/web/view/XmlView]
    //#output(net.sourceforge.pebble.web.view.XmlView__static_init): net/sourceforge/pebble/web/view/View.__Descendant_Table[net/sourceforge/pebble/web/view/XmlView]
    //#post(net.sourceforge.pebble.web.view.XmlView__static_init): __Descendant_Table[net/sourceforge/pebble/web/view/XmlView] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.view.XmlView__static_init): net/sourceforge/pebble/web/view/JspView.__Descendant_Table[net/sourceforge/pebble/web/view/XmlView] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.view.XmlView__static_init): net/sourceforge/pebble/web/view/View.__Descendant_Table[net/sourceforge/pebble/web/view/XmlView] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.dispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljavax/servlet/ServletContext;)V == &dispatch
    //#post(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.getContentType()Ljava/lang/String; == &getContentType
    //#post(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model; == &net/sourceforge/pebble/web/view/View.getModel
    //#post(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.getServletContext()Ljavax/servlet/ServletContext; == &net/sourceforge/pebble/web/view/View.getServletContext
    //#post(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.getUri()Ljava/lang/String; == &net/sourceforge/pebble/web/view/JspView.getUri
    //#post(net.sourceforge.pebble.web.view.XmlView__static_init): __Dispatch_Table.prepare()V == &net/sourceforge/pebble/web/view/View.prepare
    //#post(net.sourceforge.pebble.web.view.XmlView__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.XmlView__static_init): __Dispatch_Table.setServletContext(Ljavax/servlet/ServletContext;)V == &net/sourceforge/pebble/web/view/View.setServletContext
    //#xmlview.java:: end of method: net.sourceforge.pebble.web.view.XmlView.net.sourceforge.pebble.web.view.XmlView__static_init
    //#xmlview.java:: end of class: net.sourceforge.pebble.web.view.XmlView
