Java tutorial
//package com.java2s; //License from project: LGPL import javax.xml.bind.annotation.XmlSchema; public class Main { private static <T> String namespaceFromPackageAnnotation(final Class<T> clazz) { return clazz.getPackage().getAnnotation(XmlSchema.class).namespace(); } }