Examples of MethodElement


Examples of com.google.dart.engine.element.MethodElement

    if (node.inSetterContext()) {
      ExecutableElement staticMethodElement = node.getStaticElement();
      Type staticType = computeArgumentType(staticMethodElement);
      recordStaticType(node, staticType);

      MethodElement propagatedMethodElement = node.getPropagatedElement();
      if (propagatedMethodElement != staticMethodElement) {
        Type propagatedType = computeArgumentType(propagatedMethodElement);
        if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
          recordPropagatedType(node, propagatedType);
        }
      }
    } else {
      ExecutableElement staticMethodElement = node.getStaticElement();
      Type staticType = computeStaticReturnType(staticMethodElement);
      recordStaticType(node, staticType);

      MethodElement propagatedMethodElement = node.getPropagatedElement();
      if (propagatedMethodElement != staticMethodElement) {
        Type propagatedType = computeStaticReturnType(propagatedMethodElement);
        if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
          recordPropagatedType(node, propagatedType);
        }
View Full Code Here

Examples of com.google.dart.engine.element.MethodElement

          staticType = intType;
        }
      }
      recordStaticType(node, staticType);

      MethodElement propagatedMethodElement = node.getPropagatedElement();
      if (propagatedMethodElement != staticMethodElement) {
        Type propagatedType = computeStaticReturnType(propagatedMethodElement);
        if (propagatedType != null && propagatedType.isMoreSpecificThan(staticType)) {
          recordPropagatedType(node, propagatedType);
        }
View Full Code Here

Examples of com.google.dart.engine.element.MethodElement

      if (propertyType != null) {
        Type returnType = propertyType.getReturnType();
        if (returnType.isDartCoreFunction()) {
          return dynamicType;
        } else if (returnType instanceof InterfaceType) {
          MethodElement callMethod = ((InterfaceType) returnType).lookUpMethod(
              FunctionElement.CALL_METHOD_NAME,
              resolver.getDefiningLibrary());
          if (callMethod != null) {
            return callMethod.getType().getReturnType();
          }
        } else if (returnType instanceof FunctionType) {
          Type innerReturnType = ((FunctionType) returnType).getReturnType();
          if (innerReturnType != null) {
            return innerReturnType;
View Full Code Here

Examples of com.google.devtools.depan.java.graph.MethodElement

  @Override
  public MethodVisitor visitMethod(int access, String name, String desc,
      String signature, String[] exceptions) {

    // the method itself
    MethodElement m = new MethodElement(desc, name, mainClass);

    JavaRelation r = null;
    if ((Opcodes.ACC_STATIC & access) != 0) {
      r = JavaRelation.STATIC_METHOD;
    } else {
View Full Code Here

Examples of com.google.devtools.depan.java.graph.MethodElement

  }

  @Override
  public void visitMethodInsn(
      int opcode, String owner, String name, String desc) {
    dl.newDep(thisElement, new MethodElement(desc, name,
      TypeNameUtil.fromInternalName(owner)), JavaRelation.CALL);
  }
View Full Code Here

Examples of org.openide.src.MethodElement

       
    this.customized_innerclass.setName(Identifier.create(neuer_Class_Name));
    this.customized_outerclass.setName(Identifier.create(TargetName));
          
    //we have to exchange the source code of all methods of the inner class
    MethodElement MElements[] = this.customized_innerclass.getMethods();
    for(int i = 0;i <= MElements.length-1;i = i+1)
     { 
      String helpstring1 = "";
      MethodElement MElement = (MethodElement) MElements[i].clone();
   
      String helpstring = MElement.getBody().toString();
      int start = 1;
      int ende = helpstring.indexOf(alter_Class_Name);
      if (ende != -1)
         {
          while(ende != -1)
           {
            helpstring1 = helpstring1 + helpstring.substring(start,ende) + neuer_Class_Name ;
            start = ende + alter_Class_Name.length() ;
            ende = helpstring.indexOf(alter_Class_Name,start);
           }
          helpstring1 = helpstring1 + helpstring.substring(start,helpstring.length());
          try {
               MElement.setBody(helpstring1);
               this.customized_innerclass.removeMethod(MElements[i])
               this.customized_innerclass.addMethod(MElement)
              }catch (Exception e){e.printStackTrace(System.out);}
                    
         }
    }
    // now we change the name in the outer class
   MethodElement MElements1[] = this.customized_outerclass.getMethods();
   for(int i = 0;i <= MElements1.length-1;i = i+1)
    { 
      String helpstring11 = "";
      MethodElement MElement1 = (MethodElement) MElements1[i].clone();
      String helpstring2 = MElement1.getBody().toString();
      int start1 = 1;
      int ende1 = helpstring2.indexOf(alter_Class_Name);
      if (ende1 != -1)
         {
           while(ende1 != -1)
             {
               helpstring11 = helpstring11 + helpstring2.substring(start1,ende1) + neuer_Class_Name;
               start1 = ende1 + alter_Class_Name.length() ;
               ende1 = helpstring2.indexOf(alter_Class_Name,start1);
             }
           helpstring11 = helpstring11 + helpstring2.substring(start1,helpstring2.length());
           try {
                MElement1.setBody(helpstring11);
                this.customized_outerclass.removeMethod(MElements1[i])
                this.customized_outerclass.addMethod(MElement1)
               }catch (Exception e){e.printStackTrace(System.out);}
         }
     }
View Full Code Here

Examples of org.openide.src.MethodElement

     // I have to take the detour over the Identifier.create, because we want to
     // insert the interfaces into the class without the package names.  
     this.customized_innerclass.addInterface(Identifier.create(newInterface.getIDLName().getName()));
     // The new interface is in the declaration now we habe to put the interface into the
     // methode getType   
     MethodElement aMethodeSrc = this.customized_innerclass.getMethod(Identifier.create("getTypes"), new Type [0]);
     MethodElement aMethodeDes = (MethodElement) aMethodeSrc.clone();
     String MethodString = aMethodeDes.getBody();
     int start = MethodString.indexOf("new Type(");
     String MethodString1 = MethodString.substring(1,start) + "new Type( " + newInterface.getIDLName().getName() + ".class),\n" + MethodString.substring(start,MethodString.length());
     this.customized_innerclass.removeMethod(aMethodeSrc);
     aMethodeDes.setBody(MethodString1);
     this.customized_innerclass.addMethod(aMethodeDes);
     // interfaces are done - now we have to add the methodes

     
   }catch(Exception e){}
View Full Code Here

Examples of org.openide.src.MethodElement

     // I have to take the detour over the Identifier.create, because we want to
     // insert the interfaces into the class without the package names.  
     this.customized_innerclass.removeInterface(Identifier.create(newInterface.getIDLName().getName()));
     // The new interface is in the declaration now we habe to put the interface into the
     // methode getType   
     MethodElement aMethodeSrc = this.customized_innerclass.getMethod(Identifier.create("getTypes"), new Type [0]);
     MethodElement aMethodeDes = (MethodElement) aMethodeSrc.clone();
     String MethodString = aMethodeDes.getBody();
     int ende = MethodString.indexOf("new Type( " + newInterface.getIDLName().getName() + ".class),\n" );
     int start = MethodString.indexOf("new Type( ",ende + 1 );
     String MethodString1 = MethodString.substring(1,ende)+ MethodString.substring(start,MethodString.length());
     this.customized_innerclass.removeMethod(aMethodeSrc);
     aMethodeDes.setBody(MethodString1);
     this.customized_innerclass.addMethod(aMethodeDes);
            
   }catch(Exception e){}
  }
View Full Code Here

Examples of org.openide.src.MethodElement

               
                // Set the default category.
                idlmethod.setCategory( "Add-in" );
               
                // Get the method element.
                MethodElement methodelement = idlmethod.getMethodElement();
               
                // Get the parameters from the method.
                MethodParameter[] methodparameter =
                methodelement.getParameters();
               
                // Create an array for the parameter description.
                IDLParameter[] idlparameter =
                new IDLParameter[ methodparameter.length ];
               
View Full Code Here

Examples of org.openide.src.MethodElement

       
        // Get method element for display argument names.
        Type[] typeParameterArgumentName = new Type[ 2 ];
        typeParameterArgumentName[ 0 ] = Type.parse( "java.lang.String" );
        typeParameterArgumentName[ 1 ] = Type.parse( "int" );
        MethodElement methodelementDisplayArgumentName =
        //oocalcaddinsdata.customized_innerclass.getMethod(
        oocalcaddinsdata.getInnerClass().getMethod(
        Identifier.create( "getDisplayArgumentName" ),
        typeParameterArgumentName );
       
        // Get method element for argument description.
        Type[] typeParameterArgumentDescription = new Type[ 2 ];
        typeParameterArgumentDescription[ 0 ] = Type.parse( "java.lang.String" );
        typeParameterArgumentDescription[ 1 ] = Type.parse( "int" );
        MethodElement methodelementArgumentDescription =
        //oocalcaddinsdata.customized_innerclass.getMethod(
        oocalcaddinsdata.getInnerClass().getMethod(
        Identifier.create( "getArgumentDescription" ),
        typeParameterArgumentDescription );
       
        // Get method element for display function names.
        Type[] typeParameterFunctionName = new Type[ 1 ];
        typeParameterFunctionName[ 0 ] = Type.parse( "java.lang.String" );
        MethodElement methodelementDisplayFunctionName =
        //oocalcaddinsdata.customized_innerclass.getMethod(
        oocalcaddinsdata.getInnerClass().getMethod(
        Identifier.create( "getDisplayFunctionName" ),
        typeParameterFunctionName );
       
        // Get method element for function description.
        Type[] typeParameterFunctionDescription = new Type[ 1 ];
        typeParameterFunctionDescription[ 0 ] = Type.parse( "java.lang.String" );
        MethodElement methodelementFunctionDescription =
        //oocalcaddinsdata.customized_innerclass.getMethod(
        oocalcaddinsdata.getInnerClass().getMethod(
        Identifier.create( "getFunctionDescription" ),
        typeParameterFunctionDescription );
       
        // Get method element for programmatic category name.
        Type[] typeParameterCategoryName = new Type[ 1 ];
        typeParameterCategoryName[ 0 ] = Type.parse( "java.lang.String" );
        MethodElement methodelementCategoryName =
        //oocalcaddinsdata.customized_innerclass.getMethod(
        oocalcaddinsdata.getInnerClass().getMethod(
        Identifier.create( "getProgrammaticCategoryName" ),
        typeParameterCategoryName );
       
        for ( int intInterfaceCounter = 0;
        intInterfaceCounter < vectorInterfaces.size();
        intInterfaceCounter++ ) {
            IDLInterface interfacedescription = ( IDLInterface )
            vectorInterfaces.elementAt( intInterfaceCounter );
            for ( int intMethodCounter = 0;
            intMethodCounter < interfacedescription.getVectorMethods().size();
            intMethodCounter++ ) {
                try {
                    IDLMethod methoddescription = ( IDLMethod )
                    interfacedescription.getVectorMethods().elementAt( intMethodCounter );
                   
                    FieldElement fieldelement = new FieldElement();
                   
                    fieldelement.setName( Identifier.create( "short" +
                    methoddescription.getMethodElement().getName().getName().toUpperCase() ) );
                   
                    fieldelement.setInitValue( String.valueOf( intMethod++ ) );
                   
                    fieldelement.setType( Type.parse( "short" ) );
                   
                    fieldelement.setModifiers( Modifier.PRIVATE
                    + Modifier.FINAL + Modifier.STATIC );
                   
                    //oocalcaddinsdata.customized_innerclass.addField(
                    //fieldelement );
                    oocalcaddinsdata.getInnerClass().addField(
                    fieldelement );
                   
                    fieldelementFunctionNames.setInitValue(
                    fieldelementFunctionNames.getInitValue().substring( 0,
                    fieldelementFunctionNames.getInitValue().length() - 1 )
                    + ( ( intMethod == 1 ) ? "" : ",\n            " ) + "\""
                    + methoddescription.getMethodElement().getName().getName()
                    + "\"}" );
                   
                    // Insert display argument name.
                    MethodParameter[] methodparameter =
                    methoddescription.getMethodElement().getParameters();
                   
                    String stringCaseParameter =
                    /*
                    "                        case 0:\n"
                    + "                            stringReturn = \"(internal)\";\n"
                    + "                            break;\n";
                     */
                    "";
                   
                    for ( int intParameterCounter = 0;
                    intParameterCounter < methoddescription.getArgumentDescription().length;
                    intParameterCounter++ ) {
                        stringCaseParameter +=
                        "                        case "
                        //+ ( intParameterCounter + 1 ) + ":\n"
                        + intParameterCounter + ":\n"
                        + "                            stringReturn = \""
                        + methoddescription.getArgumentDescription()[ intParameterCounter ].getDisplayArgumentName()
                        + "\";\n"
                        + "                            break;\n";
                       
                    }
                   
                    String stringDisplayArgumentNameBody =
                    methodelementDisplayArgumentName.getBody();
                   
                    int intIndexCurlyBraceOpen =
                    stringDisplayArgumentNameBody.indexOf( "{" );
                   
                    stringDisplayArgumentNameBody =
                    stringDisplayArgumentNameBody.substring( 0,
                    intIndexCurlyBraceOpen + 1 )
                    + "\n                case short"
                    + methoddescription.getMethodElement().getName().getName().toUpperCase()
                    + ":\n"
                    + "                    switch( intArgument ) {\n"
                    + stringCaseParameter
                    + "                    }\n"
                    + "                    break;"
                    + stringDisplayArgumentNameBody.substring(
                    intIndexCurlyBraceOpen + 1 );
                   
                    methodelementDisplayArgumentName.setBody(
                    stringDisplayArgumentNameBody );
                   
                    // Insert argument description.
                    String stringCaseParameterDescription =
                    /*
                    "                        case 0:\n"
                    + "                            stringReturn = \"(internal)\";\n"
                    + "                            break;\n";
                     */
                    "";
                   
                    for ( int intParameterCounter = 0;
                    intParameterCounter < methoddescription.getArgumentDescription().length;
                    intParameterCounter++ ) {
                        stringCaseParameterDescription +=
                        "                        case "
                        //+ ( intParameterCounter + 1 ) + ":\n"
                        + intParameterCounter + ":\n"
                        + "                            stringReturn = \""
                        + methoddescription.getArgumentDescription()[ intParameterCounter ].getArgumentDescription()
                        + "\";\n"
                        + "                            break;\n";
                       
                    }
                   
                    String stringArgumentDescriptionBody =
                    methodelementArgumentDescription.getBody();
                   
                    intIndexCurlyBraceOpen =
                    stringArgumentDescriptionBody.indexOf( "{" );
                   
                    stringArgumentDescriptionBody =
                    stringArgumentDescriptionBody.substring( 0,
                    intIndexCurlyBraceOpen + 1 )
                    + "\n                case short"
                    + methoddescription.getMethodElement().getName().getName().toUpperCase()
                    + ":\n"
                    + "                    switch( intArgument ) {\n"
                    + stringCaseParameterDescription
                    + "                    }\n"
                    + "                    break;"
                    + stringArgumentDescriptionBody.substring(
                    intIndexCurlyBraceOpen + 1 );
                   
                    methodelementArgumentDescription.setBody(
                    stringArgumentDescriptionBody );
                   
                    // Insert display function names.
                    String stringDisplayFunctionNameBody =
                    methodelementDisplayFunctionName.getBody();
                   
                    intIndexCurlyBraceOpen =
                    stringDisplayFunctionNameBody.indexOf( "{" );
                   
                    stringDisplayFunctionNameBody =
                    stringDisplayFunctionNameBody.substring( 0,
                    intIndexCurlyBraceOpen + 1 )
                    + "\n                case short"
                    + methoddescription.getMethodElement().getName().getName().toUpperCase()
                    + ":\n"
                    + "                    stringReturn = \""
                    + methoddescription.getDisplayFunctionName()
                    + "\";\n"
                    + "                    break;"
                    + stringDisplayFunctionNameBody.substring(
                    intIndexCurlyBraceOpen + 1 );
                   
                    methodelementDisplayFunctionName.setBody(
                    stringDisplayFunctionNameBody );
                   
                    // Insert function description.
                    String stringFunctionDescriptionBody =
                    methodelementFunctionDescription.getBody();
                   
                    intIndexCurlyBraceOpen =
                    stringFunctionDescriptionBody.indexOf( "{" );
                   
                    stringFunctionDescriptionBody =
                    stringFunctionDescriptionBody.substring( 0,
                    intIndexCurlyBraceOpen + 1 )
                    + "\n                case short"
                    + methoddescription.getMethodElement().getName().getName().toUpperCase()
                    + ":\n"
                    + "                    stringReturn = \""
                    + methoddescription.getFunctionDescription()
                    + "\";\n"
                    + "                    break;"
                    + stringFunctionDescriptionBody.substring(
                    intIndexCurlyBraceOpen + 1 );
                   
                    methodelementFunctionDescription.setBody(
                    stringFunctionDescriptionBody );
                   
                    // Insert programmatic category name.
                    String stringCategoryNameBody =
                    methodelementCategoryName.getBody();
                   
                    intIndexCurlyBraceOpen =
                    stringCategoryNameBody.indexOf( "{" );
                   
                    stringCategoryNameBody =
                    stringCategoryNameBody.substring( 0,
                    intIndexCurlyBraceOpen + 1 )
                    + "\n                case short"
                    + methoddescription.getMethodElement().getName().getName().toUpperCase()
                    + ":\n"
                    + "                    stringReturn = \""
                    + methoddescription.getCategory()
                    + "\";\n"
                    + "                    break;"
                    + stringCategoryNameBody.substring(
                    intIndexCurlyBraceOpen + 1 );
                   
                    methodelementCategoryName.setBody(
                    stringCategoryNameBody );
                }
                catch( SourceException sourceexception ) {
                    // Show message.
                    TopManager.getDefault().notify(
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.