Examples of Struct


Examples of org.apache.cxf.binding.corba.wsdl.Struct

                         fx.getName());
                    assertEquals("Type is incorrect for AnonFixed Type", "decimal",
                         fx.getType().getLocalPart());
           
                } else if (type instanceof Struct) {
                    Struct struct = (Struct)type;
                    String[] testResult;
                    if ("X.op_a".equals(struct.getName())) {
                        testResult = new String[]{"X.op_a", "X.op_a", "p1",
                            "X.S", "p2", "X.S"};
                    } else if ("X.op_aResult".equals(struct.getName())) {
                        testResult = new String[]{"X.op_aResult",
                            "X.op_aResult", "return", "X.S", "p2", "X.S"};
                    } else {
                        testResult = new String[]{"X.S", "X.S", "str",
                            "X._1_S", "fx", "X._2_S"};
                    }
                    assertEquals("Name is incorrect for Anon Array Type",
                        testResult[0],
                        struct.getName());           
                    assertEquals("Type is incorrect for Struct Type",
                        testResult[1],
                        struct.getType().getLocalPart());
                    assertEquals("Name for first Struct Member Type is incorrect",
                        testResult[2],
                        struct.getMember().get(0).getName());
                    assertEquals("Idltype for first Struct Member Type is incorrect",
                        testResult[3],
                        struct.getMember().get(0).getIdltype().getLocalPart());           
                    assertEquals("Name for second Struct Member Type is incorrect",
                        testResult[4],
                        struct.getMember().get(1).getName());
                    assertEquals("Idltype for second Struct Member Type is incorrect",
                        testResult[5],
                        struct.getMember().get(1).getIdltype().getLocalPart());
                } else {
                    //System.err.println("Type: " + i + " " + type.getClass().getName());
                }
            }   
            File f = new File("atype.idl");
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.Struct

        } else {
            seqName = createQNameCorbaNamespace(schemaTypeName.getLocalPart() + "SequenceStruct");
        }

        schemaTypeName = checkPrefix(schemaTypeName);
        Struct struct = new Struct();
        struct.setName(seqName.getLocalPart());
        struct.setQName(seqName);
        struct.setRepositoryID(REPO_STRING + seqName.getLocalPart().replace('.', '/') + IDL_VERSION);
        struct.setType(schemaTypeName);

        List members = processContainerAsMembers(seq, defaultName, schemaTypeName);
        for (Iterator iterator = members.iterator(); iterator.hasNext();) {
            MemberType memberType = (MemberType)iterator.next();
            struct.getMember().add(memberType);
        }

        type = struct;

        if (seq.getMaxOccurs() != 1 || seq.getMinOccurs() != 1) {
            QName name = createQNameTargetNamespace(type.getQName().getLocalPart() + "Array");
            CorbaTypeImpl atype = createArray(name, type.getQName(), type.getQName(),
                                              seq.getMaxOccurs(), seq.getMinOccurs(), false);

            if (atype != null
                && !isDuplicate(atype)) {
                typeMappingType.getStructOrExceptionOrUnion().add(atype);
            }
        }

        if ((type instanceof Struct) && (struct.getMember().size() == 0)) {
            String msgStr = "Cannot create CORBA Struct" + struct.getName()
                            + "from container with no members";
            org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(
                                      msgStr, LOG);
            throw new Exception(msg.toString());
        }
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.Struct


    protected CorbaTypeImpl processAllType(XmlSchemaAll seq, QName defaultName,
                                           QName schematypeName) throws Exception {
        QName allName = null;
        Struct type = null;

        if (schematypeName == null) {
            allName = createQNameCorbaNamespace(defaultName.getLocalPart() + "AllStruct");
        } else {
            allName = createQNameCorbaNamespace(schematypeName.getLocalPart() + "AllStruct");
        }

        type = new Struct();
        type.setName(allName.getLocalPart());
        type.setQName(allName);
        type.setType(schematypeName);

        List members = processContainerAsMembers(seq, defaultName, schematypeName);
        for (Iterator iterator = members.iterator(); iterator.hasNext();) {
            MemberType memberType = (MemberType)iterator.next();
            type.getMember().add(memberType);
        }

        String repoId = REPO_STRING + type.getQName().getLocalPart().replace('.', '/') + IDL_VERSION;
        type.setRepositoryID(repoId);
        return type;
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.Struct


    private CorbaTypeImpl processStruct(XmlSchemaComplexType complex, QName defaultName)
        throws Exception {
        QName name;
        Struct corbaStruct = null;
        QName schematypeName = checkPrefix(complex.getQName());
        if (schematypeName == null) {
            schematypeName = createQNameTargetNamespace(defaultName.getLocalPart());
            if (defaultName.getNamespaceURI().equals("")) {
                schematypeName = checkPrefix(schematypeName);
            } else {
                schematypeName = checkPrefix(defaultName);
            }
            name = checkPrefix(createQNameCorbaNamespace(defaultName.getLocalPart()));
        } else {
            name = checkPrefix(createQNameCorbaNamespace(schematypeName.getLocalPart()));
        }

        corbaStruct = (Struct)recursionMap.get(name);
        if (corbaStruct != null) {
            return corbaStruct;
        }

        corbaStruct = new Struct();
        corbaStruct.setName(name.getLocalPart());
        corbaStruct.setQName(name);
        String repoId = REPO_STRING + name.getLocalPart().replace('.', '/') + IDL_VERSION;
        corbaStruct.setRepositoryID(repoId);
        corbaStruct.setType(schematypeName);


        recursionMap.put(name, corbaStruct);

        if (complex.getContentModel() instanceof XmlSchemaSimpleContent) {
            corbaStruct = processSimpleContentStruct((XmlSchemaSimpleContent)complex.getContentModel(),
                                                     defaultName, corbaStruct, schematypeName);
        } else if (complex.getContentModel() instanceof XmlSchemaComplexContent) {
            corbaStruct = processComplexContentStruct((XmlSchemaComplexContent)complex.getContentModel(),
                                                      defaultName, corbaStruct, schematypeName);
        }

        // Process attributes at ComplexType level
        if (!complex.getAttributes().isEmpty()) {
            String uri;
            if (schematypeName != null) {
                uri = schematypeName.getNamespaceURI();
            } else {
                uri = defaultName.getNamespaceURI();
            }
            List attlist2 = processAttributesAsMembers(complex.getAttributes(), uri);
            for (int i = 0; i < attlist2.size(); i++) {
                MemberType member = (MemberType)attlist2.get(i);
                corbaStruct.getMember().add(member);
            }
        }

        if (complex.getParticle() != null) {
            List members = processContainerAsMembers(complex.getParticle(), defaultName, schematypeName);

            for (Iterator it = members.iterator(); it.hasNext();) {
                MemberType memberType = (MemberType)it.next();
                corbaStruct.getMember().add(memberType);
            }
        }

        recursionMap.remove(name);
View Full Code Here

Examples of org.apache.etch.compiler.ast.Struct

   
    Named<?> named = p.type().getNamed( service );
    if (named == null || !named.isStruct())
      return null;
   
    Struct s = (Struct) named;
   
    p = s.getParameter( name );
    if (p == null)
      return null;
   
    return getField( service, p, path );
  }
View Full Code Here

Examples of org.apache.etch.compiler.ast.Struct

      // Allow subclassing for etch defined structs and externs.

      if (n.isStruct() || n.isExcept()) {
        if (n.isStruct()) {
          Struct s = (Struct) n;
          return String.format(
              "EtchValidatorCustom::Get(runtime, %d, %s::TYPE(), true, tmpValue);",
              type.dim(), s
              .service().name() + "::" + n.efqname(this));
        }
        Except e = (Except) n;
        return String.format(
            "EtchValidatorCustom::Get(runtime, %d, %s::TYPE(), true, tmpValue);", type.dim(), e
View Full Code Here

Examples of org.apache.kafka.common.protocol.types.Struct

    private final String groupId;
    private final List<TopicPartition> partitions;

    public OffsetFetchRequest(String groupId, List<TopicPartition> partitions) {
        super(new Struct(curSchema));

        Map<String, List<Integer>> topicsData = CollectionUtils.groupDataByTopic(partitions);

        struct.set(GROUP_ID_KEY_NAME, groupId);
        List<Struct> topicArray = new ArrayList<Struct>();
        for (Map.Entry<String, List<Integer>> entries: topicsData.entrySet()) {
            Struct topicData = struct.instance(TOPICS_KEY_NAME);
            topicData.set(TOPIC_KEY_NAME, entries.getKey());
            List<Struct> partitionArray = new ArrayList<Struct>();
            for (Integer partiitonId : entries.getValue()) {
                Struct partitionData = topicData.instance(PARTITIONS_KEY_NAME);
                partitionData.set(PARTITION_KEY_NAME, partiitonId);
                partitionArray.add(partitionData);
            }
            topicData.set(PARTITIONS_KEY_NAME, partitionArray.toArray());
            topicArray.add(topicData);
        }
View Full Code Here

Examples of org.apache.qpid.transport.Struct

            MessageProperties messageProperties = null;
            List<Struct> otherProps = null;

            for(int i = 0 ; i < headerCount; i++)
            {
                Struct struct = decoder.readStruct32();
                if(struct instanceof DeliveryProperties && deliveryProperties == null)
                {
                    deliveryProperties = (DeliveryProperties) struct;
                }
                else if(struct instanceof MessageProperties && messageProperties == null)
View Full Code Here

Examples of org.apache.qpid.transport.Struct

            MessageProperties messageProperties = null;
            List<Struct> otherProps = null;

            for(int i = 0 ; i < headerCount; i++)
            {
                Struct struct = decoder.readStruct32();
                if(struct instanceof DeliveryProperties && deliveryProperties == null)
                {
                    deliveryProperties = (DeliveryProperties) struct;
                }
                else if(struct instanceof MessageProperties && messageProperties == null)
View Full Code Here

Examples of org.apache.schemas.yoko.bindings.corba.Struct

            assertEquals("Name is incorrect for Anon Array Type", "X._2_S",
                         fx.getName());
            assertEquals("Type is incorrect for AnonFixed Type", "decimal",
                         fx.getType().getLocalPart());
           
            Struct struct = (Struct)mapType.getStructOrExceptionOrUnion().get(1);
            assertEquals("Name is incorrect for Anon Array Type", "X.S",
                         struct.getName());           
            assertEquals("Type is incorrect for Struct Type", "X.S",
                         struct.getType().getLocalPart());
            assertEquals("Name for first Struct Member Type is incorrect", "str",
                         struct.getMember().get(0).getName());
            assertEquals("Idltype for first Struct Member Type is incorrect", "X._1_S",
                         struct.getMember().get(0).getIdltype().getLocalPart());           
            assertEquals("Name for second Struct Member Type is incorrect", "fx",
                         struct.getMember().get(1).getName());
            assertEquals("Idltype for second Struct Member Type is incorrect", "X._2_S",
                         struct.getMember().get(1).getIdltype().getLocalPart());
           
            File f = new File("atype.idl");
            assertTrue("atype.idl should be generated", f.exists());
        } finally {
            new File("atype.idl").deleteOnExit();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.