public JAXBContext getClassContext(Class<?> type) throws JAXBException { return getClassContext(type, type); } protected JAXBContext getClassContext(Class<?> type, Type genericType) throws JAXBException {
public JAXBContext getClassContext(Class<?> type) throws JAXBException { return getClassContext(type, type); } protected JAXBContext getClassContext(Class<?> type, Type genericType) throws JAXBException {
@SuppressWarnings("unchecked") public JAXBContext getJAXBContext(Class<?> type, Type genericType) throws JAXBException { if (mc != null) { ContextResolver<JAXBContext> resolver = mc.getResolver(ContextResolver.class, JAXBContext.class); if (resolver != null) { JAXBContext customContext = resolver.getContext(type); if (customContext != null) { return customContext; } } } synchronized (classContexts) { JAXBContext context = classContexts.get(type); if (context != null) { return context; } } JAXBContext context = getPackageContext(type, genericType); return context != null ? context : getClassContext(type, genericType); } public JAXBContext getClassContext(Class<?> type) throws JAXBException {
@SuppressWarnings("unchecked") public JAXBContext getJAXBContext(Class<?> type, Type genericType) throws JAXBException { if (mc != null) { ContextResolver<JAXBContext> resolver = mc.getResolver(ContextResolver.class, JAXBContext.class); if (resolver != null) { JAXBContext customContext = resolver.getContext(type); if (customContext != null) { return customContext; } } } synchronized (classContexts) { JAXBContext context = classContexts.get(type); if (context != null) { return context; } } JAXBContext context = getPackageContext(type, genericType); return context != null ? context : getClassContext(type, genericType); } public JAXBContext getClassContext(Class<?> type) throws JAXBException {