* @see org.eclipse.persistence.oxm.XMLContext
* @throws IllegalArgumentException
*/
public static <T> T unwrap(javax.xml.bind.JAXBContext jaxbContext, Class<T> clazz) throws IllegalArgumentException {
try {
JAXBContext jaxbContextImpl = (JAXBContext) jaxbContext;
if (clazz == org.eclipse.persistence.jaxb.JAXBContext.class) {
return (T) jaxbContextImpl;
}
if (clazz == XMLContext.class) {
return (T) jaxbContextImpl.getXMLContext();
}
throw new IllegalArgumentException(ExceptionLocalization
.buildMessage("jaxb_helper_invalid_target_for_jaxbcontext", new Object[] { clazz }));
} catch (ClassCastException e) {
throw new IllegalArgumentException(ExceptionLocalization