//# 0 errors, 159 messages
//#
/*
    //#availableplugins.java:1:1: class: net.sourceforge.pebble.plugins.AvailablePlugins
    //#availableplugins.java:1:1: method: net.sourceforge.pebble.plugins.AvailablePlugins.net.sourceforge.pebble.plugins.AvailablePlugins__static_init
 * Copyright (c) 2003-2005, 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.plugins;

import java.util.*;

/**
 * @author James Roper
 */
public class AvailablePlugins {
  public static final String PERMALINK_PROVIDER = "permalink-provider";
  public static final String CONTENT_DECORATOR = "content-decorator";
  public static final String BLOG_LISTENER = "blog-listener";
  public static final String BLOG_ENTRY_LISTENER = "blog-entry-listener";
  public static final String COMMENT_LISTENER = "comment-listener";
  public static final String COMMENT_CONFIRMATION_STRATEGY = "comment-confirmation-strategy";
  public static final String TRACKBACK_LISTENER = "trackback-listener";
  public static final String TRACKBACK_CONFIRMATION_STRATEGY = "trackback-confirmation-strategy";
  public static final String LUCENCE_ANALYZER = "lucene-analyzer";
  public static final String LOGGER = "logger";

  private final Map<String, List<Plugin>> plugins;

  public Map<String, List<Plugin>> copyMap()
  {
    Map<String, List<Plugin>> map = new HashMap<String, List<Plugin>>();
    //#availableplugins.java:55: method: Map net.sourceforge.pebble.plugins.AvailablePlugins.copyMap()
    //#input(Map copyMap()): this
    //#input(Map copyMap()): this.plugins
    //#output(Map copyMap()): new HashMap(copyMap#1) num objects
    //#output(Map copyMap()): return_value
    //#new obj(Map copyMap()): new HashMap(copyMap#1)
    //#pre[2] (Map copyMap()): this.plugins != null
    //#presumption(Map copyMap()): java.util.Iterator:next(...)@56 != null
    //#presumption(Map copyMap()): java.util.Map:entrySet(...)@56 != null
    //#post(Map copyMap()): return_value == &new HashMap(copyMap#1)
    //#post(Map copyMap()): new HashMap(copyMap#1) num objects == 1
    //#test_vector(Map copyMap()): java.util.Iterator:hasNext(...)@56: {1}, {0}
    for (Map.Entry<String, List<Plugin>> entry : plugins.entrySet())
    {
      map.put(entry.getKey(), new ArrayList<Plugin>(entry.getValue()));
    }
    return map;
    //#availableplugins.java:60: end of method: Map net.sourceforge.pebble.plugins.AvailablePlugins.copyMap()
  }

  public AvailablePlugins(Map<String, List<Plugin>> plugins) {
    //#availableplugins.java:63: method: void net.sourceforge.pebble.plugins.AvailablePlugins.net.sourceforge.pebble.plugins.AvailablePlugins(Map)
    //#input(void net.sourceforge.pebble.plugins.AvailablePlugins(Map)): plugins
    //#input(void net.sourceforge.pebble.plugins.AvailablePlugins(Map)): this
    //#output(void net.sourceforge.pebble.plugins.AvailablePlugins(Map)): this.plugins
    //#post(void net.sourceforge.pebble.plugins.AvailablePlugins(Map)): this.plugins == plugins
    //#post(void net.sourceforge.pebble.plugins.AvailablePlugins(Map)): init'ed(this.plugins)
    this.plugins = plugins;
  }
    //#availableplugins.java:65: end of method: void net.sourceforge.pebble.plugins.AvailablePlugins.net.sourceforge.pebble.plugins.AvailablePlugins(Map)

  public Collection<Plugin> getPermalinkProviders() {
    return getEmptyIfNull(PERMALINK_PROVIDER);
    //#availableplugins.java:68: method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getPermalinkProviders()
    //#input(Collection getPermalinkProviders()): this
    //#input(Collection getPermalinkProviders()): this.plugins
    //#output(Collection getPermalinkProviders()): return_value
    //#pre[2] (Collection getPermalinkProviders()): this.plugins != null
    //#post(Collection getPermalinkProviders()): init'ed(return_value)
    //#unanalyzed(Collection getPermalinkProviders()): Effects-of-calling:java.util.Map:get
    //#unanalyzed(Collection getPermalinkProviders()): Effects-of-calling:java.util.Collections:emptyList
    //#unanalyzed(Collection getPermalinkProviders()): Effects-of-calling:java.util.Collections:unmodifiableCollection
    //#availableplugins.java:68: end of method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getPermalinkProviders()
  }

