从TypeElement获取类名
//package com.nowjava; import javax.lang.model.element.Element; /*来 自 n o w j a v a . c o m*/ import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; public class Main { public static String getClassName(TypeElement element) { Element currElement = element; String result = element.getSimpleName().toString(); while (currElement.getEnclosingElement() != null) { currElement = currElement.getEnclosingElement(); if (currElement instanceof TypeElement) { result = currElement.getSimpleName() + "$" + result; } else if (currElement instanceof PackageElement) { if (!"".equals(currElement.getSimpleName())) { result = ((PackageElement) c