//# 0 errors, 66 messages
//#
/*
    //#renderpluginconfigtag.java:1:1: class: net.sourceforge.pebble.web.tagext.RenderPluginConfigTag
    //#renderpluginconfigtag.java:1:1: method: net.sourceforge.pebble.web.tagext.RenderPluginConfigTag.net.sourceforge.pebble.web.tagext.RenderPluginConfigTag__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.tagext;

import net.sourceforge.pebble.plugins.Plugin;
import net.sourceforge.pebble.plugins.PluginConfig;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.Properties;

/**
 * Given a Collection or array, this tag produces a HTML select (dropdown) list
 * based upon the items contained within.
 *
 * @author    Simon Brown
 */
public class RenderPluginConfigTag extends TagSupport {
    //#renderpluginconfigtag.java:54: method: void net.sourceforge.pebble.web.tagext.RenderPluginConfigTag.net.sourceforge.pebble.web.tagext.RenderPluginConfigTag()
    //#input(void net.sourceforge.pebble.web.tagext.RenderPluginConfigTag()): this
    //#renderpluginconfigtag.java:54: end of method: void net.sourceforge.pebble.web.tagext.RenderPluginConfigTag.net.sourceforge.pebble.web.tagext.RenderPluginConfigTag()

  /** the plugin config to render */
  private PluginConfig pluginConfig;

  /** The current value of the plugin config item */
  private Properties properties;

  /**
   * Called when the starting tag is encountered.
   */
  public int doStartTag() throws JspException {
    try
    {
      pluginConfig.getType().render(pageContext.getOut(), pluginConfig,
    //#renderpluginconfigtag.java:68: method: int net.sourceforge.pebble.web.tagext.RenderPluginConfigTag.doStartTag()
    //#renderpluginconfigtag.java:68: Warning: method not available
    //#    -- call on void render(JspWriter, PluginConfig, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.tagext.RenderPluginConfigTag
    //#    method: int doStartTag()
    //#    unanalyzed callee: void render(JspWriter, PluginConfig, String)
    //#renderpluginconfigtag.java:68: Warning: suspicious precondition
    //#    the precondition for this.pluginConfig.type.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: net.sourceforge.pebble.web.tagext.RenderPluginConfigTag
    //#    method: int doStartTag()
    //#    suspicious precondition index: [7]
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/CheckboxPluginConfigType.__Dispatch_Table.render(Ljavax/servlet/jsp/JspWriter;Lnet/sourceforge/pebble/plugins/PluginConfig;Ljava/lang/String;)V
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PasswordPluginConfigType.__Dispatch_Table.render(Ljavax/servlet/jsp/JspWriter;Lnet/sourceforge/pebble/plugins/PluginConfig;Ljava/lang/String;)V
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PlainTextPluginConfigType.__Dispatch_Table.render(Ljavax/servlet/jsp/JspWriter;Lnet/sourceforge/pebble/plugins/PluginConfig;Ljava/lang/String;)V
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PluginConfig.__Descendant_Table[net/sourceforge/pebble/plugins/PluginConfig]
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PluginConfig.__Descendant_Table[others]
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PluginConfig.__Dispatch_Table.getKey()Ljava/lang/String;
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PluginConfig.__Dispatch_Table.getType()Lnet/sourceforge/pebble/plugins/PluginConfigType;
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PluginConfigType.__Descendant_Table[net/sourceforge/pebble/plugins/CheckboxPluginConfigType]
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PluginConfigType.__Descendant_Table[net/sourceforge/pebble/plugins/PasswordPluginConfigType]
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PluginConfigType.__Descendant_Table[net/sourceforge/pebble/plugins/PlainTextPluginConfigType]
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PluginConfigType.__Descendant_Table[net/sourceforge/pebble/plugins/PluginConfigType]
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PluginConfigType.__Descendant_Table[net/sourceforge/pebble/plugins/TextAreaPluginConfigType]
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PluginConfigType.__Descendant_Table[others]
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/PluginConfigType.__Dispatch_Table.render(Ljavax/servlet/jsp/JspWriter;Lnet/sourceforge/pebble/plugins/PluginConfig;Ljava/lang/String;)V
    //#input(int doStartTag()): net/sourceforge/pebble/plugins/TextAreaPluginConfigType.__Dispatch_Table.render(Ljavax/servlet/jsp/JspWriter;Lnet/sourceforge/pebble/plugins/PluginConfig;Ljava/lang/String;)V
    //#input(int doStartTag()): this
    //#input(int doStartTag()): this.pageContext
    //#input(int doStartTag()): this.pluginConfig
    //#input(int doStartTag()): this.pluginConfig.__Tag
    //#input(int doStartTag()): this.pluginConfig.key
    //#input(int doStartTag()): this.pluginConfig.type
    //#input(int doStartTag()): this.pluginConfig.type.__Tag
    //#input(int doStartTag()): this.properties
    //#output(int doStartTag()): return_value
    //#pre[2] (int doStartTag()): this.pageContext != null
    //#pre[3] (int doStartTag()): this.pluginConfig != null
    //#pre[4] (int doStartTag()): this.pluginConfig.__Tag == net/sourceforge/pebble/plugins/PluginConfig
    //#pre[6] (int doStartTag()): this.pluginConfig.type != null
    //#pre[7] (int doStartTag()): this.pluginConfig.type.__Tag in {net/sourceforge/pebble/plugins/CheckboxPluginConfigType, net/sourceforge/pebble/plugins/PasswordPluginConfigType, net/sourceforge/pebble/plugins/PlainTextPluginConfigType, net/sourceforge/pebble/plugins/PluginConfigType, net/sourceforge/pebble/plugins/TextAreaPluginConfigType}
    //#pre[8] (int doStartTag()): this.properties != null
    //#presumption(int doStartTag()): javax.servlet.jsp.PageContext:getOut(...)@68 != null
    //#post(int doStartTag()): return_value == 0
    //#unanalyzed(int doStartTag()): Effects-of-calling:javax.servlet.jsp.JspWriter:print
              properties.getProperty(pluginConfig.getKey()));
    }
    catch (IOException ioe)
    {
      throw new JspException(ioe);
    }
    // and skip the body
    return SKIP_BODY;
    //#renderpluginconfigtag.java:76: end of method: int net.sourceforge.pebble.web.tagext.RenderPluginConfigTag.doStartTag()
  }

