Package org.apache.wink.common.model.app

Examples of org.apache.wink.common.model.app.ObjectFactory


                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream) throws IOException, WebApplicationException {
        try {
            ObjectFactory objectFactory = new ObjectFactory();
            JAXBElement<AppCategories> feedElement = objectFactory.createCategories(t);
            Marshaller marshaller = AppCategories.getMarshaller();
            marshaller.setProperty(Marshaller.JAXB_ENCODING, ProviderUtils.getCharset(mediaType));
            AtomJAXBUtils.marshal(marshaller, feedElement, entityStream);
        } catch (PropertyException e) {
            throw new WebApplicationException(e);
View Full Code Here


                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream) throws IOException, WebApplicationException {

        try {
            ObjectFactory objectFactory = new ObjectFactory();
            JAXBElement<AppService> sd = objectFactory.createService(t);
            Marshaller marshaller = AppService.getMarshaller();
            marshaller.setProperty(Marshaller.JAXB_ENCODING, ProviderUtils.getCharset(mediaType));
            AtomJAXBUtils.marshal(marshaller, sd, entityStream);
        } catch (PropertyException e) {
            throw new WebApplicationException(e);
View Full Code Here

        // Marshaller m = AtomJAXBUtils.createMarshaller(ctx, new
        // JAXBNamespacePrefixMapper(RestConstants.NAMESPACE_APP));
        Marshaller m = AppService.getMarshaller();

        AppService service = getService();
        JAXBElement<AppService> element = (new ObjectFactory()).createService(service);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        AtomJAXBUtils.marshal(m, element, null, os);
        assertEquals(SERVICE_DOCUMENT, os.toString());
    }
View Full Code Here

        Marshaller m = AppService.getMarshaller();
        // Unmarshaller u = AtomJAXBUtils.createUnmarshaller(ctx);
        Unmarshaller u = AppService.getUnmarshaller();

        Object service = AtomJAXBUtils.unmarshal(u, new StringReader(SERVICE_DOCUMENT));
        JAXBElement<AppService> element = (new ObjectFactory()).createService((AppService)service);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        AtomJAXBUtils.marshal(m, element, null, os);
        assertEquals(SERVICE_DOCUMENT, os.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.wink.common.model.app.ObjectFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.