Permalink
Browse files

merge changesets 15261, 15281, 15299 (groovydoc catchup)

git-svn-id: http://svn.codehaus.org/groovy/branches/GROOVY_1_6_0@15302 a5544e8c-8a19-0410-ba12-f9af4593a198
  • Loading branch information...
1 parent aaffe72 commit 66ef14134f9b743e7bd8c032587f8e98e6ba43d6 @paulk-asert paulk-asert committed Feb 8, 2009
Showing with 1,079 additions and 119 deletions.
  1. +1 −1 build.properties
  2. +2 −0 build.xml
  3. +3 −3 src/main/groovy/grape/GrabAnnotationTransformation.java
  4. +2 −6 src/main/groovy/lang/AdaptingMetaClass.java
  5. +3 −3 src/main/groovy/lang/ExpandoMetaClass.java
  6. +2 −2 src/main/groovy/lang/ExpandoMetaClassCreationHandle.java
  7. +1 −1 src/main/groovy/lang/Grapes.java
  8. +0 −3 src/main/groovy/util/ResourceException.java
  9. +0 −3 src/main/groovy/util/ScriptException.java
  10. +83 −2 src/main/org/codehaus/groovy/ant/Groovydoc.java
  11. +3 −0 src/main/org/codehaus/groovy/antlr/java/PreJava2GroovyConverter.java
  12. +3 −3 src/main/org/codehaus/groovy/ast/expr/RangeExpression.java
  13. +2 −1 src/main/org/codehaus/groovy/control/SourceUnit.java
  14. +1 −0 src/main/org/codehaus/groovy/groovydoc/GroovyClassDoc.java
  15. +1 −0 src/main/org/codehaus/groovy/groovydoc/GroovyDoc.java
  16. +34 −0 src/main/org/codehaus/groovy/groovydoc/GroovyTag.java
  17. +8 −0 src/main/org/codehaus/groovy/tools/groovydoc/ExternalGroovyClassDoc.java
  18. +26 −3 src/main/org/codehaus/groovy/tools/groovydoc/GroovyRootDocBuilder.java
  19. +20 −2 src/main/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDoc.java
  20. +22 −8 src/main/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDocAssembler.java
  21. +49 −2 src/main/org/codehaus/groovy/tools/groovydoc/SimpleGroovyDoc.java
  22. +4 −0 src/main/org/codehaus/groovy/tools/groovydoc/SimpleGroovyMemberDoc.java
  23. +9 −0 src/main/org/codehaus/groovy/tools/groovydoc/SimpleGroovyRootDoc.java
  24. +30 −0 src/main/org/codehaus/groovy/tools/groovydoc/SimpleGroovyTag.java
  25. +3 −1 src/main/org/codehaus/groovy/tools/groovydoc/SimpleGroovyType.java
  26. +87 −36 src/main/org/codehaus/groovy/tools/groovydoc/gstring-templates/class-level/classDocName.html
  27. +8 −8 src/main/org/codehaus/groovy/tools/groovydoc/gstring-templates/package-level/package-frame.html
  28. +62 −9 src/main/org/codehaus/groovy/tools/groovydoc/gstring-templates/package-level/package-summary.html
  29. +3 −2 src/main/org/codehaus/groovy/tools/groovydoc/gstring-templates/top-level/allclasses-frame.html
  30. +183 −0 src/main/org/codehaus/groovy/tools/groovydoc/gstring-templates/top-level/deprecated-list.html
  31. +186 −0 src/main/org/codehaus/groovy/tools/groovydoc/gstring-templates/top-level/help-doc.html
  32. +151 −0 src/main/org/codehaus/groovy/tools/groovydoc/gstring-templates/top-level/index-all.html
  33. +1 −3 src/main/org/codehaus/groovy/tools/groovydoc/gstring-templates/top-level/overview-frame.html
  34. +67 −13 src/main/org/codehaus/groovy/tools/groovydoc/gstring-templates/top-level/overview-summary.html
  35. +19 −0 src/main/overview.html
  36. +0 −3 src/test/groovy/lang/GroovyShellTest.java
  37. +0 −1 src/test/org/codehaus/groovy/tools/groovydoc/GroovyDocToolTest.java