  public Collection<Plugin> getContentDecorators() {
    return getEmptyIfNull(CONTENT_DECORATOR);
    //#availableplugins.java:72: method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getContentDecorators()
    //#input(Collection getContentDecorators()): this
    //#input(Collection getContentDecorators()): this.plugins
    //#output(Collection getContentDecorators()): return_value
    //#pre[2] (Collection getContentDecorators()): this.plugins != null
    //#post(Collection getContentDecorators()): init'ed(return_value)
    //#unanalyzed(Collection getContentDecorators()): Effects-of-calling:java.util.Map:get
    //#unanalyzed(Collection getContentDecorators()): Effects-of-calling:java.util.Collections:emptyList
    //#unanalyzed(Collection getContentDecorators()): Effects-of-calling:java.util.Collections:unmodifiableCollection
    //#availableplugins.java:72: end of method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getContentDecorators()
  }

  public Collection<Plugin> getBlogListeners() {
    return getEmptyIfNull(BLOG_LISTENER);
    //#availableplugins.java:76: method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getBlogListeners()
    //#input(Collection getBlogListeners()): this
    //#input(Collection getBlogListeners()): this.plugins
    //#output(Collection getBlogListeners()): return_value
    //#pre[2] (Collection getBlogListeners()): this.plugins != null
    //#post(Collection getBlogListeners()): init'ed(return_value)
    //#unanalyzed(Collection getBlogListeners()): Effects-of-calling:java.util.Map:get
    //#unanalyzed(Collection getBlogListeners()): Effects-of-calling:java.util.Collections:emptyList
    //#unanalyzed(Collection getBlogListeners()): Effects-of-calling:java.util.Collections:unmodifiableCollection
    //#availableplugins.java:76: end of method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getBlogListeners()
  }

  public Collection<Plugin> getBlogEntryListeners() {
    return getEmptyIfNull(BLOG_ENTRY_LISTENER);
    //#availableplugins.java:80: method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getBlogEntryListeners()
    //#input(Collection getBlogEntryListeners()): this
    //#input(Collection getBlogEntryListeners()): this.plugins
    //#output(Collection getBlogEntryListeners()): return_value
    //#pre[2] (Collection getBlogEntryListeners()): this.plugins != null
    //#post(Collection getBlogEntryListeners()): init'ed(return_value)
    //#unanalyzed(Collection getBlogEntryListeners()): Effects-of-calling:java.util.Map:get
    //#unanalyzed(Collection getBlogEntryListeners()): Effects-of-calling:java.util.Collections:emptyList
    //#unanalyzed(Collection getBlogEntryListeners()): Effects-of-calling:java.util.Collections:unmodifiableCollection
    //#availableplugins.java:80: end of method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getBlogEntryListeners()
  }

  public Collection<Plugin> getCommentListeners() {
    return getEmptyIfNull(COMMENT_LISTENER);
    //#availableplugins.java:84: method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getCommentListeners()
    //#input(Collection getCommentListeners()): this
    //#input(Collection getCommentListeners()): this.plugins
    //#output(Collection getCommentListeners()): return_value
    //#pre[2] (Collection getCommentListeners()): this.plugins != null
    //#post(Collection getCommentListeners()): init'ed(return_value)
    //#unanalyzed(Collection getCommentListeners()): Effects-of-calling:java.util.Map:get
    //#unanalyzed(Collection getCommentListeners()): Effects-of-calling:java.util.Collections:emptyList
    //#unanalyzed(Collection getCommentListeners()): Effects-of-calling:java.util.Collections:unmodifiableCollection
    //#availableplugins.java:84: end of method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getCommentListeners()
  }

