Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2003-2010 the original author or authors.
   *
   * Licensed 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.
  */
 
 package org.codehaus.gmavenplus.groovyworkarounds;
 
This class was taken mostly from the Groovy project (GroovyDocTemplateInfo.java and GroovyDoc.java) because it wasn't available prior to Groovy 1.7.
 
 public class GroovyDocTemplateInfo {

    
Base directory of document generation classes.
 
     protected static final String DOCGEN_BASEDIR = "org/codehaus/groovy/tools/";

    
Groovy 1.6.2 version.
 
     protected static final Version GROOVY_1_6_2 = new Version(1, 6, 2);

    
Groovy 1.6.0 version.
 
     protected static final Version GROOVY_1_6_0 = new Version(1, 6, 0);

    
Groovy 1.6.0 RC-2 version.
 
     protected static final Version GROOVY_1_6_0_RC2 = new Version(1, 6, 0, "RC-2");

    
The version of Groovy whose locations to use for Groovydoc templates.
 
     protected Version groovyVersion;

    
Base directory of templates.
 
     protected String templateBaseDir;

    
Constructs a new GroovyDocTemplateInfo using the specified Groovy version to determine templates location.

Parameters:
version the version of Groovy whose locations to use for templates
 
     public GroovyDocTemplateInfo(Version version) {
          = version;
         if (.compareTo() >= 0) {
              = "org/codehaus/groovy/tools/groovydoc/gstringTemplates/";
         } else {
              = "org/codehaus/groovy/tools/groovydoc/gstring-templates/";
         }
     }
 
     public String[] defaultDocTemplates() {
         if (.compareTo() >= 0) {
             return new String[] {
                      + "topLevel/index.html",
                      + "topLevel/overview-frame.html",
                      + "topLevel/allclasses-frame.html",
                      + "topLevel/overview-summary.html",
                      + "topLevel/help-doc.html",
                      + "topLevel/index-all.html",
                      + "topLevel/deprecated-list.html",
                      + "topLevel/stylesheet.css",
                      + "topLevel/inherit.gif",
                      + "groovy.ico"
             };
         } else if (.compareTo() >= 0) {
             return new String[] {
                      + "top-level/index.html",
                      + "top-level/overview-frame.html",
                      + "top-level/allclasses-frame.html",
                      + "top-level/overview-summary.html",
                      + "top-level/help-doc.html",
                      + "top-level/index-all.html",
                      + "top-level/deprecated-list.html",
                      + "top-level/stylesheet.css",
                      + "top-level/inherit.gif"
             };
        } else if (.compareTo() >= 0) {
            return new String[] {
                     + "top-level/index.html",
                     + "top-level/overview-frame.html",
                     + "top-level/allclasses-frame.html",
                     + "top-level/overview-summary.html",
                     + "top-level/stylesheet.css",
                     + "top-level/inherit.gif"
            };
        } else {
            return new String[] {
                     + "top-level/index.html",
                     + "top-level/overview-frame.html",
                     + "top-level/allclasses-frame.html",
                     + "top-level/overview-summary.html",
                     + "top-level/stylesheet.css"
            };
        }
    }
    public String[] defaultPackageTemplates() {
        if (.compareTo() >= 0) {
            return new String[] {
                     + "packageLevel/package-frame.html",
                     + "packageLevel/package-summary.html"
            };
        } else {
            return new String[] {
                     + "package-level/package-frame.html",
                     + "package-level/package-summary.html"
            };
        }
    }
    public String[] defaultClassTemplates() {
        if (.compareTo() >= 0) {
            return new String[] {
                     + "classLevel/classDocName.html"
            };
        } else {
            return new String[] {
                     + "class-level/classDocName.html"
            };
        }
    }
New to GrepCode? Check out our FAQ X