View
@@ -18,4 +18,4 @@ groovycTest_mx = 1G
groovycExamples_mx = ${groovycMain_mx}
javaDoc_mx = 512m
-groovyDoc_mx = 512m
+groovyDoc_mx = 640m
View
@@ -855,7 +855,9 @@ Not found: ${groovyJar14path}
use="true"
windowtitle="${title}"
doctitle="${title}"
+ header="${title}"
footer="${docFooter}"
+ overview="src/main/overview.html"
private="false">
<link packages="java.,org.xml.,javax.,org.xml." href="http://java.sun.com/j2se/1.5.0/docs/api"/>
<link packages="org.apache.ant.,org.apache.tools.ant." href="http://www.dpml.net/api/ant/1.7.0"/>
@@ -125,7 +125,7 @@ public void visit(ASTNode[] nodes, SourceUnit source) {
}
}
}
- // don't worry if it's not a ListExpression, aqnd AnnotationConstant, etc.
+ // don't worry if it's not a ListExpression, or AnnotationConstant, etc.
// the rest of GroovyC will flag it as a syntax error later, so we don't
// need to raise the error ourselves
}
@@ -158,7 +158,7 @@ public void visit(ASTNode[] nodes, SourceUnit source) {
"grab",
new ArgumentListExpression(me))));
- // instert at beginning so we have the classlaoder setup before the class is called
+ // insert at beginning so we have the classloader set up before the class is called
classNode.addStaticInitializerStatements(grabInitializers, true);
}
}
@@ -184,7 +184,7 @@ protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor)
}
/**
- * Addes the annotation to the internal target list if a match is found
+ * Adds the annotation to the internal target list if a match is found
* @param node
*/
public void visitAnnotations(AnnotatedNode node) {
@@ -17,14 +17,10 @@
/**
* An interface for MetaClass instances that "adapt" other MetaClass instances such as a proxy or
- * delegating MetaClass
+ * delegating MetaClass.
*
* @author Graeme Rocher
- * @since 1.1
- *
- * <p/>
- * Created: Apr 16, 2007
- * Time: 9:35:42 PM
+ * @since 1.5
*/
public interface AdaptingMetaClass extends MetaClass {
@@ -51,8 +51,9 @@
import java.util.concurrent.ConcurrentHashMap;
/**
- * A MetaClass that implements GroovyObject and behaves like an Expando, allowing the addition of new methods on the fly
+ * A MetaClass that implements GroovyObject and behaves like an Expando, allowing the addition of new methods on the fly.
*
+ * Some examples of usage:
* <code><pre>
* // defines or replaces instance method:
* metaClass.myMethod = { args -> }
@@ -77,7 +78,6 @@
*
* // defines a new property with an initial value of "blah"
* metaClass.myProperty = "blah"
- *
* </code></pre>
*
* By default methods are only allowed to be added before initialize() is called. In other words you create a new
@@ -95,7 +95,7 @@
* for long periods because as soon as the JVM is running low on memory or the thread dies they will be garbage collected.
*
* @author Graeme Rocher
- * @since 1.1
+ * @since 1.5
*/
public class ExpandoMetaClass extends MetaClassImpl implements GroovyObject {
@@ -22,7 +22,7 @@
* <p>A handle for the MetaClassRegistry that changes all classes loaded into the Grails VM
* to use ExpandoMetaClass instances
*
- * <p>The handle should be registered with the Groovy runtime <strong>before</before> Groovy loads, for example
+ * <p>The handle should be registered with the Groovy runtime <strong>before</strong> Groovy loads, for example
* in your main method.
*
* <code>GroovySystem.metaClassRegistry.metaClassCreationHandle = new ExpandoMetaClassCreationHandle()</code>
@@ -32,7 +32,7 @@
* @see org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl#setMetaClassCreationHandle(groovy.lang.MetaClassRegistry.MetaClassCreationHandle)
*
* @author Graeme Rocher
- * @since 1.1
+ * @since 1.5
*/
public class ExpandoMetaClassCreationHandle extends MetaClassCreationHandle {
@@ -34,7 +34,7 @@
/**
* This will be pushed into the child grab annotations if the value is not
- * set in the child annotaiton already.
+ * set in the child annotation already.
*
* This results in an effective change in the default value, which each &#064;Grab
* can still override
@@ -17,9 +17,6 @@
/**
* @author sam
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
*/
public class ResourceException extends Exception {
@@ -18,9 +18,6 @@
/**
* @author sam
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
*/
public class ScriptException extends Exception {
@@ -46,21 +46,31 @@
private String windowTitle = "Groovy Documentation";
private String docTitle = "Groovy Documentation";
private String footer = "Groovy Documentation";
+ private String header = "Groovy Documentation";
private boolean privateScope;
+ private boolean protectedScope;
+ private boolean packageScope;
+ private boolean publicScope;
private boolean useDefaultExcludes;
private boolean includeNoSourcePackages;
+ private boolean author;
private List<DirSet> packageSets;
private List<String> sourceFilesToDoc;
private List<LinkArgument> links = new ArrayList<LinkArgument>();
+ private File overviewFile;
public Groovydoc() {
packageNames = new ArrayList<String>();
excludePackageNames = new ArrayList<String>();
packageSets = new ArrayList<DirSet>();
sourceFilesToDoc = new ArrayList<String>();
privateScope = false;
+ protectedScope = false;
+ publicScope = false;
+ packageScope = false;
useDefaultExcludes = true;
includeNoSourcePackages = false;
+ author = true;
}
/**
@@ -86,6 +96,17 @@ public void setDestdir(File dir) {
// todo: maybe tell groovydoc to use file output
}
+
+ /**
+ * If set to false, author will not be displayed.
+ * Currently not used.
+ *
+ * @param author new value
+ */
+ public void setAuthor(boolean author) {
+ this.author = author;
+ }
+
/**
* Set the package names to be processed.
*
@@ -124,8 +145,17 @@ public void setDoctitle(String htmlTitle) {
}
/**
+ * Specify the file containing the overview to be included in the generated documentation.
+ *
+ * @param file the overview file
+ */
+ public void setOverview(java.io.File file) {
+ overviewFile = file;
+ }
+
+ /**
* Indicate whether all classes and
- * members are to be included in the scope processed
+ * members are to be included in the scope processed.
*
* @param b true if scope is to be private level.
*/
@@ -134,6 +164,36 @@ public void setPrivate(boolean b) {
}
/**
+ * Indicate whether only public classes and members are to be included in the scope processed.
+ * Currently not used.
+ *
+ * @param b true if scope only includes public level classes and members
+ */
+ public void setPublic(boolean b) {
+ publicScope = b;
+ }
+
+ /**
+ * Indicate whether only protected and public classes and members are to be included in the scope processed.
+ * Currently not used.
+ *
+ * @param b true if scope includes protected level classes and members
+ */
+ public void setProtected(boolean b) {
+ protectedScope = b;
+ }
+
+ /**
+ * Indicate whether only package, protected and public classes and members are to be included in the scope processed.
+ * Currently not used.
+ *
+ * @param b true if scope includes package level classes and members
+ */
+ public void setPackage(boolean b) {
+ packageScope = b;
+ }
+
+ /**
* Set the footer to place at the bottom of each generated html page.
*
* @param footer the footer value
@@ -143,6 +203,19 @@ public void setFooter(String footer) {
}
/**
+ * Specifies the header text to be placed at the top of each output file.
+ * The header will be placed to the right of the upper navigation bar.
+ * It may contain HTML tags and white space, though if it does, it must
+ * be enclosed in quotes. Any internal quotation marks within the header
+ * may have to be escaped.
+ *
+ * @param header the header value
+ */
+ public void setHeader(String header) {
+ this.header = header;
+ }
+
+ /**
* Add the directories matched by the nested dirsets to the resulting
* packages list and the base directories of the dirsets to the Path.
* It also handles the packages and excludepackages attributes and
@@ -254,7 +327,13 @@ public void execute() throws BuildException {
properties.put("windowTitle", windowTitle);
properties.put("docTitle", docTitle);
properties.put("footer", footer);
+ properties.put("header", header);
properties.put("privateScope", privateScope);
+ properties.put("protectedScope", protectedScope);
+ properties.put("publicScope", publicScope);
+ properties.put("packageScope", packageScope);
+ properties.put("author", author);
+ properties.put("overviewFile", overviewFile != null ? overviewFile.getAbsolutePath() : "");
if (sourcePath != null) {
sourceDirs.addExisting(sourcePath);
@@ -269,6 +348,9 @@ public void execute() throws BuildException {
TEMPLATE_BASEDIR + "top-level/overview-frame.html", // needs all package names
TEMPLATE_BASEDIR + "top-level/allclasses-frame.html", // needs all packages / class names
TEMPLATE_BASEDIR + "top-level/overview-summary.html", // needs all packages
+ TEMPLATE_BASEDIR + "top-level/help-doc.html",
+ TEMPLATE_BASEDIR + "top-level/index-all.html",
+ TEMPLATE_BASEDIR + "top-level/deprecated-list.html",
TEMPLATE_BASEDIR + "top-level/stylesheet.css",
TEMPLATE_BASEDIR + "top-level/inherit.gif",
},
@@ -302,5 +384,4 @@ public LinkArgument createLink() {
links.add(result);
return result;
}
-
}
@@ -45,7 +45,10 @@ private void visitJavaLiteralDo(GroovySourceAST t) {
// todo - incomplete, as body of do...while... should be executed at least once, which this doesn't provide.
swapTwoChildren(t);
}
+
/**
+ * Handle Arrays. Examples:
+ *
* <pre>
* String[] myArray = new String[] {"a","b","c"};
*
@@ -18,9 +18,9 @@
import org.codehaus.groovy.ast.GroovyCodeVisitor;
/**
- * Represents a range expression such as for iterating
- * <pre>for i in 0..10 {...}
- * </pre>
+ * Represents a range expression such as for iterating.
+ * E.g.:
+ * <pre>for i in 0..10 {...}</pre>
*
* @author <a href="mailto:james@coredevelopers.net">James Strachan</a>
* @version $Revision$
@@ -72,7 +72,8 @@
/**
* A descriptive name of the source unit. This name shouldn't
* be used for controlling the SourceUnit, it is only for error
- * messages
+ * messages and to determine the name of the class for
+ * a script.
*/
protected String name;
@@ -21,6 +21,7 @@
boolean definesSerializableFields();
GroovyFieldDoc[] enumConstants();
GroovyFieldDoc[] fields();
+ GroovyFieldDoc[] properties();
GroovyFieldDoc[] fields(boolean filter);
GroovyClassDoc findClass(String className);
GroovyClassDoc[] importedClasses();
@@ -25,6 +25,7 @@
boolean isAnnotationTypeElement();
boolean isClass();
boolean isConstructor();
+ boolean isDeprecated();
boolean isEnum();
boolean isEnumConstant();
boolean isError();
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2003-2009 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.groovy.groovydoc;
+
+public interface GroovyTag {
+
+ /**
+ * The tag name, e.g. "deprecated", "param", "see" or "author".
+ */
+ String name();
+
+ /**
+ * The optional parameter for tags like "throws" and "param".
+ */
+ String param();
+
+ /**
+ * The text associated with the tag.
+ */
+ String text();
+}
@@ -105,6 +105,10 @@ public boolean definesSerializableFields() {
return new GroovyFieldDoc[0];
}
+ public GroovyFieldDoc[] properties() {
+ return new GroovyFieldDoc[0];
+ }
+
public GroovyFieldDoc[] fields(boolean filter) {
return new GroovyFieldDoc[0];
}
@@ -245,6 +249,10 @@ public boolean isConstructor() {
return false;
}
+ public boolean isDeprecated() {
+ return false;
+ }
+
public boolean isEnum() {
return false;
}
Oops, something went wrong.

0 comments on commit 66ef141

Please sign in to comment.