Tabnine Logo
IType.getMethods
Code IndexAdd Tabnine to your IDE (free)

How to use
getMethods
method
in
org.eclipse.jdt.core.IType

Best Java code snippets using org.eclipse.jdt.core.IType.getMethods (Showing top 20 results out of 315)

origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Finds a method in a type.
 * This searches for a method with the same name and signature. Parameter types are only
 * compared by the simple name, no resolving for the fully qualified type name is done
 * @param method
 * @param type
 * @return The first found method or null, if nothing found
 * @throws JavaModelException
 */
public static IMethod findSimilarMethod(IMethod method, IType type) throws JavaModelException {
  return findSimilarMethod(method, type.getMethods());
}
origin: org.eclipse/org.eclipse.jst.j2ee.ejb.annotations.emitter

private IMethod[] getTypeMethods(IType type, Set handleIds) throws JavaModelException {
  ArrayList newMethods = new ArrayList();
  IMethod[] typeMethods;
  typeMethods = type.getMethods();
  for (int index = 0; index < typeMethods.length; index++)
    if (!handleIds.contains(typeMethods[index].getHandleIdentifier()))
      newMethods.add(typeMethods[index]);
  IMethod[] methods = new IMethod[newMethods.size()];
  newMethods.toArray(methods);
  return methods;
}
origin: stackoverflow.com

 for (ICompilationUnit unit : mypackage.getCompilationUnits()) {
IType[] types = unit.getTypes();
for (int i = 0; i < types.length; i++) {
 IType type = types[i];
 IMethod[] methods = type.getMethods();
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private static boolean isTaggingInterface(TType interf) {
  if (interf instanceof HierarchyType) {
    try {
      return ((HierarchyType) interf).getJavaElementType().getMethods().length == 0;
    } catch (JavaModelException e) {
      // assume it's not
    }
  }
  return false;
}
origin: stackoverflow.com

 for (ICompilationUnit unit : mypackage.getCompilationUnits()) {
  IType primary = unit.findPrimaryType();
  IMethod[] methods = primary.getMethods();
  int i = 1;
  for (IMethod method : methods) {
    if (method.isConstructor()) {
      continue;
    }
  makeChangetoMethods(status, method,"changedMethodVersion_" + i);
  ++i;
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private static boolean isTaggingInterface(TType interf) {
  if (interf instanceof HierarchyType) {
    try {
      return ((HierarchyType) interf).getJavaElementType().getMethods().length == 0;
    } catch (JavaModelException e) {
      // assume it's not
    }
  }
  return false;
}
origin: org.eclipse/org.eclipse.jdt.ui

public static IMethod[] getAllConstructors(IType type) throws JavaModelException {
  if (JavaModelUtil.isInterfaceOrAnnotation(type))
    return new IMethod[0];
  List result= new ArrayList();
  IMethod[] methods= type.getMethods();
  for (int i= 0; i < methods.length; i++) {
    IMethod iMethod= methods[i];
    if (iMethod.isConstructor())
      result.add(iMethod);
  }
  return (IMethod[]) result.toArray(new IMethod[result.size()]);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public static IMethod[] getAllConstructors(IType type) throws JavaModelException {
  if (JavaModelUtil.isInterfaceOrAnnotation(type))
    return new IMethod[0];
  List<IMethod> result= new ArrayList<>();
  IMethod[] methods= type.getMethods();
  for (int i= 0; i < methods.length; i++) {
    IMethod iMethod= methods[i];
    if (iMethod.isConstructor())
      result.add(iMethod);
  }
  return result.toArray(new IMethod[result.size()]);
}
origin: org.eclipse/org.eclipse.jdt.ui

private void addCompatibleMethods(IMethod filterMethod, IType typeToFindIn, List children) throws JavaModelException {
  boolean filterMethodOverrides= initializeMethodOverrideTester(filterMethod, typeToFindIn);
  IMethod[] methods= typeToFindIn.getMethods();
  for (int i= 0; i < methods.length; i++) {
    IMethod curr= methods[i];
    if (isCompatibleMethod(filterMethod, curr, filterMethodOverrides) && !children.contains(curr)) {
      children.add(curr);
    }
  }
}

origin: org.eclipse/org.eclipse.jdt.ui

private boolean classesDeclareOverridingNativeMethod(IType[] classes) throws CoreException {
  for (int i= 0; i < classes.length; i++){
    IMethod[] methods= classes[i].getMethods();
    for (int j= 0; j < methods.length; j++){
      if ((!methods[j].equals(getMethod()))
        && (JdtFlags.isNative(methods[j]))
        && (null != Checks.findSimilarMethod(getMethod(), new IMethod[]{methods[j]})))
          return true;
    }
  }
  return false;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private boolean classesDeclareOverridingNativeMethod(IType[] classes) throws CoreException {
  for (int i= 0; i < classes.length; i++){
    IMethod[] methods= classes[i].getMethods();
    for (int j= 0; j < methods.length; j++){
      if ((!methods[j].equals(getMethod()))
        && (JdtFlags.isNative(methods[j]))
        && (null != Checks.findSimilarMethod(getMethod(), new IMethod[]{methods[j]})))
          return true;
    }
  }
  return false;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private boolean classesDeclareOverridingNativeMethod(IType[] classes) throws CoreException {
  for (int i= 0; i < classes.length; i++){
    IMethod[] methods= classes[i].getMethods();
    for (int j= 0; j < methods.length; j++){
      if ((!methods[j].equals(getMethod()))
        && (JdtFlags.isNative(methods[j]))
        && (null != Checks.findSimilarMethod(getMethod(), new IMethod[]{methods[j]})))
          return true;
    }
  }
  return false;
}
origin: eclipse/eclipse.jdt.ls

private RefactoringStatus checkForMethodsWithConstructorNames() throws CoreException {
  IMethod[] methods = fType.getMethods();
  for (int i = 0; i < methods.length; i++) {
    if (methods[i].isConstructor()) {
      continue;
    }
    RefactoringStatus check = Checks.checkIfConstructorName(methods[i], methods[i].getElementName(), getNewElementName());
    if (check != null) {
      return check;
    }
  }
  return null;
}
origin: org.eclipse/org.eclipse.jdt.ui

/**
 * Finds a method in a type.
 * Searches for a method with the same name and the same parameter count.
 * Parameter types are <b>not</b> compared.
 * @param method
 * @param type
 * @return The first found method or null, if nothing found
 * @throws JavaModelException
 */
public static IMethod findMethod(IMethod method, IType type) throws JavaModelException {
  return findMethod(method.getElementName(), method.getParameterTypes().length, method.isConstructor(), type.getMethods());
}
origin: org.eclipse.jdt/org.eclipse.jdt.core.manipulation

/**
 * Finds a method in a type.
 * Searches for a method with the same name and the same parameter count.
 * Parameter types are <b>not</b> compared.
 * @param method
 * @param type
 * @return The first found method or null, if nothing found
 * @throws JavaModelException
 */
public static IMethod findMethod(IMethod method, IType type) throws JavaModelException {
  return findMethod(method.getElementName(), method.getParameterTypes().length, method.isConstructor(), type.getMethods());
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Finds a method in a type.
 * Searches for a method with the same name and the same parameter count.
 * Parameter types are <b>not</b> compared.
 * @param method
 * @param type
 * @return The first found method or null, if nothing found
 * @throws JavaModelException
 */
public static IMethod findMethod(IMethod method, IType type) throws JavaModelException {
  return findMethod(method.getElementName(), method.getParameterTypes().length, method.isConstructor(), type.getMethods());
}
origin: org.eclipse/org.eclipse.jdt.ui

private static Integer[] createOffsetArray(IType[] types) throws JavaModelException {
  List result= new ArrayList();
  for (int i= 0; i < types.length; i++) {
    IType iType= types[i];
    addOffset(result, iType.getNameRange().getOffset());
    addOffset(result, iType.getSourceRange().getOffset() + iType.getSourceRange().getLength());
    addMemberOffsetList(result, iType.getMethods());
    addMemberOffsetList(result, iType.getFields());
    addMemberOffsetList(result, iType.getInitializers());
  }
  return (Integer[]) result.toArray(new Integer[result.size()]);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private static Integer[] createOffsetArray(IType[] types) throws JavaModelException {
  List<Integer> result= new ArrayList<>();
  for (int i= 0; i < types.length; i++) {
    IType iType= types[i];
    addOffset(result, iType.getNameRange().getOffset());
    addOffset(result, iType.getSourceRange().getOffset() + iType.getSourceRange().getLength());
    addMemberOffsetList(result, iType.getMethods());
    addMemberOffsetList(result, iType.getFields());
    addMemberOffsetList(result, iType.getInitializers());
  }
  return result.toArray(new Integer[result.size()]);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public static RefactoringStatus checkForMainAndNativeMethods(IType type) throws JavaModelException {
  RefactoringStatus result= new RefactoringStatus();
  result.merge(checkForMainAndNativeMethods(type.getMethods()));
  result.merge(checkForMainAndNativeMethods(type.getTypes()));
  return result;
}
origin: org.eclipse/org.eclipse.jdt.ui

public static RefactoringStatus checkForMainAndNativeMethods(IType type) throws JavaModelException {
  RefactoringStatus result= new RefactoringStatus();
  result.merge(checkForMainAndNativeMethods(type.getMethods()));
  result.merge(checkForMainAndNativeMethods(type.getTypes()));
  return result;
}

org.eclipse.jdt.coreITypegetMethods

Javadoc

Returns the methods and constructors declared by this type. For binary types, this may include the special <clinit> method and synthetic methods.

The results are listed in the order in which they appear in the source or class file.

Popular methods of IType

  • getFullyQualifiedName
    Returns the fully qualified name of this type, including qualification for any containing types and
  • getElementName
    Returns the simple name of this type, unqualified by package or enclosing type. This is a handle-onl
  • getFlags
  • getPackageFragment
    Returns the package fragment in which this element is defined. This is a handle-only method.
  • getCompilationUnit
  • newSupertypeHierarchy
    Creates and returns a type hierarchy for this type containing this type and all of its supertypes, c
  • exists
  • getJavaProject
  • isInterface
    Returns whether this type represents an interface. Note that an interface can also be an annotation
  • getDeclaringType
  • getMethod
    Returns the method with the specified name and parameter types in this type (for example, "foo", {"I
  • getParent
  • getMethod,
  • getParent,
  • isClass,
  • getSourceRange,
  • newTypeHierarchy,
  • isAnonymous,
  • isBinary,
  • getResource,
  • getTypeParameters

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JComboBox (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now