Package org.apache.wink.common.model.csv

Examples of org.apache.wink.common.model.csv.CsvSerializer


     * @throws Exception
     */
    public void testTo() throws Exception {
        // CollectionResource<String> resource = new
        // CollectionResource<String>();
        CsvSerializer csvSerializer = new CsvSerializer() {

            List<String[]> csvText =
                                       new ArrayList<String[]>(
                                                               Arrays
                                                                   .asList(new String[] {"Id",
                                                                               "Name",
                                                                               "Description",
                                                                               "Assigned To",
                                                                               "Severity", "Status"},
                                                                           new String[] {
                                                                               "2",
                                                                               "Infinite Loop",
                                                                               "\"When making target which depends on it self, the application freezes in an infinite loop\"",
                                                                               "developer2",
                                                                               "2-high", "New"},
                                                                           new String[] {
                                                                               "3",
                                                                               "RSS feed component throws exception",
                                                                               "When I open the policy manager home page" + lineSeparator
                                                                                   + " (after I create business policy and perform some validations) I see the error.",
                                                                               "developer3",
                                                                               "4-minor", "New"},
                                                                           new String[] {
                                                                               "1",
                                                                               "Localization problem",
                                                                               "While running the application," + lineSeparator
                                                                                   + "an exception that localization key is not found was thrown.",
                                                                               "developer,1",
                                                                               "2-high", "New"}));

            public Iterator<String[]> getEntities() {
                return csvText.iterator();
            }
        };

        ByteArrayOutputStream os = new ByteArrayOutputStream();
        MultivaluedMapImpl<String, Object> httpHeaders = new MultivaluedMapImpl<String, Object>();
        new CsvSerializerProvider().writeTo(csvSerializer,
                                            csvSerializer.getClass(),
                                            null,
                                            null,
                                            MediaTypeUtils.CSV,
                                            httpHeaders,
                                            os);
View Full Code Here


     * @throws Exception
     */
    public void testTo() throws Exception {
        // CollectionResource<String> resource = new
        // CollectionResource<String>();
        CsvSerializer csvSerializer = new CsvSerializer() {

            List<String[]> csvText =
                                       new ArrayList<String[]>(
                                                               Arrays
                                                                   .asList(new String[] {"Id",
                                                                               "Name",
                                                                               "Description",
                                                                               "Assigned To",
                                                                               "Severity", "Status"},
                                                                           new String[] {
                                                                               "2",
                                                                               "Infinite Loop",
                                                                               "\"When making target which depends on it self, the application freezes in an infinite loop\"",
                                                                               "developer2",
                                                                               "2-high", "New"},
                                                                           new String[] {
                                                                               "3",
                                                                               "RSS feed component throws exception",
                                                                               "When I open the policy manager home page" + lineSeparator
                                                                                   + " (after I create business policy and perform some validations) I see the error.",
                                                                               "developer3",
                                                                               "4-minor", "New"},
                                                                           new String[] {
                                                                               "1",
                                                                               "Localization problem",
                                                                               "While running the application," + lineSeparator
                                                                                   + "an exception that localization key is not found was thrown.",
                                                                               "developer,1",
                                                                               "2-high", "New"}));

            public Iterator<String[]> getEntities() {
                return csvText.iterator();
            }
        };

        ByteArrayOutputStream os = new ByteArrayOutputStream();
        MultivaluedMapImpl<String, Object> httpHeaders = new MultivaluedMapImpl<String, Object>();
        new CsvSerializerProvider().writeTo(csvSerializer,
                                            csvSerializer.getClass(),
                                            null,
                                            null,
                                            MediaTypeUtils.CSV,
                                            httpHeaders,
                                            os);
View Full Code Here

     * @throws Exception
     */
    public void testTo() throws Exception {
        // CollectionResource<String> resource = new
        // CollectionResource<String>();
        CsvSerializer csvSerializer = new CsvSerializer() {

            List<String[]> csvText =
                                       new ArrayList<String[]>(
                                                               Arrays
                                                                   .asList(new String[] {"Id",
                                                                               "Name",
                                                                               "Description",
                                                                               "Assigned To",
                                                                               "Severity", "Status"},
                                                                           new String[] {
                                                                               "2",
                                                                               "Infinite Loop",
                                                                               "\"When making target which depends on it self, the application freezes in an infinite loop\"",
                                                                               "developer2",
                                                                               "2-high", "New"},
                                                                           new String[] {
                                                                               "3",
                                                                               "RSS feed component throws exception",
                                                                               "When I open the policy manager home page" + lineSeparator
                                                                                   + " (after I create business policy and perform some validations) I see the error.",
                                                                               "developer3",
                                                                               "4-minor", "New"},
                                                                           new String[] {
                                                                               "1",
                                                                               "Localization problem",
                                                                               "While running the application," + lineSeparator
                                                                                   + "an exception that localization key is not found was thrown.",
                                                                               "developer,1",
                                                                               "2-high", "New"}));

            public Iterator<String[]> getEntities() {
                return csvText.iterator();
            }
        };

        ByteArrayOutputStream os = new ByteArrayOutputStream();
        MultivaluedMapImpl<String, Object> httpHeaders = new MultivaluedMapImpl<String, Object>();
        new CsvSerializerProvider().writeTo(csvSerializer,
                                            csvSerializer.getClass(),
                                            null,
                                            null,
                                            MediaTypeUtils.CSV_TYPE,
                                            httpHeaders,
                                            os);
View Full Code Here

TOP

Related Classes of org.apache.wink.common.model.csv.CsvSerializer

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.