Search in sources :

Example 1 with ElementDecl

use of org.apache.axis.wsdl.symbolTable.ElementDecl in project Lucee by lucee.

the class AxisUtil method getContainedElement.

public static TypeEntry getContainedElement(TypeEntry type, String name, TypeEntry defaultValue) {
    if (type == null)
        return defaultValue;
    Vector v = type.getContainedElements();
    if (v != null) {
        Iterator it = v.iterator();
        ElementDecl ed;
        String tmp;
        while (it.hasNext()) {
            ed = (ElementDecl) it.next();
            if (ed.getQName() == null)
                continue;
            tmp = lucee.runtime.type.util.ListUtil.last(ed.getQName().getLocalPart(), '>');
            if (tmp.equalsIgnoreCase(name))
                return ed.getType();
        }
    }
    return defaultValue;
}
Also used : Iterator(java.util.Iterator) ElementDecl(org.apache.axis.wsdl.symbolTable.ElementDecl) Vector(java.util.Vector)

Example 2 with ElementDecl

use of org.apache.axis.wsdl.symbolTable.ElementDecl in project Lucee by lucee.

the class Axis1Client method _mapComplex.

private Class _mapComplex(PageContext pc, SymbolTable symbolTable, Config secondChanceConfig, org.apache.axis.encoding.TypeMapping tm, TypeEntry type) throws PageException {
    // extension
    Class ex = null;
    if (type instanceof DefinedType) {
        DefinedType dt = (DefinedType) type;
        TypeEntry exType = dt.getComplexTypeExtensionBase(symbolTable);
        if (exType != null)
            ex = map(pc, symbolTable, secondChanceConfig, tm, exType);
    }
    Vector children = type.getContainedElements();
    ArrayList<ASMPropertyImpl> properties = new ArrayList<ASMPropertyImpl>();
    if (children != null) {
        Iterator it = children.iterator();
        ElementDecl el;
        Class clazz;
        TypeEntry t;
        String name;
        while (it.hasNext()) {
            clazz = null;
            el = (ElementDecl) it.next();
            t = el.getType();
            Vector els = t.getContainedElements();
            // again handle children
            if (els != null) {
                clazz = mapComplex(pc, symbolTable, secondChanceConfig, tm, t);
            }
            name = lucee.runtime.type.util.ListUtil.last(el.getQName().getLocalPart(), '>');
            if (clazz == null)
                clazz = tm.getClassForQName(t.getQName());
            if (clazz == null)
                clazz = Object.class;
            properties.add(new ASMPropertyImpl(clazz, name));
        }
    }
    ASMProperty[] props = properties.toArray(new ASMProperty[properties.size()]);
    String clientClassName = getClientClassName(type, props);
    Class pojo;
    if (pc == null)
        pojo = ComponentUtil.getComponentPropertiesClass(secondChanceConfig, clientClassName, props, ex);
    else
        pojo = ComponentUtil.getClientComponentPropertiesClass(pc, clientClassName, props, ex);
    TypeMappingUtil.registerBeanTypeMapping(tm, pojo, type.getQName());
    return pojo;
}
Also used : ArrayList(java.util.ArrayList) DefinedType(org.apache.axis.wsdl.symbolTable.DefinedType) ElementDecl(org.apache.axis.wsdl.symbolTable.ElementDecl) TypeEntry(org.apache.axis.wsdl.symbolTable.TypeEntry) ASMProperty(lucee.transformer.bytecode.util.ASMProperty) ASMPropertyImpl(lucee.transformer.bytecode.util.ASMPropertyImpl) KeyIterator(lucee.runtime.type.it.KeyIterator) KeyAsStringIterator(lucee.runtime.type.it.KeyAsStringIterator) ObjectsIterator(lucee.runtime.type.it.ObjectsIterator) Iterator(java.util.Iterator) ObjectsEntryIterator(lucee.runtime.type.it.ObjectsEntryIterator) Vector(java.util.Vector)

Example 3 with ElementDecl

use of org.apache.axis.wsdl.symbolTable.ElementDecl in project Lucee by lucee.

the class SOAPUtil method toTypes.

private static Vector toTypes(List<TempType> res, boolean contained) {
    Iterator<TempType> it = res.iterator();
    Vector types = new Vector();
    Type t;
    TempType tt;
    Object o;
    while (it.hasNext()) {
        tt = it.next();
        o = t = toType(tt);
        if (contained)
            o = new ElementDecl(t, new QName(tt.name));
        types.add(o);
    }
    return types;
}
Also used : DefinedType(org.apache.axis.wsdl.symbolTable.DefinedType) BaseType(org.apache.axis.wsdl.symbolTable.BaseType) Type(org.apache.axis.wsdl.symbolTable.Type) QName(javax.xml.namespace.QName) ElementDecl(org.apache.axis.wsdl.symbolTable.ElementDecl) Vector(java.util.Vector)

Aggregations

Vector (java.util.Vector)3 ElementDecl (org.apache.axis.wsdl.symbolTable.ElementDecl)3 Iterator (java.util.Iterator)2 DefinedType (org.apache.axis.wsdl.symbolTable.DefinedType)2 ArrayList (java.util.ArrayList)1 QName (javax.xml.namespace.QName)1 KeyAsStringIterator (lucee.runtime.type.it.KeyAsStringIterator)1 KeyIterator (lucee.runtime.type.it.KeyIterator)1 ObjectsEntryIterator (lucee.runtime.type.it.ObjectsEntryIterator)1 ObjectsIterator (lucee.runtime.type.it.ObjectsIterator)1 ASMProperty (lucee.transformer.bytecode.util.ASMProperty)1 ASMPropertyImpl (lucee.transformer.bytecode.util.ASMPropertyImpl)1 BaseType (org.apache.axis.wsdl.symbolTable.BaseType)1 Type (org.apache.axis.wsdl.symbolTable.Type)1 TypeEntry (org.apache.axis.wsdl.symbolTable.TypeEntry)1