Search in sources :

Example 1 with IdlType

use of org.apache.cxf.tools.corba.common.idltypes.IdlType in project cxf by apache.

the class WSDLToIDLAction method createStruct.

private IdlType createStruct(Struct s, IdlScopeBase scope, String local) throws Exception {
    boolean undefinedCircular = false;
    IdlStruct struct = IdlStruct.create(scope, local);
    scope.holdForScope(struct);
    for (MemberType m : s.getMember()) {
        QName qname = m.getIdltype();
        IdlType type = findType(qname);
        if (!undefinedCircular && !(type instanceof IdlSequence)) {
            String mlocal = qname.getLocalPart();
            String[] mname = unscopeName(mlocal);
            undefinedCircular = null != root.lookup(mname, true);
        }
        struct.addToScope(IdlField.create(struct, m.getName(), type));
    }
    if (undefinedCircular) {
        scope.parkHeld();
    } else {
        scope.promoteHeldToScope();
        if (struct.isCircular()) {
            // resolving this struct closed a recursion
            scope.flush();
        }
    }
    return struct;
}
Also used : IdlStruct(org.apache.cxf.tools.corba.common.idltypes.IdlStruct) IdlSequence(org.apache.cxf.tools.corba.common.idltypes.IdlSequence) MemberType(org.apache.cxf.binding.corba.wsdl.MemberType) QName(javax.xml.namespace.QName) IdlString(org.apache.cxf.tools.corba.common.idltypes.IdlString) IdlType(org.apache.cxf.tools.corba.common.idltypes.IdlType)

Example 2 with IdlType

use of org.apache.cxf.tools.corba.common.idltypes.IdlType in project cxf by apache.

the class WSDLToIDLAction method checkAnon.

private IdlType checkAnon(CorbaType corbaTypeImpl, IdlScopeBase scope, String local) throws Exception {
    IdlType result = null;
    if (corbaTypeImpl instanceof Anonstring) {
        Anonstring as = (Anonstring) corbaTypeImpl;
        Long lbound = as.getBound();
        int bound = lbound.intValue();
        result = IdlString.create(bound);
    }
    return result;
}
Also used : IdlType(org.apache.cxf.tools.corba.common.idltypes.IdlType) Anonstring(org.apache.cxf.binding.corba.wsdl.Anonstring)

Example 3 with IdlType

use of org.apache.cxf.tools.corba.common.idltypes.IdlType in project cxf by apache.

the class WSDLToIDLAction method createUnion.

private IdlType createUnion(Union u, IdlScopeBase scope, String local) throws Exception {
    boolean undefinedCircular = false;
    IdlType disc = findType(u.getDiscriminator());
    IdlUnion union = IdlUnion.create(scope, local, disc);
    scope.holdForScope(union);
    for (Unionbranch ub : u.getUnionbranch()) {
        QName qname = ub.getIdltype();
        IdlType bt = findType(qname);
        boolean isDefault = false;
        if (ub.isSetDefault()) {
            isDefault = ub.isDefault();
        }
        IdlUnionBranch b = IdlUnionBranch.create(union, ub.getName(), bt, isDefault);
        for (CaseType cs : ub.getCase()) {
            b.addCase(cs.getLabel());
        }
        if (!undefinedCircular && !(bt instanceof IdlSequence)) {
            String mlocal = qname.getLocalPart();
            String[] mname = unscopeName(mlocal);
            undefinedCircular = null != root.lookup(mname, true);
        }
        union.addBranch(b);
    }
    if (undefinedCircular) {
        scope.parkHeld();
    } else {
        scope.promoteHeldToScope();
        if (union.isCircular()) {
            // resolving this union closed a recursion
            scope.flush();
        }
    }
    return union;
}
Also used : IdlUnionBranch(org.apache.cxf.tools.corba.common.idltypes.IdlUnionBranch) IdlSequence(org.apache.cxf.tools.corba.common.idltypes.IdlSequence) CaseType(org.apache.cxf.binding.corba.wsdl.CaseType) QName(javax.xml.namespace.QName) IdlString(org.apache.cxf.tools.corba.common.idltypes.IdlString) IdlType(org.apache.cxf.tools.corba.common.idltypes.IdlType) IdlUnion(org.apache.cxf.tools.corba.common.idltypes.IdlUnion) Unionbranch(org.apache.cxf.binding.corba.wsdl.Unionbranch)

Example 4 with IdlType

use of org.apache.cxf.tools.corba.common.idltypes.IdlType in project cxf by apache.

the class WSDLToIDLAction method createTypedef.

private IdlType createTypedef(Alias a, IdlScopeBase scope, String local) throws Exception {
    IdlType idlType = null;
    IdlType base = findType(a.getBasetype());
    idlType = IdlTypedef.create(scope, local, base);
    scope.addToScope(idlType);
    return idlType;
}
Also used : IdlType(org.apache.cxf.tools.corba.common.idltypes.IdlType)

Example 5 with IdlType

use of org.apache.cxf.tools.corba.common.idltypes.IdlType in project cxf by apache.

the class WSDLToIDLAction method createArray.

private IdlType createArray(Array s, IdlScopeBase scope, String local) throws Exception {
    IdlType idlType = null;
    IdlType base = findType(s.getElemtype());
    int bound = (int) s.getBound();
    idlType = IdlArray.create(scope, local, base, bound);
    scope.addToScope(idlType);
    return idlType;
}
Also used : IdlType(org.apache.cxf.tools.corba.common.idltypes.IdlType)

Aggregations

IdlType (org.apache.cxf.tools.corba.common.idltypes.IdlType)17 IdlString (org.apache.cxf.tools.corba.common.idltypes.IdlString)8 IdlException (org.apache.cxf.tools.corba.common.idltypes.IdlException)6 QName (javax.xml.namespace.QName)5 IdlDefn (org.apache.cxf.tools.corba.common.idltypes.IdlDefn)4 IdlSequence (org.apache.cxf.tools.corba.common.idltypes.IdlSequence)3 MemberType (org.apache.cxf.binding.corba.wsdl.MemberType)2 IdlStruct (org.apache.cxf.tools.corba.common.idltypes.IdlStruct)2 IdlUnion (org.apache.cxf.tools.corba.common.idltypes.IdlUnion)2 Binding (javax.wsdl.Binding)1 Alias (org.apache.cxf.binding.corba.wsdl.Alias)1 Anonarray (org.apache.cxf.binding.corba.wsdl.Anonarray)1 Anonfixed (org.apache.cxf.binding.corba.wsdl.Anonfixed)1 Anonsequence (org.apache.cxf.binding.corba.wsdl.Anonsequence)1 Anonstring (org.apache.cxf.binding.corba.wsdl.Anonstring)1 ArgType (org.apache.cxf.binding.corba.wsdl.ArgType)1 Array (org.apache.cxf.binding.corba.wsdl.Array)1 CaseType (org.apache.cxf.binding.corba.wsdl.CaseType)1 Const (org.apache.cxf.binding.corba.wsdl.Const)1 CorbaType (org.apache.cxf.binding.corba.wsdl.CorbaType)1