Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
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 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.binding.corba;
public class CorbaTypeMap {
    private String targetNamespace;
    private Map<StringCorbaTypeImpltypeMap;
    private Map<QNameTypeCodetypeCodeMap;
    public CorbaTypeMap(String namespace) {
         = namespace;
         = new HashMap<StringCorbaTypeImpl>();
         = new HashMap<QNameTypeCode>();
    public void addType(String nameCorbaTypeImpl type) {
    public CorbaTypeImpl getType(String name) {
        assert name != null;
        return .get(name);
    public String getTargetNamespace() {
        return ;
    public void addTypeCode(QName nameTypeCode tc) {
    public TypeCode getTypeCode(QName name) {
        return .get(name);
    // This is used by the Any type when trying to re-construct the type stored inside a 
    // CORBA Any.
    public QName getIdlType(TypeCode tc) {
        String repId = null;
        try {
            repId =;
        } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) {
            // No id has been set.
            return null;
        if (repId == null) {
            return null;
        Set<Map.Entry<StringCorbaTypeImpl>> mapSet = .entrySet();
        for (Iterator<Map.Entry<StringCorbaTypeImpl>> i = mapSet.iterator(); i.hasNext();) {
            Map.Entry<StringCorbaTypeImplentry =;
            if (entry.getValue() instanceof NamedType) {
                NamedType n = (NamedType)entry.getValue();
                if (n.getRepositoryID().equals(repId)) {
                    return new QName(getTargetNamespace(), entry.getKey());
        return null;
New to GrepCode? Check out our FAQ X