forked from processing/processing-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctionWriter.java
More file actions
37 lines (27 loc) · 1.01 KB
/
FunctionWriter.java
File metadata and controls
37 lines (27 loc) · 1.01 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
package writers;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import com.sun.javadoc.MethodDoc;
public class FunctionWriter extends BaseWriter {
static ArrayList<String> writtenFunctions;
public FunctionWriter(){}
public static void write(MethodDoc doc) throws IOException
{
if( needsWriting(doc)){
String anchor = getAnchor(doc);
TemplateWriter templateWriter = new TemplateWriter();
HashMap<String, String> vars = new HashMap<String, String>();
String syntax = templateWriter.writeLoop("function.syntax.partial.html", getSyntax(doc, ""));
vars.put("examples", getExamples( doc ));
vars.put("description", getXMLDescription(doc));
vars.put("name", doc.name() + "()");
vars.put("syntax", syntax);
vars.put("usage", getUsage(doc));
vars.put("returns", getReturnTypes(doc));
vars.put("parameters", getParameters(doc));
vars.put("related", getRelated(doc));
templateWriter.write("generic.template.html", vars, anchor);
}
}
}