Package org.apache.axis.wsdl.symbolTable

Examples of org.apache.axis.wsdl.symbolTable.SymTabEntry


        while (it.hasNext()) {
            Vector v = (Vector) it.next();

            for (int i = 0; i < v.size(); ++i) {
                SymTabEntry entry = (SymTabEntry) v.elementAt(i);

                // Inspect each BindingEntry in the Symbol Table
                if (entry instanceof BindingEntry) {
                    BindingEntry bEntry = (BindingEntry) entry;
                    HashMap allOpFaults = bEntry.getFaults();
View Full Code Here


        while (it.hasNext()) {
            Vector v = (Vector) it.next();

            for (int i = 0; i < v.size(); ++i) {
                SymTabEntry entry = (SymTabEntry) v.elementAt(i);

                if (entry instanceof BindingEntry) {

                    // The SEI (Service Endpoint Interface) name
                    // is always the portType name.
View Full Code Here

                    resolve = false;           // Assume false

                    String name = null;

                    for (int i = 0; (i < v.size()) && !resolve; ++i) {
                        SymTabEntry entry = (SymTabEntry) v.elementAt(i);

                        if ((entry instanceof MessageEntry)
                                || (entry instanceof BindingEntry)) {                           
                            // Need to resolve a exception class name                           
                            String exceptionClassName = (String) entry.getDynamicVar(EXCEPTION_CLASS_NAME);
                            if (exceptionClassName != null) {                               
                                if (name == null) {
                                    name = exceptionClassName;
                                } else if (name.equals(exceptionClassName)) {
                                    resolve = true;
                                }
                            }
                        } else if (name == null) {
                            name = entry.getName();
                        } else if (name.equals(entry.getName())) {
                            resolve = true;    // Need to do resolution
                        }
                    }
                }

                // Full Mangle if resolution is necessary.
                if (resolve) {
                    boolean firstType = true;

                    for (int i = 0; i < v.size(); ++i) {
                        SymTabEntry entry = (SymTabEntry) v.elementAt(i);

                        if (entry instanceof Element) {
                            entry.setName(mangleName(entry.getName(), ELEMENT_SUFFIX));

                            // If this global element was defined using
                            // an anonymous type, then need to change the
                            // java name of the anonymous type to match.
                            QName anonQName =
                                    new QName(entry.getQName().getNamespaceURI(),
                                            SymbolTable.ANON_TOKEN
                                    + entry.getQName().getLocalPart());
                           
                            TypeEntry anonType =
                                    symbolTable.getType(anonQName);

                            if (anonType != null) {
                                anonType.setName(entry.getName());
                                anonTypes.add(anonType);
                            }                           
                        } else if (entry instanceof TypeEntry) {

                            // Search all other types for java names that match this one.
                            // The sameJavaClass method returns true if the java names are
                            // the same (ignores [] ).
                            if (firstType) {
                                firstType = false;

                                Iterator types =
                                        symbolTable.getTypeIndex().values().iterator();

                                while (types.hasNext()) {
                                    TypeEntry type = (TypeEntry) types.next();

                                    if ((type != entry)
                                            && (type.getBaseType() == null)
                                            && sameJavaClass(entry.getName(),
                                                    type.getName())) {
                                        v.add(type);
                                    }
                                }
                            }

                            // If this is an anonymous type, it's name was resolved in
                            // the previous if block.  Don't reresolve it.
                            if (!anonTypes.contains(entry)) {
                                // In case that other entry in name collision among
                                // PortTypeEntry, ServiceEntry and BindingEntry
                               
                                boolean needResolve = false;
                               
                                // check collision of TypeEntry with PortTypeEntry, ServiceEtnry and/or BindingEntry
                                for (int j = 0; j < v.size(); j++) {
                                    SymTabEntry e = (SymTabEntry) v.elementAt(j);
                                    if ((e instanceof PortTypeEntry
                                            || e instanceof ServiceEntry
                                            || e instanceof BindingEntry)) {
                                        needResolve = true;
                                        break;
View Full Code Here

        while (it.hasNext()) {
            Vector v = (Vector) it.next();

            for (int i = 0; i < v.size(); ++i) {
                SymTabEntry entry = (SymTabEntry) v.elementAt(i);

                if ((entry instanceof BindingEntry)
                        && ((BindingEntry) entry).getBindingType()
                        != BindingEntry.TYPE_SOAP) {
                    entry.setIsReferenced(false);
                } else {
                    entry.setIsReferenced(true);
                }
            }
        }
    }    // setAllReferencesToTrue
View Full Code Here

        while (it.hasNext()) {
            Vector v = (Vector) it.next();

            for (int i = 0; i < v.size(); ++i) {
                SymTabEntry entry = (SymTabEntry) v.elementAt(i);

                if (entry instanceof BindingEntry) {
                    BindingEntry bEntry = (BindingEntry) entry;
                    Binding binding = bEntry.getBinding();
                    PortType portType = binding.getPortType();
View Full Code Here

        while (it.hasNext()) {
            Vector v = (Vector) it.next();

            for (int i = 0; i < v.size(); ++i) {
                SymTabEntry entry = (SymTabEntry) v.elementAt(i);

                if (entry instanceof BindingEntry) {
                    BindingEntry bEntry = (BindingEntry) entry;
                    Binding binding = bEntry.getBinding();
                    PortTypeEntry ptEntry = symbolTable.getPortTypeEntry(
View Full Code Here

        HashMap anonQNames = new HashMap();
        Iterator it = symbolTable.getHashMap().values().iterator();
        while (it.hasNext()) {
            Vector v = (Vector) it.next();
            for (int i = 0; i < v.size(); ++i) {
                SymTabEntry entry = (SymTabEntry) v.elementAt(i);

                // Use the type or the referenced type's QName to generate the java name.     
                if (entry instanceof TypeEntry && entry.getName() == null) {
                    TypeEntry tEntry = (TypeEntry) entry;
                    String dims = tEntry.getDimensions();
                    TypeEntry refType = tEntry.getRefType();
                    while (refType != null) {
                        tEntry = refType;
                        dims += tEntry.getDimensions();
                        refType = tEntry.getRefType();
                    }
                   
                    // Get the QName to javify
                    QName typeQName = tEntry.getQName();
                    if ((typeQName.getLocalPart().indexOf(SymbolTable.ANON_TOKEN) >= 0) &&
                            (tEntry.getName() == null)) {
                        // This is an anonymous type name.
                        // Axis uses '>' as a nesting token to generate
                        // unique qnames for anonymous types.
                        // Only consider the localName after the last '>' when
                        // generating the java name
                        String localName = typeQName.getLocalPart();
                        localName =
                            localName.substring(
                                localName.lastIndexOf(SymbolTable.ANON_TOKEN)+1);
                        typeQName = new QName(typeQName.getNamespaceURI(), localName);
                        // If there is already an existing type, there will be a
                        // collision.  If there is an existing anon type, there will be a
                        // collision.  In both cases, the java type name should be mangled.
                        TypeEntry existing = symbolTable.getType(typeQName);
                        if (anonQNames.get(typeQName) != null) {
                            localName += "Type" + uniqueNum++;
                            typeQName = new QName(typeQName.getNamespaceURI(), localName);
                        }
                        anonQNames.put(typeQName, typeQName);
                        tEntry.setName(emitter.getJavaName(typeQName) + dims);
                    }
                    entry.setName(emitter.getJavaName(typeQName) + dims);
                }

                // If it is not a type, then use this entry's QName to generate its name.
                else {
                    entry.setName(emitter.getJavaName(entry.getQName()));
                }
            }
        }
    } // javifyNames
View Full Code Here

    private void setFaultContext(SymbolTable symbolTable) {
        Iterator it = symbolTable.getHashMap().values().iterator();
        while (it.hasNext()) {
            Vector v = (Vector) it.next();
            for (int i = 0; i < v.size(); ++i) {
                SymTabEntry entry = (SymTabEntry) v.elementAt(i);
                // Inspect each BindingEntry in the Symbol Table
                if (entry instanceof BindingEntry) {
                    BindingEntry bEntry = (BindingEntry) entry;
                    Binding binding = bEntry.getBinding();
                    // Get the associated PortType
View Full Code Here

    protected void determineInterfaceNames(SymbolTable symbolTable) {
        Iterator it = symbolTable.getHashMap().values().iterator();
        while (it.hasNext()) {
            Vector v = (Vector) it.next();
            for (int i = 0; i < v.size(); ++i) {
                SymTabEntry entry = (SymTabEntry) v.elementAt(i);
                if (entry instanceof BindingEntry) {
                    // The SEI (Service Endpoint Interface) name
                    // is normally the portType name.
                    // But the binding info MIGHT force the SEI
                    // name to be the binding name.
View Full Code Here

                // If the names are already different, no mangling is needed.
                if (resolve) {
                    resolve = false// Assume false
                    String name = null;
                    for (int i = 0; i < v.size() && !resolve; ++i) {
                        SymTabEntry entry = (SymTabEntry) v.elementAt(i);
                         if (entry instanceof MessageEntry ||
                             entry instanceof BindingEntry) {
                             ; // Don't process these
                         } else if (name== null) {
                             name = entry.getName();
                         } else if (name.equals(entry.getName())) {
                             resolve = true// Need to do resolution
                         }

                    }
                }

                // Full Mangle if resolution is necessary.
                if (resolve) {
                    boolean firstType = true;
                    for (int i = 0; i < v.size(); ++i) {
                        SymTabEntry entry = (SymTabEntry) v.elementAt(i);
                        if (entry instanceof Element) {
                            entry.setName(mangleName(entry.getName(),
                                    "_ElemType"));

                            // If this global element was defined using
                            // an anonymous type, then need to change the
                            // java name of the anonymous type to match.
                            QName anonQName = new QName(entry.getQName().getNamespaceURI(),
                                                        SymbolTable.ANON_TOKEN +
                                                        entry.getQName().getLocalPart());
                            TypeEntry anonType = symbolTable.getType(anonQName);
                            if (anonType != null) {
                                anonType.setName(entry.getName());
                                anonTypes.add(anonType);
                            }
                        }
                        else if (entry instanceof TypeEntry) {
                            // Search all other types for java names that match this one.
                            // The sameJavaClass method returns true if the java names are
                            // the same (ignores [] ).
                            if (firstType) {
                                firstType = false;
                                Vector types = symbolTable.getTypes();
                                for (int j = 0; j < types.size(); ++j) {
                                    TypeEntry type = (TypeEntry)
                                            types.elementAt(j);
                                    if (type != entry &&
                                            !(type instanceof Element) &&
                                            type.getBaseType() == null &&
                                            sameJavaClass(
                                                    ((Type) entry).getName(),
                                                    type.getName())) {
                                        v.add(type)
                                    }
                                }
                            }
                            // If this is an anonymous type, it's name was resolved in
                            // the previous if block.  Don't reresolve it.
                            if (!anonTypes.contains(entry)) {
                                entry.setName(mangleName(entry.getName(), "_Type"));
                            }
                        }
                        else if (entry instanceof PortTypeEntry) {
                            entry.setName(mangleName(entry.getName(), "_Port"));
                        }
                        else if (entry instanceof ServiceEntry) {
                            entry.setName(mangleName(entry.getName(),
                                    "_Service"));
                        }
                        // else if (entry instanceof MessageEntry) {
                        //     we don't care about messages
                        // }
                        else if (entry instanceof BindingEntry) {
                            BindingEntry bEntry = (BindingEntry) entry;

                            // If there is no literal use, then we never see a
                            // class named directly from the binding name.  They
                            // all have suffixes:  Stub, Skeleton, Impl.
                            // If there IS literal use, then the SDI will be
                            // named after the binding name, so there is the
                            // possibility of a name clash.
                            if (bEntry.hasLiteral()) {
                                entry.setName(mangleName(entry.getName(),
                                        "_Binding"));
                            }
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of org.apache.axis.wsdl.symbolTable.SymTabEntry

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.