Examples of ElementInfo


Examples of com.google.wave.api.data.ApiView.ElementInfo

        LineContainers.debugContainerWrap("some text<gadget></gadget>"));
    ApiView api = new ApiView(document, mock(Wavelet.class));
    api.insert(3, new Image("id", "caption"));
    List<ElementInfo> apiElements = api.getElements();
    for (int i = 0; i < apiElements.size(); i++) {
      ElementInfo info = apiElements.get(i);
      assertEquals(info.xmlPosition, api.transformToXmlOffset(info.apiPosition));
    }
    assertInSync(document, api);
  }
View Full Code Here

Examples of com.google.wave.api.data.ApiView.ElementInfo

    assertEquals(alt.apiContents(), api.apiContents());
    List<ElementInfo> apiElements = api.getElements();
    List<ElementInfo> altElements = alt.getElements();
    assertEquals(altElements.size(), apiElements.size());
    for (int i = 0; i < apiElements.size(); i++) {
      ElementInfo altInfo = altElements.get(i);
      ElementInfo apiInfo = apiElements.get(i);
      assertEquals(altInfo.element.getType(), apiInfo.element.getType());
      assertEquals(altInfo.apiPosition, apiInfo.apiPosition);
      assertEquals(altInfo.xmlPosition, apiInfo.xmlPosition);
    }
  }
View Full Code Here

Examples of com.sun.xml.bind.v2.model.core.ElementInfo

        boolean nillable = false; // default value

        QName name = elem.getElementName();
        Namespace n = getNamespace(name.getNamespaceURI());
        ElementInfo ei;

        if (elem.getScope() != null) { // (probably) never happens
            ei = this.types.getElementInfo(elem.getScope().getClazz(), name);
        } else {
            ei = this.types.getElementInfo(null, name);
        }

        XmlElement xmlElem = ei.getProperty().readAnnotation(XmlElement.class);

        if (xmlElem == null) {
            nillable = false;
        } else {
            nillable = xmlElem.nillable();
View Full Code Here

Examples of com.sun.xml.internal.bind.v2.model.core.ElementInfo

        return addGenericElement(parent.owner.getElementInfo(parent.getClazz(),new QName(nsUri,r.name())));
    }

    private boolean addGenericElement(XmlElementRef r, ReferencePropertyInfoImpl<T,C,F,M> info) {
        String nsUri = info.getEffectiveNamespaceFor(r);
        ElementInfo ei = parent.owner.getElementInfo(info.parent.getClazz(), new QName(nsUri, r.name()));
        types.add(ei);
        return true;
    }
View Full Code Here

