diff --git a/android-changes.txt b/android-changes.txt
index 025bcd8..a62b071 100644
--- a/android-changes.txt
+++ b/android-changes.txt
@@ -1,6 +1,12 @@
 Changes in this version relative to http://doclava.googlecode.com/
 ------------------------------------------------------------------
 
+* Added a new command line option -showAnnotation <@interface classname>,
+  which takes in a fully qualified annotation classname.  The specified
+  annotation will override any @hide annotations within the javadoc.  To
+  specify multiple annotations to override @hide, use multiple
+  -showAnnotation options.
+
 * Modified the Java stub generator code to write out annotations for
   methods and fields as well, not just classes. This meant adding a
   writeAnnotations call to writeMethod and to writeField
diff --git a/src/com/google/doclava/ClassInfo.java b/src/com/google/doclava/ClassInfo.java
index f4f2853..6e5aab2 100644
--- a/src/com/google/doclava/ClassInfo.java
+++ b/src/com/google/doclava/ClassInfo.java
@@ -44,13 +44,13 @@
       return a.qualifiedName().compareTo(b.qualifiedName());
     }
   };
-  
+
   /**
    * Constructs a stub representation of a class.
    */
   public ClassInfo(String qualifiedName) {
     super("", SourcePositionInfo.UNKNOWN);
-    
+
     mQualifiedName = qualifiedName;
     if (qualifiedName.lastIndexOf('.') != -1) {
       mName = qualifiedName.substring(qualifiedName.lastIndexOf('.') + 1);
@@ -1195,6 +1195,13 @@
       if (pkg != null && pkg.isHidden()) {
         return true;
       }
+      if (cl.annotations() != null) {
+        for (AnnotationInstanceInfo info : cl.annotations()) {
+          if (Doclava.showAnnotations.contains(info.type().qualifiedName())) {
+            return false;
+          }
+        }
+      }
       if (cl.comment().isHidden()) {
         return true;
       }
@@ -1244,7 +1251,7 @@
 
     return null;
   }
-  
+
   public boolean supportsMethod(MethodInfo method) {
     for (MethodInfo m : methods()) {
       if (m.getHashableName().equals(method.getHashableName())) {
@@ -1373,7 +1380,7 @@
     }
     return null;
   }
-  
+
   public String scope() {
     if (isPublic()) {
       return "public";
@@ -1467,7 +1474,7 @@
   private String mReasonIncluded;
   private ArrayList<MethodInfo> mNonWrittenConstructors;
   private boolean mIsDeprecated;
-  
+
   // TODO: Temporary members from apicheck migration.
   private HashMap<String, MethodInfo> mApiCheckConstructors = new HashMap<String, MethodInfo>();
   private HashMap<String, MethodInfo> mApiCheckMethods = new HashMap<String, MethodInfo>();
@@ -1476,7 +1483,7 @@
 
   // Resolutions
   private ArrayList<Resolution> mResolutions;
-  
+
   /**
    * Returns true if {@code cl} implements the interface {@code iface} either by either being that
    * interface, implementing that interface or extending a type that implements the interface.
@@ -1538,7 +1545,7 @@
    * Returns all methods defined directly in this class. For a list of all
    * methods supported by this class, see {@link #methods()}.
    */
-  
+
   public Map<String, MethodInfo> allMethods() {
     return mApiCheckMethods;
   }
@@ -1553,7 +1560,7 @@
     }
     return result;
   }
-  
+
   public String superclassName() {
     if (mSuperclass == null) {
       if (mQualifiedName.equals("java.lang.Object")) {
@@ -1563,11 +1570,11 @@
     }
     return mSuperclass.mQualifiedName;
   }
-  
+
   public void setAnnotations(ArrayList<AnnotationInstanceInfo> annotations) {
     mAnnotations = annotations;
   }
-  
+
   public boolean isConsistent(ClassInfo cl) {
     boolean consistent = true;
 
@@ -1727,7 +1734,7 @@
 
     return consistent;
   }
-  
+
   // Find a superclass implementation of the given method.
   public static MethodInfo overriddenMethod(MethodInfo candidate, ClassInfo newClassObj) {
     if (newClassObj == null) {
@@ -1758,7 +1765,7 @@
     }
     return ClassInfo.interfaceMethod(candidate, newClassObj.mSuperclass);
   }
-  
+
   public boolean hasConstructor(MethodInfo constructor) {
     String name = constructor.getHashableName();
     for (MethodInfo ctor : mApiCheckConstructors.values()) {
diff --git a/src/com/google/doclava/Doclava.java b/src/com/google/doclava/Doclava.java
index 4bdf245..26759c3 100644
--- a/src/com/google/doclava/Doclava.java
+++ b/src/com/google/doclava/Doclava.java
@@ -74,6 +74,7 @@
   public static SinceTagger sinceTagger = new SinceTagger();
   public static HashSet<String> knownTags = new HashSet<String>();
   public static FederationTagger federationTagger = new FederationTagger();
+  public static Set<String> showAnnotations = new HashSet<String>();
   private static boolean generateDocs = true;
   private static boolean parseComments = false;
   private static String yamlNavFile = null;
@@ -175,6 +176,8 @@
         }
       } else if (a[0].equals("-keeplist")) {
         keepListFile = a[1];
+      } else if (a[0].equals("-showAnnotation")) {
+        showAnnotations.add(a[1]);
       } else if (a[0].equals("-proguard")) {
         proguardFile = a[1];
       } else if (a[0].equals("-proofread")) {
@@ -502,6 +505,9 @@
     if (option.equals("-keeplist")) {
       return 2;
     }
+    if (option.equals("-showAnnotation")) {
+      return 2;
+    }
     if (option.equals("-proguard")) {
       return 2;
     }
diff --git a/src/com/google/doclava/MemberInfo.java b/src/com/google/doclava/MemberInfo.java
index 5600749..e5cc7a2 100644
--- a/src/com/google/doclava/MemberInfo.java
+++ b/src/com/google/doclava/MemberInfo.java
@@ -42,6 +42,18 @@
 
   public abstract boolean isExecutable();
 
+  @Override
+  public boolean isHidden() {
+    if (mAnnotations != null) {
+      for (AnnotationInstanceInfo info : mAnnotations) {
+        if (Doclava.showAnnotations.contains(info.type().qualifiedName())) {
+          return false;
+        }
+      }
+    }
+    return super.isHidden();
+  }
+
   public String anchor() {
     if (mSignature != null) {
       return mName + mSignature;