  public void setPluginConfig(PluginConfig pluginConfig) {
    this.pluginConfig = pluginConfig;
    //#renderpluginconfigtag.java:80: method: void net.sourceforge.pebble.web.tagext.RenderPluginConfigTag.setPluginConfig(PluginConfig)
    //#input(void setPluginConfig(PluginConfig)): pluginConfig
    //#input(void setPluginConfig(PluginConfig)): this
    //#output(void setPluginConfig(PluginConfig)): this.pluginConfig
    //#post(void setPluginConfig(PluginConfig)): this.pluginConfig == pluginConfig
    //#post(void setPluginConfig(PluginConfig)): init'ed(this.pluginConfig)
  }
    //#renderpluginconfigtag.java:81: end of method: void net.sourceforge.pebble.web.tagext.RenderPluginConfigTag.setPluginConfig(PluginConfig)

  public void setProperties(Properties properties) {
    this.properties = properties;
    //#renderpluginconfigtag.java:84: method: void net.sourceforge.pebble.web.tagext.RenderPluginConfigTag.setProperties(Properties)
    //#input(void setProperties(Properties)): properties
    //#input(void setProperties(Properties)): this
    //#output(void setProperties(Properties)): this.properties
    //#post(void setProperties(Properties)): this.properties == properties
    //#post(void setProperties(Properties)): init'ed(this.properties)
  }
    //#renderpluginconfigtag.java:85: end of method: void net.sourceforge.pebble.web.tagext.RenderPluginConfigTag.setProperties(Properties)
}    //#output(net.sourceforge.pebble.web.tagext.RenderPluginConfigTag__static_init): __Descendant_Table[net/sourceforge/pebble/web/tagext/RenderPluginConfigTag]
    //#output(net.sourceforge.pebble.web.tagext.RenderPluginConfigTag__static_init): __Dispatch_Table.doStartTag()I
    //#output(net.sourceforge.pebble.web.tagext.RenderPluginConfigTag__static_init): __Dispatch_Table.setPluginConfig(Lnet/sourceforge/pebble/plugins/PluginConfig;)V
    //#output(net.sourceforge.pebble.web.tagext.RenderPluginConfigTag__static_init): __Dispatch_Table.setProperties(Ljava/util/Properties;)V
    //#post(net.sourceforge.pebble.web.tagext.RenderPluginConfigTag__static_init): __Descendant_Table[net/sourceforge/pebble/web/tagext/RenderPluginConfigTag] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.tagext.RenderPluginConfigTag__static_init): __Dispatch_Table.doStartTag()I == &doStartTag
    //#post(net.sourceforge.pebble.web.tagext.RenderPluginConfigTag__static_init): __Dispatch_Table.setPluginConfig(Lnet/sourceforge/pebble/plugins/PluginConfig;)V == &setPluginConfig
    //#post(net.sourceforge.pebble.web.tagext.RenderPluginConfigTag__static_init): __Dispatch_Table.setProperties(Ljava/util/Properties;)V == &setProperties
    //#renderpluginconfigtag.java:: end of method: net.sourceforge.pebble.web.tagext.RenderPluginConfigTag.net.sourceforge.pebble.web.tagext.RenderPluginConfigTag__static_init
    //#renderpluginconfigtag.java:: end of class: net.sourceforge.pebble.web.tagext.RenderPluginConfigTag
