{
if (field == null)
{
if (doc instanceof RootDoc)
{
RootDoc docInstance = (RootDoc) doc;
return "Javadoc";
}
else if (doc instanceof AnnotationTypeDoc)
{
AnnotationTypeDoc docInstance = (AnnotationTypeDoc) doc;
return "AnnotationType " + docInstance.name();
}
else if (doc instanceof AnnotationTypeElementDoc)//is subinterface of method so it must com before the MethodDoc
{
AnnotationTypeElementDoc docInstance = (AnnotationTypeElementDoc) doc;
return "AnnotationTypeElement " + docInstance.name();
}
else if (doc instanceof MethodDoc)
{
MethodDoc docInstance = (MethodDoc) doc;
return "Method " + docInstance.name();
}
else if (doc instanceof ClassDoc)
{
ClassDoc docInstance = (ClassDoc) doc;
return "Class " + docInstance.name();
}
else if (doc instanceof ConstructorDoc)
{
ConstructorDoc docInstance = (ConstructorDoc) doc;
return "Constructor " + docInstance.name();
}
else if (doc instanceof FieldDoc)
{
FieldDoc docInstance = (FieldDoc) doc;
return "Field " + docInstance.name();
}
else if (doc instanceof PackageDoc)
{
PackageDoc docInstance = (PackageDoc) doc;
return "Package " + docInstance.name();
}
else
{
return doc.getClass().getName();
}