001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.tools.util;
019:
020: import java.util.ArrayList;
021: import java.util.HashMap;
022: import java.util.List;
023: import java.util.Map;
024:
025: public class ClassCollector {
026:
027: private final Map<String, String> seiClassNames = new HashMap<String, String>();
028: private final Map<String, String> typesClassNames = new HashMap<String, String>();
029: private final Map<String, String> exceptionClassNames = new HashMap<String, String>();
030: private final Map<String, String> serviceClassNames = new HashMap<String, String>();
031: private final Map<String, String> implClassNames = new HashMap<String, String>();
032: private final Map<String, String> clientClassNames = new HashMap<String, String>();
033: private final Map<String, String> serverClassNames = new HashMap<String, String>();
034:
035: public boolean containSeiClass(String packagename, String type) {
036: return seiClassNames.containsKey(key(packagename, type));
037: }
038:
039: public boolean containTypesClass(String packagename, String type) {
040: return typesClassNames.containsKey(key(packagename, type));
041: }
042:
043: public boolean containExceptionClass(String packagename, String type) {
044: return exceptionClassNames.containsKey(key(packagename, type));
045: }
046:
047: public void addSeiClassName(String packagename, String type,
048: String fullClassName) {
049: seiClassNames.put(key(packagename, type), fullClassName);
050: }
051:
052: public void addTypesClassName(String packagename, String type,
053: String fullClassName) {
054: typesClassNames.put(key(packagename, type), fullClassName);
055: }
056:
057: public void addServerClassName(String packagename, String type,
058: String fullClassName) {
059: serverClassNames.put(key(packagename, type), fullClassName);
060: }
061:
062: public void addImplClassName(String packagename, String type,
063: String fullClassName) {
064: implClassNames.put(key(packagename, type), fullClassName);
065: }
066:
067: public void addClientClassName(String packagename, String type,
068: String fullClassName) {
069: clientClassNames.put(key(packagename, type), fullClassName);
070: }
071:
072: public void addServiceClassName(String packagename, String type,
073: String fullClassName) {
074: serviceClassNames.put(key(packagename, type), fullClassName);
075: }
076:
077: public void addExceptionClassName(String packagename, String type,
078: String fullClassName) {
079: exceptionClassNames.put(key(packagename, type), fullClassName);
080: }
081:
082: public String getTypesFullClassName(String packagename, String type) {
083: return typesClassNames.get(key(packagename, type));
084: }
085:
086: private String key(String packagename, String type) {
087: return packagename + "#" + type;
088: }
089:
090: public List<String> getGeneratedFileInfo() {
091: List<String> generatedFileList = new ArrayList<String>();
092: generatedFileList.addAll(seiClassNames.values());
093: generatedFileList.addAll(typesClassNames.values());
094: generatedFileList.addAll(exceptionClassNames.values());
095: generatedFileList.addAll(serviceClassNames.values());
096: generatedFileList.addAll(implClassNames.values());
097: generatedFileList.addAll(clientClassNames.values());
098: return generatedFileList;
099: }
100:
101: }
|