Java tutorial
//package com.java2s; import javax.xml.bind.annotation.XmlRootElement; public class Main { private static String getName(Class<?> aClass) { XmlRootElement xmlRootElement = aClass.getAnnotation(XmlRootElement.class); return xmlRootElement.name(); } }