Hidden variables are hidden by default. Settable by command line option

DiffObjectsWalker test arguments removed.
Minor refactoring of GATKDoclet
This commit is contained in:
Mark DePristo 2011-07-24 20:52:44 -04:00
parent 1c1f1da349
commit c43b5981f2
4 changed files with 23 additions and 23 deletions

View File

@ -182,21 +182,6 @@ public class DiffObjectsWalker extends RodWalker<Integer, Integer> {
@Argument(fullName="showItemizedDifferences", shortName="SID", doc="Should we enumerate all differences between the files?", required=false)
boolean showItemizedDifferences = false;
@Hidden
@Argument(fullName="testEnum", doc="X", required=false)
TestEnum testEnum = TestEnum.ONE;
@Deprecated
@Argument(fullName="testDepreciates", doc="Y", required=false)
int dontUseMe = 1;
public enum TestEnum {
/** Docs for ONE */
ONE,
/** Docs for TWO */
TWO
};
final DiffEngine diffEngine = new DiffEngine();
@Override

View File

@ -44,6 +44,10 @@ public abstract class DocumentedGATKFeatureHandler {
this.doclet = doclet;
}
public GATKDoclet getDoclet() {
return doclet;
}
public boolean shouldBeProcessed(ClassDoc doc) { return true; }
public String getDestinationFilename(ClassDoc doc) {

View File

@ -45,6 +45,7 @@ public class GATKDoclet {
final protected static File DESTINATION_DIR = new File("gatkdocs");
final protected static Logger logger = Logger.getLogger(GATKDoclet.class);
protected static String buildTimestamp = null, absoluteVersion = null;
protected static boolean showHiddenFeatures = false;
RootDoc rootDoc;
@ -61,6 +62,8 @@ public class GATKDoclet {
buildTimestamp = options[1];
if (options[0].equals("-absolute-version"))
absoluteVersion = options[1];
if (options[0].equals("-include-hidden"))
showHiddenFeatures = true;
}
GATKDoclet doclet = new GATKDoclet();
@ -74,12 +77,16 @@ public class GATKDoclet {
* @return Number of potential parameters; 0 if not supported.
*/
public static int optionLength(String option) {
if(option.equals("-build-timestamp") || option.equals("-absolute-version") ) {
if(option.equals("-build-timestamp") || option.equals("-absolute-version") || option.equals("-include-hidden")) {
return 2;
}
return 0;
}
public boolean showHiddenFeatures() {
return showHiddenFeatures;
}
public Set<GATKDocWorkUnit> workUnits() {
TreeSet<GATKDocWorkUnit> m = new TreeSet<GATKDocWorkUnit>();

View File

@ -113,13 +113,17 @@ public class GenericDocumentationHandler extends DocumentedGATKFeatureHandler {
ArgumentDefinition argDef = argumentSource.createArgumentDefinitions().get(0);
FieldDoc fieldDoc = getFieldDoc(classdoc, argumentSource.field.getName());
Map<String, Object> argBindings = docForArgument(fieldDoc, argumentSource, argDef); // todo -- why can you have multiple ones?
String kind = "optional";
if ( argumentSource.isRequired() ) kind = "required";
else if ( argumentSource.isHidden() ) kind = "hidden";
else if ( argumentSource.isDeprecated() ) kind = "depreciated";
args.get(kind).add(argBindings);
args.get("all").add(argBindings);
System.out.printf("Processing %s%n", argumentSource);
if ( ! argumentSource.isHidden() || getDoclet().showHiddenFeatures() ) {
System.out.printf("Processing %s%n", argumentSource);
String kind = "optional";
if ( argumentSource.isRequired() ) kind = "required";
else if ( argumentSource.isHidden() ) kind = "hidden";
else if ( argumentSource.isDeprecated() ) kind = "depreciated";
args.get(kind).add(argBindings);
args.get("all").add(argBindings);
} else {
System.out.printf("Skipping hidden feature %s%n", argumentSource);
}
}
} catch ( ClassNotFoundException e ) {
throw new RuntimeException(e);