Fix get_schema_tree to handle DotAppDomainInfo

This was the first time we ever had a type that was parented on a
particular type of EppResource, as opposed to on Key<EppResource>
generically, and get_schema_tree was not printing it correctly.

(While I'm here, add some missing javadoc).

The new output is below. The only difference is that the line
with DotAppDomainInfo was ommitted before.

AppDeveloperAccount (bgr)

AppToDomainAssociation (bgr)

CommitLogBucket (not backed up)
  ↳ CommitLogManifest (not backed up)
    ↳ CommitLogMutation (not backed up)

CommitLogCheckpointRoot (not backed up)
  ↳ CommitLogCheckpoint (not backed up)

DomainApplicationIndex (bgr)

EntityGroupRoot (bgr)
  ↳ ClaimsListShard.ClaimsListSingleton (not backed up)
    ↳ ClaimsListShard.ClaimsListRevision (virtual)
      ↳ ClaimsListShard (not backed up)
  ↳ Cursor
  ↳ LogsExportCursor
  ↳ PremiumList
    ↳ PremiumList.PremiumListRevision (virtual)
      ↳ PremiumList.PremiumListEntry
  ↳ Registrar
    ↳ RegistrarBillingEntry
    ↳ RegistrarContact
    ↳ RegistrarCredit
      ↳ RegistrarCreditBalance
  ↳ Registry
    ↳ RegistryCursor
  ↳ ReservedList
  ↳ ServerSecret (not backed up)
  ↳ SignedMarkRevocationList (not backed up)
  ↳ TmchCrl (not backed up)

EppResource (abstract) (bgr)
  - ContactResource
  - DomainBase
    - DomainApplication (subclass)
    - DomainResource (subclass)
      ↳ DotAppDomainInfo
  - HostResource
  ↳ HistoryEntry
    ↳ BillingEvent.Cancellation
    ↳ BillingEvent.Modification
    ↳ BillingEvent.OneTime
    ↳ BillingEvent.Recurring
    ↳ PollMessage (abstract)
      - PollMessage.Autorenew (subclass)
      - PollMessage.OneTime (subclass)

EppResourceIndexBucket (virtual)
  ↳ EppResourceIndex (bgr)

ForeignKeyIndex.ForeignKeyContactIndex (bgr)

ForeignKeyIndex.ForeignKeyDomainIndex (bgr)

ForeignKeyIndex.ForeignKeyHostIndex (bgr)

GaeUserIdConverter (not backed up)

Lock (not backed up)

RdeRevision
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121968765
This commit is contained in:
cgoldfeder 2016-05-10 11:32:59 -07:00 committed by Justine Tunney
parent 766e2082f8
commit fc936ec2b0

View file

@ -150,15 +150,18 @@ final class GetSchemaTreeCommand implements GtechCommand {
.append(getPrintableName(clazz)) .append(getPrintableName(clazz))
.append(clazz.isAnnotationPresent(EntitySubclass.class) ? " (subclass)" : "")); .append(clazz.isAnnotationPresent(EntitySubclass.class) ? " (subclass)" : ""));
printSubclasses(clazz, indent + 2); printSubclasses(clazz, indent + 2);
printTree(clazz, indent + 2);
} }
} }
/** Returns the simple name of the class prefixed with its wrapper's simple name, if any. */
static String getPrintableName(Class<?> clazz) { static String getPrintableName(Class<?> clazz) {
return clazz.isMemberClass() return clazz.isMemberClass()
? getPrintableName(clazz.getDeclaringClass()) + "." + clazz.getSimpleName() ? getPrintableName(clazz.getDeclaringClass()) + "." + clazz.getSimpleName()
: clazz.getSimpleName(); : clazz.getSimpleName();
} }
/** An ordering that sorts on {@link #getPrintableName}. */
static class PrintableNameOrdering extends Ordering<Class<?>> implements Serializable { static class PrintableNameOrdering extends Ordering<Class<?>> implements Serializable {
@Override @Override
public int compare(Class<?> left, Class<?> right) { public int compare(Class<?> left, Class<?> right) {