Created
May 5, 2015 12:17
-
-
Save jonashackt/a2ced04a72508b7cf3d0 to your computer and use it in GitHub Desktop.
Get the Namespace-Uri from JAXB-Class-Declaration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <T> String getNamespaceUriFromJaxbClass(Class<T> jaxbClass) { | |
String nsURI = ""; | |
for(Annotation annotation: jaxbClass.getPackage().getAnnotations()){ | |
if(annotation.annotationType() == XmlSchema.class){ | |
nsURI = ((XmlSchema)annotation).namespace(); | |
break; | |
} | |
} | |
return nsURI; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment