<!--

     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
     regarding copyright ownership.  The ASF licenses this file
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.

-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>${packageDoc.nameWithDots()}</title>
    <%
    // TODO enable errors(), enums() etc in SimpleGroovyPackageDoc then replace closures below
    def classTypes = [
    "Interface" : { it.isInterface() },
    "Trait" : { it.isTrait() },
    "Class" : { it.isClass() && !it.parentClasses*.qualifiedTypeName().contains('java.lang.Throwable') },
    "Enum" : { it.isEnum() },
    "Exception" : { it.isClass() && it.parentClasses*.qualifiedTypeName().contains('java.lang.Exception') },
    "Error" : { it.isClass() && it.parentClasses*.qualifiedTypeName().contains('java.lang.Error') },
    "Annotation Type" : { it.isAnnotationType() },
    "Script" : { it.isScript() }
    ]
    def pluralize = { name -> name + (name.endsWith("s") ? "es" : "s") }
    %>
    <meta http-equiv="Content-Type" content="text/html; charset=${props.charset}">
    <meta name="keywords" CONTENT="${packageDoc.name()} package">

    <link href="groovy.ico" type="image/x-icon" rel="shortcut icon">
    <link href="groovy.ico" type="image/x-icon" rel="icon">
    <link rel="stylesheet" type="text/css" href="${packageDoc.relativeRootPath}stylesheet.css" title="Style">
<% if (props.additionalStylesheets) props.additionalStylesheets.tokenize(',').each { __ss -> %>
    <link rel="stylesheet" type="text/css" href="${packageDoc.relativeRootPath}${__ss.trim()}">
<% } %>
</head>

<body class="left">
<div class="indexHeader">
    <b><a href="package-summary.html" target="classFrame">${packageDoc.nameWithDots()}</a></b>
</div>

<%
def isVisible = { it.isPublic() || (it.isProtected() && props.protectedScope == 'true') || (!it.isProtected() && !it.isPrivate() && props.packageScope == 'true') || props.privateScope == 'true' }
classTypes.each { k, v ->
if (packageDoc.allClasses().any{ isVisible(it) && v(it) }) {
%>

<div class="indexContainer">
    <h2>${pluralize(k)}</h2>
    <ul>
        <%
        for (classDoc in packageDoc.allClasses().findAll{ isVisible(it) && v(it) }) {
        %><li><a href="${classDoc.name()}.html" title="${k.toLowerCase()} in ${packageDoc.nameWithDots()}" target="classFrame"><%
        if (classDoc.isInterface() || classDoc.isTrait()) { %><em><% }
            %>${classDoc.name()}<%
            if (classDoc.isInterface() || classDoc.isTrait()) { %></em><% }
        %></a></li><%
        }
        %>
    </ul>
</div>
<% } %>
<% } %>

</body>
</html>
