public void writeTo(T t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream outputStream) throws IOException { try { LogMessages.LOGGER.debugf("Provider : %s, Method : writeTo", getClass().getName()); Marshaller marshaller = getMarshaller(type, annotations, mediaType); marshaller = decorateMarshaller(type, annotations, mediaType, marshaller); marshaller.marshal(t, outputStream); } catch (JAXBException e) { throw new JAXBMarshalException(e); } }
JAXBContext jaxb = findJAXBContext(type, annotations, mediaType, true); Unmarshaller unmarshaller = jaxb.createUnmarshaller(); unmarshaller = decorateUnmarshaller(type, annotations, mediaType, unmarshaller); if (needsSecurity()) return processWithSecureProcessing(unmarshaller, entityStream, getCharset(mediaType)); if (getCharset(mediaType) == null)
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return isReadWritable(type, genericType, annotations, mediaType); }
public AbstractJAXBProvider() { LogMessages.LOGGER.debugf("Provider : %s, Method : AbstractJAXBProvider", getClass().getName()); ResteasyConfiguration context = ResteasyContext.getContextData(ResteasyConfiguration.class); if (context != null) { String s = context.getParameter("resteasy.document.expand.entity.references"); if (s != null) { setDisableExternalEntities(!Boolean.parseBoolean(s)); } s = context.getParameter("resteasy.document.secure.processing.feature"); if (s != null) { setEnableSecureProcessingFeature(Boolean.parseBoolean(s)); } s = context.getParameter("resteasy.document.secure.disableDTDs"); if (s != null) { setDisableDTDs(Boolean.parseBoolean(s)); } } }
marshaller = AbstractJAXBProvider.decorateMarshaller(valueType, annotations, mediaType, marshaller); marshaller.marshal(jaxbMap, entityStream);
JAXBContext jaxb = findJAXBContext(type, annotations, mediaType, false); Marshaller marshaller = jaxb.createMarshaller(); setCharset(mediaType, marshaller);
unmarshaller = AbstractJAXBProvider.decorateUnmarshaller(valueType, annotations, mediaType, unmarshaller);
public static void setCharset(MediaType mediaType, Marshaller marshaller) throws PropertyException { String charset = getCharset(mediaType); // specify the character encoding if it is set on the media type if (charset != null) { marshaller.setProperty(Marshaller.JAXB_ENCODING, charset); } else { marshaller.setProperty(Marshaller.JAXB_ENCODING, StandardCharsets.UTF_8.name()); } }
AbstractJAXBProvider.decorateMarshaller(baseType, annotations, mediaType, marshaller); marshaller.marshal(collection, entityStream);
unmarshaller = AbstractJAXBProvider.decorateUnmarshaller(baseType, annotations, mediaType, unmarshaller); if (type.isArray())
marshaller = AbstractJAXBProvider.decorateMarshaller(baseType, annotations, mediaType, marshaller); if (type.isArray())
/** * */ public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return isReadWritable(type, genericType, annotations, mediaType); }