Examples of gov.nasa.jpf.vm.ElementInfo

        } catch (ClassInfoException e){
          System.out.println("WARNING: the class " + JVMCls + " is ignored!");
          return MJIEnv.NULL;
        }

        ElementInfo ei = env.getHeap().newObject(fci, env.getThreadInfo());
        JPFRef = ei.getObjectRef();
       
        this.updateJPFNonArrObj(JVMObj, JPFRef, env);
      }
    } else{
      JPFRef = Utilities.createNewJPFArray(JVMObj, env);
View Full Code Here

Examples of org.apache.axis.wsdl.wsdl2ws.info.ElementInfo

            ((QName)attributes.get(j + 1)).getLocalPart(),
          createTypeInfo(((TypeEntry) attributes.get(j)).getQName(),targetLanguage));
        }
      }     
    }else if(type instanceof CollectionType){
      typedata.setTypeNameForElementName(new ElementInfo(type.getQName(),
          createTypeInfo(type.getRefType().getQName(),targetLanguage)));
      typedata.setArray(true);
    }else{
      //is this a SOAPEnc array type 
      QName arrayType =
        SchemaUtils.getArrayComponentQName(node, new IntHolder(0));
      if (arrayType != null) {
        typedata.setTypeNameForElementName(new ElementInfo(new QName("item"),
            createTypeInfo(arrayType,targetLanguage)));
        typedata.setArray(true);
      } else if (
        (arrayType = SchemaUtils.getCollectionComponentQName(node))
          != null) {
        typedata.setTypeNameForElementName(new ElementInfo(new QName("item"),
            createTypeInfo(arrayType,targetLanguage)));
        typedata.setArray(true);
      }
      //Note in a array the parameter type is stored as under the name item all the time 
      else {
        // get all extended types
        Vector extendList = new Vector();
        extendList.add(type);
        TypeEntry parent = SchemaUtils.getComplexElementExtensionBase(
                            type.getNode(),symbolTable);
        while(parent != null) {
          extendList.add(parent);
          parent = SchemaUtils.getComplexElementExtensionBase(
                        parent.getNode(),symbolTable);
        }
   
        // Now generate a list of names and types starting with
        // the oldest parent.  (Attrs are considered before elements).
        for (int i=extendList.size()-1; i >= 0; i--) {
          TypeEntry te = (TypeEntry) extendList.elementAt(i);
   
         
          //TODO the code require the attributes name at extension base types
          //different, the WSDL2Ws do not support it having same name at up and below.
         
          // The names of the inherited parms are mangled
          // in case they interfere with local parms.
          String mangle = "";
          //if (i > 0) {
          //  mangle = "_" +
          //    Utils.xmlNameToJava(te.getQName().getLocalPart()) +
          //    "_";
          //}
         
          // Process the attributes
          Vector attributes = SchemaUtils.getContainedAttributeTypes(
            te.getNode(), symbolTable);
          if (attributes != null) {
            for (int j=0; j<attributes.size(); j+=2) {
              typedata.setTypeForAttributeName(
                ((QName)attributes.get(j + 1)).getLocalPart(),
              createTypeInfo(((TypeEntry) attributes.get(j)).getQName(),targetLanguage));
            }
          }
          // Process the elements
          Vector elements = SchemaUtils.getContainedElementDeclarations(
                      te.getNode(), symbolTable);
          if (elements != null) {
            for (int j=0; j<elements.size(); j++) {
              ElementInfo eleinfo = null;
              ElementDecl elem = (ElementDecl)elements.get(j);
              if (elem.getAnyElement()){
                System.out.println("Any Type found inside "+ type.getQName().toString());
                Type anyType = new Type(CUtils.anyTypeQname, CUtils.anyTypeQname.getLocalPart(), true, targetLanguage);
                eleinfo = new ElementInfo(elem.getName(),anyType);             
              }
              else{
                QName typeName = elem.getType().getQName();
                if(typeName.getLocalPart().indexOf('[')>0){
                  String localpart = typeName.getLocalPart().substring(0,typeName.getLocalPart().indexOf('['));
                  typeName = new QName(typeName.getNamespaceURI(),localpart);
                  if (CUtils.isBasicType(typeName)){
                    eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));
                  }
                  else{
                    eleinfo = new ElementInfo(elem.getName(),createTypeInfo(elem.getType(),targetLanguage));
                  }
                }
                else{
                  eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));               
                }
              }
              eleinfo.setMinOccurs(elem.getMinOccrs());
              eleinfo.setMaxOccurs(elem.getMaxOccurs());
              typedata.setTypeNameForElementName(eleinfo);
            }     
          }
        }
      }
View Full Code Here

Examples of org.apache.axis.wsdl.wsdl2ws.info.ElementInfo

    }

    for (int i = intAttrFieldSz ; i < intAttrFieldSz+intEleFieldSz; i++) {
      this.attribs[i] = new AttributeInfo();
      this.attribs[i].setParamName((String) elementfeilds.get(i-attributeParamCount));  
      ElementInfo elem = type.getElementForElementName(this.attribs[i].getParamName());
      Type elementType = elem.getType();
      if(CUtils.isAnyType(elementType.getName())){
        this.attribs[i].setAnyType(true);
      }
      if(CUtils.isSimpleType(elementType.getName()))
        this.attribs[i].setTypeName(CUtils.getclass4qname(elementType.getName()));
      else{
        this.attribs[i].setTypeName(elementType.getLanguageSpecificName());
        this.attribs[i].setSimpleType(false);
      }
      this.attribs[i].setType(elementType);
      this.attribs[i].setElementName(elem.getName());
         if(elementType.isArray()){ //soap encoding arrays.
        Type arrayType = WrapperUtils.getArrayType(elementType); //get contained type
        this.attribs[i].setArray(true);
        if(CUtils.isSimpleType(arrayType.getName())){
          this.attribs[i].setTypeName(CUtils.getclass4qname(arrayType.getName()));
          this.attribs[i].setSimpleType(true);
        }
        else{
          this.attribs[i].setTypeName(arrayType.getLanguageSpecificName());
          this.attribs[i].setSimpleType(false);
        }
        this.attribs[i].setType(arrayType); //set contained type as type
       }else if (elem.getMaxOccurs() > 1){
           //arrays but the same type as was set above
        this.attribs[i].setArray(true);
       }
       if (elem.getMinOccurs() == 0) this.attribs[i].setOptional(true);
   
   }
