Skip to content

Commit

Permalink
fix some javadoc, remove unnecessary empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
darkv committed Aug 1, 2012
1 parent 0b80751 commit 7c3ba8a
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 58 deletions.
27 changes: 16 additions & 11 deletions Build/taglets/AbstractTaglet.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import java.util.Map;

/**
* Abstract Taglet class for our binding and D2W keys
* Abstract Taglet class for our binding and D2W keys.
*
* @author ak
*/

public abstract class AbstractTaglet implements Taglet {

public abstract String getName();
public abstract String getName();

public abstract String getHeader();

public boolean inField() {
Expand Down Expand Up @@ -43,17 +43,20 @@ public boolean isInlineTag() {
/**
* Given the <code>Tag</code> representation of this custom
* tag, return its string representation.
* @param tag the <code>Tag</code> representation of this custom tag.
*
* @param tag
* the <code>Tag</code> representation of this custom tag
* @return string representation of the <code>Tag</code>
*/
public String toString(Tag tag) {
return toString(new Tag[] {tag});
}

private String bindingName(Tag tag) {
String result = tag.text();
if(result != null) {
if (result != null) {
int space = result.indexOf(" ");
if(space >= 0) {
if (space >= 0) {
result = result.substring(0, space);
}
}
Expand All @@ -62,9 +65,9 @@ private String bindingName(Tag tag) {

private String bindingDescription(Tag tag) {
String result = tag.text();
if(result != null) {
if (result != null) {
int space = result.indexOf(" ");
if(space >= 0) {
if (space >= 0) {
result = result.substring(space);
}
}
Expand All @@ -74,7 +77,10 @@ private String bindingDescription(Tag tag) {
/**
* Given an array of <code>Tag</code>s representing this custom
* tag, return its string representation.
* @param tags the array of <code>Tag</code>s representing of this custom tag.
*
* @param tags
* the array of <code>Tag</code>s representing of this custom tag
* @return string representation of the <code>Tag</code>s
*/
public String toString(Tag[] tags) {
if (tags.length == 0) {
Expand Down Expand Up @@ -102,4 +108,3 @@ public String toString(Tag[] tags) {
return sb.toString();
}
}

18 changes: 9 additions & 9 deletions Build/taglets/BindingTaglet.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,36 @@

/**
* Taglet representing @binding. This tag can be used in any kind of
* {@link com.sun.javadoc.Doc}. It is not an inline tag. The text is displayed
* in yellow to remind the developer to perform a task. For
* example, "@binding someKey The key to use" would be shown as:
* {@link com.sun.javadoc.Doc}. It is not an inline tag and will be
* displayed as a table with all bindings grouped. For example
* "@binding someKey The key to use" would be shown as:
* <DL>
* <DT>
* <B>Bindings:</B>
* <DT><B>Bindings:</B></DT>
* <DD><table><tr><th>someKey</th><td>
* The key to use</td></tr></table></DD>
* </DL>
*
* @author ak
*/

public class BindingTaglet extends AbstractTaglet {

private static final String NAME = "binding";
private static final String HEADER = "Bindings";

@Override
public String getName() {
return NAME;
}

@Override
public String getHeader() {
return HEADER;
}

/**
* Register this Taglet.
* @param tagletMap the map to register this tag to.
*
* @param tagletMap
* the map to register this tag to
*/
@SuppressWarnings("unchecked")
public static void register(Map tagletMap) {
Expand All @@ -44,4 +45,3 @@ public static void register(Map tagletMap) {
tagletMap.put(tag.getName(), tag);
}
}

23 changes: 9 additions & 14 deletions Build/taglets/ComponentDoclet.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
Expand Down Expand Up @@ -37,23 +36,24 @@
* @author kiddyr
*/
public class ComponentDoclet extends com.sun.javadoc.Doclet {
private static ArrayList<String> srcDirs;
private static ArrayList<String> compDirs;

static ArrayList<String> srcDirs;
static ArrayList<String> compDirs;

static HashMap<String,HashMap<String,Object>> comps;
private static HashMap<String,HashMap<String,Object>> comps;

static String[] prefixes = new String[] { "Selenium", "ERDAjax", "PayPal", "ERD2W", "ERDIV", "ERIUI", "ERNEU",
private static String[] prefixes = new String[] { "Selenium", "ERDAjax", "PayPal", "ERD2W", "ERDIV", "ERIUI", "ERNEU",
"ERPDF", "ERXJS", "Ajax", "SEEO", "UJAC", "D2W", "ERC", "ERD", "ERO", "ERP", "ERX",
"GSV", "WOL", "YUI", "ER", "GC", "IM", "JS", "SC", "SE", "WO", "WR", "WX" };

/**
* Generate javadoc. This needs some explanations, comments and a bit of unwinding. It seems
* over-complicated to me and I wrote it.
*
* @param root
* @return <code>true</code> on success
*/
@SuppressWarnings("unchecked")
public static boolean start(RootDoc root) {

// test();

ClassDoc[] classes = root.classes();
Expand Down Expand Up @@ -329,14 +329,14 @@ public static boolean start(RootDoc root) {
out.close();

} catch (java.io.IOException ioe) {
System.err.println("Error writing to /tmp/foo.html"); System.exit(1);
System.err.println("Error writing to /tmp/foo.html");
System.exit(1);
}

return false;
}

static void gatherBindingsFromApi(HashMap<String,HashMap<String,Object>> comps) {

// Gather the bindings for the component from the api file.
//
Iterator<String> keys = comps.keySet().iterator();
Expand Down Expand Up @@ -368,7 +368,6 @@ static void gatherBindingsFromApi(HashMap<String,HashMap<String,Object>> comps)
}

static void test() {

// int result = 0;
//
// ArrayList<String> tester = new ArrayList<String>();
Expand Down Expand Up @@ -541,7 +540,6 @@ static void test() {
}

static int checkTest(String name, ArrayList<String> tester, Object expected, Object found) {

if (name == null | name.length() == 0 || tester == null || expected == null || found == null) return 1;

if (!found.equals(expected)) {
Expand All @@ -557,7 +555,6 @@ static int checkTest(String name, ArrayList<String> tester, Object expected, Obj
}

static void writeHead(FileWriter out) {

try {
out.write("<html><head>\n");
out.write("<meta name=\"ROBOTS\" content=\"NOINDEX\" />\n");
Expand Down Expand Up @@ -634,7 +631,6 @@ static void writeHead(FileWriter out) {
}

static void writeTail(FileWriter out) {

try {
out.write("<!-- ======= START OF BOTTOM NAVBAR ====== -->\n");
out.write("<A NAME=\"navbar_bottom\"><!-- --></A>\n");
Expand Down Expand Up @@ -695,7 +691,6 @@ static void writeTail(FileWriter out) {
}

public static boolean validOptions(String[][] options, DocErrorReporter reporter) {

srcDirs = new ArrayList<String>();

// System.out.println("options:");
Expand Down
16 changes: 8 additions & 8 deletions Build/taglets/D2WKeyTaglet.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,36 @@

/**
* Taglet representing @d2wKey. This tag can be used in any kind of
* {@link com.sun.javadoc.Doc}. It is not an inline tag. The text is displayed
* in yellow to remind the developer to perform a task. For
* {@link com.sun.javadoc.Doc}. It is not an inline tag and will be
* displayed as a table with all d2w keys grouped. For
* example, "@d2wKey someKey The key to use" would be shown as:
* <DL>
* <DT>
* <B>D2W Keys:</B>
* <DT><B>D2W Keys:</B></DT>
* <DD><table><tr><th>someKey</th><td>
* The key to use</td></tr></table></DD>
* </DL>
*
* @author ak
*/

public class D2WKeyTaglet extends AbstractTaglet {

private static final String NAME = "d2wKey";
private static final String HEADER = "D2W Keys";

@Override
public String getName() {
return NAME;
}

@Override
public String getHeader() {
return HEADER;
}

/**
* Register this Taglet.
* @param tagletMap the map to register this tag to.
*
* @param tagletMap
* the map to register this tag to
*/
@SuppressWarnings("unchecked")
public static void register(Map tagletMap) {
Expand All @@ -44,4 +45,3 @@ public static void register(Map tagletMap) {
tagletMap.put(tag.getName(), tag);
}
}

6 changes: 4 additions & 2 deletions Build/taglets/PageGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,12 @@ static String paddedNumber(int num, int width) {
/**
* Take a list of comment strings, eg ("/**", "Something", "", " * @binding some", "\*\/"),
* and return a dictionary of binding names to binding comment structures.
*
* @param comps
* @param tag
*/
@SuppressWarnings("unchecked")
static void findTagComments(HashMap<String,HashMap<String,Object>> comps, String tag) {

static void findTagComments(HashMap<String, HashMap<String, Object>> comps, String tag) {
// System.out.println("start: comments = "+comments);

Iterator<String> keys = comps.keySet().iterator();
Expand Down
11 changes: 4 additions & 7 deletions Build/taglets/PageInstaller.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,20 @@
import java.util.Properties;

public class PageInstaller {

static void addLinkToNavBar(String targetFilename, String htmlFilename, String linkName) {

File file = new File(targetFilename);

FileReader fRdr = null;

try {
fRdr = new FileReader(file);
} catch (java.io.FileNotFoundException fnfe) { System.err.println("ERROR: could not open file for reading: "+file); System.exit(1); }
} catch (java.io.FileNotFoundException fnfe) {
System.err.println("ERROR: could not open file for reading: " + file);
System.exit(1);
}

LineNumberReader rdr = new LineNumberReader(fRdr);

String line = "";

ArrayList<String> output = new ArrayList<String>();

boolean needsUpdate = false;

while (line != null) {
Expand Down
17 changes: 10 additions & 7 deletions Build/taglets/PropertyTaglet.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,38 @@
* example, "@property er.migration.skipModelNames a comma-separated list of
* model names to NOT be migrated." would be shown as:
* <DL>
* <DT>
* <B>Properties:</B>
* <DT><B>Properties:</B></DT>
* <DD><table><tr><th>er.migration.skipModelNames</th><td>
* a comma-separated list of model names
* to NOT be migrated.</td></tr></table></DD>
* </DL>
*
* @author chill
*/

public class PropertyTaglet extends AbstractTaglet {

private static final String NAME = "property";
private static final String HEADER = "Properties";

@Override
public String getName() {
return NAME;
}

@Override
public String getHeader() {
return HEADER;
}

public boolean inMethod() { return true; }
@Override
public boolean inMethod() {
return true;
}

/**
* Register this Taglet.
* @param tagletMap the map to register this tag to.
*
* @param tagletMap
* the map to register this tag to
*/
@SuppressWarnings("unchecked")
public static void register(Map tagletMap) {
Expand All @@ -47,4 +51,3 @@ public static void register(Map tagletMap) {
tagletMap.put(tag.getName(), tag);
}
}

0 comments on commit 7c3ba8a

Please sign in to comment.