Search in sources :

Example 1 with DefinedType

use of org.apache.axis.wsdl.symbolTable.DefinedType 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 2 with DefinedType

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

the class SOAPUtil method toDefinedType.

private static DefinedType toDefinedType(TempType tt) {
    if (tt.isArray) {
        tt.isArray = false;
        DefinedType ref = toDefinedType(tt);
        String type = ref.getQName().getLocalPart();
        if (type.startsWith("ArrayOf"))
            type = "ArrayOf" + type;
        else
            type = "ArrayOf:" + type;
        QName qn = StringUtil.isEmpty(tt.namespace) ? new QName(type) : new QName(tt.namespace, type);
        DefinedType dt = new DefinedType(qn, tt.parent);
        dt.setRefType(ref);
    }
    QName qn = StringUtil.isEmpty(tt.namespace) ? new QName(tt.type) : new QName(tt.namespace, tt.type);
    DefinedType dt = new DefinedType(qn, tt.parent);
    dt.setBaseType(false);
    // children
    if (tt.children != null && tt.children.size() > 0) {
        dt.setContainedElements(toTypes(tt.children, true));
    }
    return dt;
}
Also used : QName(javax.xml.namespace.QName) DefinedType(org.apache.axis.wsdl.symbolTable.DefinedType)

Aggregations

DefinedType (org.apache.axis.wsdl.symbolTable.DefinedType)2 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 Vector (java.util.Vector)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 ElementDecl (org.apache.axis.wsdl.symbolTable.ElementDecl)1 TypeEntry (org.apache.axis.wsdl.symbolTable.TypeEntry)1