  public Collection<Plugin> getCommentConfirmationStrategies() {
    return getEmptyIfNull(COMMENT_CONFIRMATION_STRATEGY);
    //#availableplugins.java:88: method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getCommentConfirmationStrategies()
    //#input(Collection getCommentConfirmationStrategies()): this
    //#input(Collection getCommentConfirmationStrategies()): this.plugins
    //#output(Collection getCommentConfirmationStrategies()): return_value
    //#pre[2] (Collection getCommentConfirmationStrategies()): this.plugins != null
    //#post(Collection getCommentConfirmationStrategies()): init'ed(return_value)
    //#unanalyzed(Collection getCommentConfirmationStrategies()): Effects-of-calling:java.util.Map:get
    //#unanalyzed(Collection getCommentConfirmationStrategies()): Effects-of-calling:java.util.Collections:emptyList
    //#unanalyzed(Collection getCommentConfirmationStrategies()): Effects-of-calling:java.util.Collections:unmodifiableCollection
    //#availableplugins.java:88: end of method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getCommentConfirmationStrategies()
  }

  public Collection<Plugin> getTrackbackListeners() {
    return getEmptyIfNull(TRACKBACK_LISTENER);
    //#availableplugins.java:92: method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getTrackbackListeners()
    //#input(Collection getTrackbackListeners()): this
    //#input(Collection getTrackbackListeners()): this.plugins
    //#output(Collection getTrackbackListeners()): return_value
    //#pre[2] (Collection getTrackbackListeners()): this.plugins != null
    //#post(Collection getTrackbackListeners()): init'ed(return_value)
    //#unanalyzed(Collection getTrackbackListeners()): Effects-of-calling:java.util.Map:get
    //#unanalyzed(Collection getTrackbackListeners()): Effects-of-calling:java.util.Collections:emptyList
    //#unanalyzed(Collection getTrackbackListeners()): Effects-of-calling:java.util.Collections:unmodifiableCollection
    //#availableplugins.java:92: end of method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getTrackbackListeners()
  }

  public Collection<Plugin> getTrackbackConfirmationStrategies() {
    return getEmptyIfNull(TRACKBACK_CONFIRMATION_STRATEGY);
    //#availableplugins.java:96: method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getTrackbackConfirmationStrategies()
    //#input(Collection getTrackbackConfirmationStrategies()): this
    //#input(Collection getTrackbackConfirmationStrategies()): this.plugins
    //#output(Collection getTrackbackConfirmationStrategies()): return_value
    //#pre[2] (Collection getTrackbackConfirmationStrategies()): this.plugins != null
    //#post(Collection getTrackbackConfirmationStrategies()): init'ed(return_value)
    //#unanalyzed(Collection getTrackbackConfirmationStrategies()): Effects-of-calling:java.util.Map:get
    //#unanalyzed(Collection getTrackbackConfirmationStrategies()): Effects-of-calling:java.util.Collections:emptyList
    //#unanalyzed(Collection getTrackbackConfirmationStrategies()): Effects-of-calling:java.util.Collections:unmodifiableCollection
    //#availableplugins.java:96: end of method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getTrackbackConfirmationStrategies()
  }

  public Collection<Plugin> getLuceneAnalyzers() {
    return getEmptyIfNull(LUCENCE_ANALYZER);
    //#availableplugins.java:100: method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getLuceneAnalyzers()
    //#input(Collection getLuceneAnalyzers()): this
    //#input(Collection getLuceneAnalyzers()): this.plugins
    //#output(Collection getLuceneAnalyzers()): return_value
    //#pre[2] (Collection getLuceneAnalyzers()): this.plugins != null
    //#post(Collection getLuceneAnalyzers()): init'ed(return_value)
    //#unanalyzed(Collection getLuceneAnalyzers()): Effects-of-calling:java.util.Map:get
    //#unanalyzed(Collection getLuceneAnalyzers()): Effects-of-calling:java.util.Collections:emptyList
    //#unanalyzed(Collection getLuceneAnalyzers()): Effects-of-calling:java.util.Collections:unmodifiableCollection
    //#availableplugins.java:100: end of method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getLuceneAnalyzers()
  }

