alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Apache CXF example source code file (CollectionService.java)

This example Apache CXF source code file (CollectionService.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Apache CXF tags/keywords

arraylist, beanwithgregoriandate, cantelope, collection, collection, collectionservice, document, document, dom, list, map, map, parser, runtimeexception, string, string, util, xml

The Apache CXF CollectionService.java source code

/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.apache.cxf.aegis.type.java5;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.Stack;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class CollectionService implements CollectionServiceInterface {
    
    private Map<String, Map lastComplexMap;
    
    /** {@inheritDoc}*/
    public Collection<String> getStrings() {
        return null;
    }

    /** {@inheritDoc}*/
    public void setLongs(Collection<Long> longs) {
    }

    /** {@inheritDoc}*/
    public Collection getUnannotatedStrings() {
        return null;
    }

    /** {@inheritDoc}*/
    public Collection<Collection getStringCollections() {
        return null;
    }
    
    /** {@inheritDoc}*/
    public void takeDoubleList(List<Double> doublesList) {
    }
    
    /** {@inheritDoc}*/
    public String takeSortedStrings(SortedSet<String> strings) {
        return strings.first();
    }

    public void method1(List<String> headers1) {
        // do nothing, this is purely for schema issues.
    }

    public String takeStack(Stack<String> strings) {
        return strings.firstElement();
    }

    //CHECKSTYLE:OFF
    public String takeUnsortedSet(HashSet<String> strings) {
        return Integer.toString(strings.size());
    }

    public String takeArrayList(ArrayList<String> strings) {
        return strings.get(0);
    }
    //CHECKSTYLE:ON

    public void mapOfMapWithStringAndPojo(Map<String, Map bigParam) {
        lastComplexMap = bigParam;
    }

    protected Map<String, Map getLastComplexMap() {
        return lastComplexMap;
    }

    public Collection<double[]> returnCollectionOfPrimitiveArrays() {
        List<double[]> data = new ArrayList();
        double[] dataArray = new double[] {3.14, 2.0, -666.6 };
        data.add(dataArray);
        dataArray = new double[] {-666.6, 3.14, 2.0, 0 };
        data.add(dataArray);
        return data;
    }

    public Collection<Document[]> returnCollectionOfDOMFragments() {
        try {
            DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            Document d1 = builder.newDocument();
            Element e = d1.createElement("Horse");
            e.setAttribute("cover", "feathers");
            d1.appendChild(e);
            Document d2 = builder.newDocument();
            e = d2.createElement("Cantelope");
            d2.appendChild(e);
            e.setAttribute("not-an", "ungulate");
            Document[] da = new Document[] {d1, d2};
            List<Document[]> l = new ArrayList();
            l.add(da);
            da = new Document[] {d2, d1};
            l.add(da);
            return l;
        } catch (ParserConfigurationException e) {
            throw new RuntimeException(e);
        }
    }

}

Other Apache CXF examples (source code examples)

Here is a short list of links related to this Apache CXF CollectionService.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.