if (declaration instanceof TypeDeclaration)
{
TypeDeclaration typeDeclaration = (TypeDeclaration) declaration;
if (typeDeclaration.isInterface())
{
return new JavaInterfaceImpl(enclosingType, document, unit, typeDeclaration);
}
else
{
return new JavaClassImpl(enclosingType, document, unit, typeDeclaration);
}