  public Collection<Plugin> getLoggers() {
    return getEmptyIfNull(LOGGER);
    //#availableplugins.java:104: method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getLoggers()
    //#input(Collection getLoggers()): this
    //#input(Collection getLoggers()): this.plugins
    //#output(Collection getLoggers()): return_value
    //#pre[2] (Collection getLoggers()): this.plugins != null
    //#post(Collection getLoggers()): init'ed(return_value)
    //#unanalyzed(Collection getLoggers()): Effects-of-calling:java.util.Map:get
    //#unanalyzed(Collection getLoggers()): Effects-of-calling:java.util.Collections:emptyList
    //#unanalyzed(Collection getLoggers()): Effects-of-calling:java.util.Collections:unmodifiableCollection
    //#availableplugins.java:104: end of method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getLoggers()
  }

  private Collection<Plugin> getEmptyIfNull(String key) {
    Collection<Plugin> list = plugins.get(key);
    //#availableplugins.java:108: method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getEmptyIfNull(String)
    //#input(Collection getEmptyIfNull(String)): key
    //#input(Collection getEmptyIfNull(String)): this
    //#input(Collection getEmptyIfNull(String)): this.plugins
    //#output(Collection getEmptyIfNull(String)): return_value
    //#pre[3] (Collection getEmptyIfNull(String)): this.plugins != null
    //#post(Collection getEmptyIfNull(String)): init'ed(return_value)
    //#test_vector(Collection getEmptyIfNull(String)): java.util.Map:get(...)@108: Inverse{null}, Addr_Set{null}
    if (list == null) {
      return Collections.emptyList();
    }
    else {
      return Collections.unmodifiableCollection(list);
    //#availableplugins.java:113: end of method: Collection net.sourceforge.pebble.plugins.AvailablePlugins.getEmptyIfNull(String)
    }
  }

}
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Descendant_Table[net/sourceforge/pebble/plugins/AvailablePlugins]
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.copyMap()Ljava/util/Map;
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getBlogEntryListeners()Ljava/util/Collection;
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getBlogListeners()Ljava/util/Collection;
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getCommentConfirmationStrategies()Ljava/util/Collection;
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getCommentListeners()Ljava/util/Collection;
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getContentDecorators()Ljava/util/Collection;
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getEmptyIfNull(Ljava/lang/String;)Ljava/util/Collection;
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getLoggers()Ljava/util/Collection;
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getLuceneAnalyzers()Ljava/util/Collection;
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getPermalinkProviders()Ljava/util/Collection;
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getTrackbackConfirmationStrategies()Ljava/util/Collection;
    //#output(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getTrackbackListeners()Ljava/util/Collection;
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Descendant_Table[net/sourceforge/pebble/plugins/AvailablePlugins] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.copyMap()Ljava/util/Map; == &copyMap
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getBlogEntryListeners()Ljava/util/Collection; == &getBlogEntryListeners
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getBlogListeners()Ljava/util/Collection; == &getBlogListeners
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getCommentConfirmationStrategies()Ljava/util/Collection; == &getCommentConfirmationStrategies
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getCommentListeners()Ljava/util/Collection; == &getCommentListeners
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getContentDecorators()Ljava/util/Collection; == &getContentDecorators
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getEmptyIfNull(Ljava/lang/String;)Ljava/util/Collection; == &getEmptyIfNull
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getLoggers()Ljava/util/Collection; == &getLoggers
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getLuceneAnalyzers()Ljava/util/Collection; == &getLuceneAnalyzers
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getPermalinkProviders()Ljava/util/Collection; == &getPermalinkProviders
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getTrackbackConfirmationStrategies()Ljava/util/Collection; == &getTrackbackConfirmationStrategies
    //#post(net.sourceforge.pebble.plugins.AvailablePlugins__static_init): __Dispatch_Table.getTrackbackListeners()Ljava/util/Collection; == &getTrackbackListeners
    //#availableplugins.java:: end of method: net.sourceforge.pebble.plugins.AvailablePlugins.net.sourceforge.pebble.plugins.AvailablePlugins__static_init
    //#availableplugins.java:: end of class: net.sourceforge.pebble.plugins.AvailablePlugins
