Package org.eclipse.jdt.internal.compiler.classfmt

Examples of org.eclipse.jdt.internal.compiler.classfmt.MethodInfo


      // first reference all methods declarations and field declarations
      MethodInfo[] methods = (MethodInfo[]) reader.getMethods();
      boolean noConstructor = true;
      if (methods != null) {
        for (int i = 0, max = methods.length; i < max; i++) {
          MethodInfo method = methods[i];
          boolean isConstructor = method.isConstructor();
          char[] descriptor = method.getMethodDescriptor();
          char[][] parameterTypes = decodeParameterTypes(descriptor, isConstructor && isNestedType);
          char[] returnType = decodeReturnType(descriptor);
          char[][] exceptionTypes = replace('/', '.', method.getExceptionTypeNames());
          if (isConstructor) {
            noConstructor = false;
            char[] signature = method.getGenericSignature();
            if (signature == null) {
              if (reader.isNestedType() && ((modifiers & ClassFileConstants.AccStatic) == 0)) {
                signature = removeFirstSyntheticParameter(descriptor);
              } else {
                signature = descriptor;
              }
            }
            addConstructorDeclaration(
                name,
                parameterTypes == null ? 0 : parameterTypes.length,
                signature, 
                parameterTypes,
                method.getArgumentNames(),
                method.getModifiers(),
                packageName,
                modifiers,
                exceptionTypes,
                extraFlags);
          } else {
            if (!method.isClinit()) {
              addMethodDeclaration(method.getSelector(), parameterTypes, returnType, exceptionTypes);
            }
          }
          // look for references in method annotations
          annotations = method.getAnnotations();
          if (annotations != null) {
            for (int a=0, length=annotations.length; a<length; a++) {
              IBinaryAnnotation annotation = annotations[a];
              addBinaryAnnotation(annotation);
            }
          }
          tagBits = method.getTagBits() & TagBits.AllStandardAnnotationsMask;
          if (tagBits != 0) {
            addBinaryStandardAnnotations(tagBits);
          }
        }
      }
View Full Code Here


  // Look for references in methods annotations
  MethodInfo[] methods = (MethodInfo[]) binaryType.getMethods();
  if (methods != null) {
    for (int i = 0, max = methods.length; i < max; i++) {
      MethodInfo method = methods[i];
      if (checkAnnotations(typeReferencePattern, method.getAnnotations(), method.getTagBits())) {
          binaryTypeBinding = locator.cacheBinaryType(classFileBinaryType, binaryType);
          IMethod methodHandle = classFileBinaryType.getMethod(
            new String(method.isConstructor() ? binaryTypeBinding.compoundName[binaryTypeBinding.compoundName.length-1] : method.getSelector()),
            CharOperation.toStrings(Signature.getParameterTypes(convertClassFileFormat(method.getMethodDescriptor()))));
          TypeReferenceMatch match = new TypeReferenceMatch(methodHandle, SearchMatch.A_ACCURATE, -1, 0, false, locator.getParticipant(), locator.currentPossibleMatch.resource);
          // TODO 3.4 M7 (frederic) - bug 209996: see how create the annotation handle from the binary and put it in the local element
          match.setLocalElement(null);
          locator.report(match);
      }
View Full Code Here

      // first reference all methods declarations and field declarations
      MethodInfo[] methods = (MethodInfo[]) reader.getMethods();
      boolean noConstructor = true;
      if (methods != null) {
        for (int i = 0, max = methods.length; i < max; i++) {
          MethodInfo method = methods[i];
          boolean isConstructor = method.isConstructor();
          char[] descriptor = method.getMethodDescriptor();
          char[][] parameterTypes = decodeParameterTypes(descriptor, isConstructor && isNestedType);
          char[] returnType = decodeReturnType(descriptor);
          char[][] exceptionTypes = replace('/', '.', method.getExceptionTypeNames());
          if (isConstructor) {
            noConstructor = false;
            char[] signature = method.getGenericSignature();
            if (signature == null) {
              if (reader.isNestedType() && ((modifiers & ClassFileConstants.AccStatic) == 0)) {
                signature = removeFirstSyntheticParameter(descriptor);
              } else {
                signature = descriptor;
              }
            }
            addConstructorDeclaration(
                name,
                parameterTypes == null ? 0 : parameterTypes.length,
                signature, 
                parameterTypes,
                method.getArgumentNames(),
                method.getModifiers(),
                packageName,
                modifiers,
                exceptionTypes,
                extraFlags);
          } else {
            if (!method.isClinit()) {
              addMethodDeclaration(method.getSelector(), parameterTypes, returnType, exceptionTypes);
            }
          }
          // look for references in method annotations
          annotations = method.getAnnotations();
          if (annotations != null) {
            for (int a=0, length=annotations.length; a<length; a++) {
              IBinaryAnnotation annotation = annotations[a];
              addBinaryAnnotation(annotation);
            }
          }
          tagBits = method.getTagBits() & TagBits.AllStandardAnnotationsMask;
          if (tagBits != 0) {
            addBinaryStandardAnnotations(tagBits);
          }
        }
      }
View Full Code Here

  // Look for references in methods annotations
  MethodInfo[] methods = (MethodInfo[]) binaryType.getMethods();
  if (methods != null) {
    for (int i = 0, max = methods.length; i < max; i++) {
      MethodInfo method = methods[i];
      if (checkAnnotations(typeReferencePattern, method.getAnnotations(), method.getTagBits())) {
          binaryTypeBinding = locator.cacheBinaryType(classFileBinaryType, binaryType);
          IMethod methodHandle = classFileBinaryType.getMethod(
            new String(method.isConstructor() ? binaryTypeBinding.compoundName[binaryTypeBinding.compoundName.length-1] : method.getSelector()),
            CharOperation.toStrings(Signature.getParameterTypes(convertClassFileFormat(method.getMethodDescriptor()))));
          TypeReferenceMatch match = new TypeReferenceMatch(methodHandle, SearchMatch.A_ACCURATE, -1, 0, false, locator.getParticipant(), locator.currentPossibleMatch.resource);
          // TODO 3.4 M7 (frederic) - bug 209996: see how create the annotation handle from the binary and put it in the local element
          match.setLocalElement(null);
          locator.report(match);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.classfmt.MethodInfo

Copyright © 2018 www.massapicom. 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.