forked from processing/processing-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethodWriter.java
More file actions
43 lines (34 loc) · 1.16 KB
/
MethodWriter.java
File metadata and controls
43 lines (34 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package writers;
import java.io.IOException;
import java.util.HashMap;
import com.sun.javadoc.MethodDoc;
public class MethodWriter extends BaseWriter {
public MethodWriter(){}
/**
*
*
* @param vars the inherited vars from the method's ClassDoc
* @param doc the method doc
* @throws IOException
*/
public static void write( HashMap<String, String> vars, MethodDoc doc) throws IOException
{
String filename = getAnchor(doc);
TemplateWriter templateWriter = new TemplateWriter();
if(Shared.i().isRootLevel(doc.containingClass())){
vars.put("classname", "");
} else {
vars.put("classanchor", getLocalAnchor(doc.containingClass()));
}
vars.put("examples", getExamples(doc));
vars.put("description", getXMLDescription(doc));
vars.put("name", getName(doc));
String syntax = templateWriter.writeLoop("method.syntax.partial.html", getSyntax(doc, getInstanceName(doc)));
vars.put("syntax", syntax);
vars.put("returns", getReturnTypes(doc));
vars.put("parameters", getParameters(doc));
vars.put("usage", getUsage(doc));
vars.put("related", getRelated(doc));
templateWriter.write("generic.template.html", vars, filename);
}
}