View Full Code Here

Examples of org.apache.axis.wsdl.wsdl2ws.info.ElementInfo

     * @param type
     */
    private void addOutputElementsToMethodInfo(MethodInfo minfo, Type type)
    {
        ParameterInfo pinfo;
        ElementInfo eleinfo;
        ArrayList elementlist = new ArrayList();
        Iterator names = type.getElementnames();
        while (names.hasNext())
        {
            elementlist.add(names.next());
        }
        Type innerType;
        for (int i = 0; i < elementlist.size(); i++)
        {
            String elementname = (String) elementlist.get(i);
            eleinfo = type.getElementForElementName(elementname);
            innerType = eleinfo.getType();
            pinfo = new ParameterInfo(innerType, elementname);
            if (eleinfo.getMaxOccurs() > 1)
            {
                pinfo.setArray(true);
            }
            pinfo.setElementName(
                type.getElementForElementName(elementname).getName());
View Full Code Here

Examples of org.apache.axis.wsdl.wsdl2ws.info.ElementInfo

     * @param type
     */
    private void addInputElementsToMethodInfo(MethodInfo minfo, Type type)
    {
        ParameterInfo pinfo;
        ElementInfo eleinfo;
        Iterator elementNames = type.getElementnames();
        ArrayList elementlist = new ArrayList();
        while (elementNames.hasNext())
        {
            elementlist.add(elementNames.next());
        }

        for (int i = 0; i < elementlist.size(); i++)
        {
            String elementname = (String) elementlist.get(i);
            eleinfo = type.getElementForElementName(elementname);
            Type innerType = eleinfo.getType();
            pinfo = new ParameterInfo(innerType, elementname);
            if (eleinfo.getMaxOccurs() > 1)
            {
                pinfo.setArray(true);
            }
            pinfo.setElementName(
                type.getElementForElementName(elementname).getName());
View Full Code Here

Examples of org.apache.axis.wsdl.wsdl2ws.info.ElementInfo

            if (base != null)
            {
                String localpart = type.getQName().getLocalPart() + "_value";
                QName typeName =
                    new QName(type.getQName().getNamespaceURI(), localpart);
                ElementInfo eleinfo =
                    new ElementInfo(
                        typeName,
                        createTypeInfo(base.getQName(), targetLanguage));
                typedata.setExtensionBaseType(eleinfo);
                if (WSDL2Ws.verbose)
                    System.out.print(
                        "=====complexType with simpleContent is found : "
                            + type.getQName().getLocalPart()
                            + "=====\n");
            }
            else
            {
                //types declared as simpleType
                restrictdata =
                    CUtils.getRestrictionBaseAndValues(node, symbolTable);
                if (restrictdata != null)
                    typedata.setRestrictiondata(restrictdata);
            }
            // There can be attributes in this extended basic type
            // Process the attributes
            Vector attributes =
                CSchemaUtils.getContainedAttributeTypes(
                    type.getNode(),
                    symbolTable);
            if (attributes != null)
            {
                for (int j = 0; j < attributes.size(); j += 2)
                {
                    typedata.setTypeForAttributeName(
                        ((QName) attributes.get(j + 1)).getLocalPart(),
                        createTypeInfo(
                            ((TypeEntry) attributes.get(j)).getQName(),
                            targetLanguage));
                }
            }
        }
        else
            if (type instanceof CollectionType)
            {
                typedata.setTypeNameForElementName(
                    new ElementInfo(
                        type.getQName(),
                        createTypeInfo(
                            type.getRefType().getQName(),
                            targetLanguage)));
                typedata.setArray(true);
            }
            else
            {
                //is this a SOAPEnc array type 
                QName arrayType =
                    CSchemaUtils.getArrayComponentQName(
                        node,
                        new IntHolder(0),
                        symbolTable);
                if (arrayType != null)
                {
                    typedata.setTypeNameForElementName(
                        new ElementInfo(
                            new QName("item"),
                            createTypeInfo(arrayType, targetLanguage)));
                    typedata.setArray(true);
                }
                else
                    if ((arrayType =
                        CSchemaUtils.getCollectionComponentQName(node))
                        != null)
                    {
                        typedata.setTypeNameForElementName(
                            new ElementInfo(
                                new QName("item"),
                                createTypeInfo(arrayType, targetLanguage)));
                        typedata.setArray(true);
                    }
                //Note in a array the parameter type is stored as under the name item all the time 
                else
                {
                    // get all extended types
                    Vector extendList = new Vector();
                    extendList.add(type);
                    TypeEntry parent =
                        CSchemaUtils.getComplexElementExtensionBase(
                            type.getNode(),
                            symbolTable);
                    while (parent != null)
                    {
                        extendList.add(parent);
                        parent =
                            CSchemaUtils.getComplexElementExtensionBase(
                                parent.getNode(),
                                symbolTable);
                    }

                    // Now generate a list of names and types starting with
                    // the oldest parent.  (Attrs are considered before elements).
                    for (int i = extendList.size() - 1; i >= 0; i--)
                    {
                        TypeEntry te = (TypeEntry) extendList.elementAt(i);

                        //TODO the code require the attributes name at extension base types
                        //different, the WSDL2Ws do not support it having same name at up and below.

                        // The names of the inherited parms are mangled
                        // in case they interfere with local parms.
                        // String mangle = "";
                        //if (i > 0) {
                        //  mangle = "_" +
                        //    Utils.xmlNameToJava(te.getQName().getLocalPart()) +
                        //    "_";
                        //}

                        // Process the attributes
                        Vector attributes =
                            CSchemaUtils.getContainedAttributeTypes(
                                te.getNode(),
                                symbolTable);
                        if (attributes != null)
                        {
                            for (int j = 0; j < attributes.size(); j += 2)
                            {
                                typedata.setTypeForAttributeName(
                                    ((QName) attributes.get(j + 1))
                                        .getLocalPart(),
                                    createTypeInfo(
                                        ((TypeEntry) attributes.get(j))
                                            .getQName(),
                                        targetLanguage));
                            }
                        }
                        // Process the elements
                        Vector elements =
                            CSchemaUtils.getContainedElementDeclarations(
                                te.getNode(),
                                symbolTable);
                        if (elements != null)
                        {
                            for (int j = 0; j < elements.size(); j++)
                            {
                                ElementInfo eleinfo = null;
                                CElementDecl elem =
                                    (CElementDecl) elements.get(j);
                                if (elem.getAnyElement())
                                {

                                    Type anyType =
                                        new Type(
                                            CUtils.anyTypeQname,
                                            CUtils.anyTypeQname.getLocalPart(),
                                            true,
                                            targetLanguage);
                                    eleinfo =
                                        new ElementInfo(
                                            elem.getName(),
                                            anyType);
                                }
                                else
                                {
                                    QName typeName = elem.getType().getQName();
                                    if (typeName.getLocalPart().indexOf('[')
                                        > 0)
                                    {
                                        String localpart =
                                            typeName.getLocalPart().substring(
                                                0,
                                                typeName
                                                    .getLocalPart()
                                                    .indexOf(
                                                    '['));
                                        typeName =
                                            new QName(
                                                typeName.getNamespaceURI(),
                                                localpart);
                                        if (CUtils.isBasicType(typeName))
                                        {
                                            eleinfo =
                                                new ElementInfo(
                                                    elem.getName(),
                                                    createTypeInfo(
                                                        typeName,
                                                        targetLanguage));
                                        }
                                        else
                                        {
                                            eleinfo =
                                                new ElementInfo(
                                                    elem.getName(),
                                                    createTypeInfo(
                                                        elem.getType(),
                                                        targetLanguage));
                                        }
                                    }
                                    else
                                    {
                                        eleinfo =
                                            new ElementInfo(
                                                elem.getName(),
                                                createTypeInfo(
                                                    typeName,
                                                    targetLanguage));
                                    }
                                }
                                eleinfo.setMinOccurs(elem.getMinOccurs());
                                eleinfo.setMaxOccurs(elem.getMaxOccurs());
                                eleinfo.setNillable( elem.isNillable());
                                typedata.setTypeNameForElementName(eleinfo);
                            }
                        }
                    }
                }
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.