Tabnine Logo
JavaParser$ResolvedMethod.getArgumentType
Code IndexAdd Tabnine to your IDE (free)

How to use
getArgumentType
method
in
com.android.tools.lint.client.api.JavaParser$ResolvedMethod

Best Java code snippets using com.android.tools.lint.client.api.JavaParser$ResolvedMethod.getArgumentType (Showing top 11 results out of 315)

origin: com.android.tools.lint/lint

boolean matches = true;
for (int i = 0, n = method.getArgumentCount(); i < n; i++) {
  String parameterType = method.getArgumentType(i).getSignature();
  int length = parameterType.indexOf('<');
  if (length == -1) {
origin: com.amazon.device.tools.lint/lint-checks

  private static boolean overridesIsValidFragment(ResolvedClass resolvedClass) {
    Iterable<ResolvedMethod> resolvedMethods = resolvedClass.getMethods(IS_VALID_FRAGMENT,
        false);
    for (ResolvedMethod resolvedMethod : resolvedMethods) {
      if (resolvedMethod.getArgumentCount() == 1
          && resolvedMethod.getArgumentType(0).getName().equals(TYPE_STRING)) {
        return true;
      }
    }
    return false;
  }
}
origin: com.amazon.device.tools.lint/lint-checks

int tagArgumentIndex = PRINTLN.equals(name) ? 1 : 0;
if (method.getArgumentCount() > tagArgumentIndex
    && method.getArgumentType(tagArgumentIndex).matchesSignature(TYPE_STRING)
    && node.astArguments().size() == method.getArgumentCount()) {
  Iterator<Expression> iterator = node.astArguments().iterator();
origin: com.amazon.device.tools.lint/lint-checks

  continue; // Wrong signature
if (!method.getArgumentType(0).matchesName(STATUS_BAR_NOTIFICATION_FQN)) {
  continue;
origin: com.android.tools.lint/lint-api

if (!method.getArgumentType(arg).equals(getArgumentType(arg))) {
  sameTypes = false;
  break;
origin: com.amazon.device.tools.lint/lint-checks

  && method.getArgumentType(0).matchesSignature(TYPE_STRING)
  && node.astArguments().size() == method.getArgumentCount()) {
Iterator<Expression> iterator = node.astArguments().iterator();
origin: com.amazon.device.tools.lint/lint-checks

  @Override
  public void visitMethod(@NonNull JavaContext context, @Nullable AstVisitor visitor,
      @NonNull MethodInvocation node) {
    // Ignore the issue if we never build for any API less than 17.
    if (context.getMainProject().getMinSdk() >= 17) {
      return;
    }

    // Ignore if the method doesn't fit our description.
    ResolvedNode resolved = context.resolve(node);
    if (!(resolved instanceof ResolvedMethod)) {
      return;
    }
    ResolvedMethod method = (ResolvedMethod) resolved;
    if (!method.getContainingClass().isSubclassOf(WEB_VIEW, false)) {
      return;
    }
    if (method.getArgumentCount() != 2
        || !method.getArgumentType(0).matchesName(TYPE_OBJECT)
        || !method.getArgumentType(1).matchesName(TYPE_STRING)) {
      return;
    }

    String message = "`WebView.addJavascriptInterface` should not be called with minSdkVersion < 17 for security reasons: " +
             "JavaScript can use reflection to manipulate application";
    context.report(ISSUE, node, context.getLocation(node.astName()), message);
  }
}
origin: com.amazon.device.tools.lint/lint-checks

private static boolean isXmlConstructor(ResolvedMethod method) {
  // Accept
  //   android.content.Context
  //   android.content.Context,android.util.AttributeSet
  //   android.content.Context,android.util.AttributeSet,int
  int argumentCount = method.getArgumentCount();
  if (argumentCount == 0 || argumentCount > 3) {
    return false;
  }
  if (!method.getArgumentType(0).matchesName(CLASS_CONTEXT)) {
    return false;
  }
  if (argumentCount == 1) {
    return true;
  }
  if (!method.getArgumentType(1).matchesName(CLASS_ATTRIBUTE_SET)) {
    return false;
  }
  //noinspection SimplifiableIfStatement
  if (argumentCount == 2) {
    return true;
  }
  return method.getArgumentType(2).matchesName("int");
}
origin: com.amazon.device.tools.lint/lint-checks

  private static boolean specifiesLocale(@NonNull ResolvedMethod method) {
    for (int i = 0, n = method.getArgumentCount(); i < n; i++) {
      TypeDescriptor argumentType = method.getArgumentType(i);
      if (argumentType.matchesSignature(LOCALE_CLS)) {
        return true;
      }
    }
    return false;
  }
}
origin: com.android.tools.lint/lint-api

/** Returns true if the parameter at the given index matches the given type signature */
public boolean argumentMatchesType(int index, @NonNull String signature) {
  return getArgumentType(index).matchesSignature(signature);
}
origin: com.amazon.device.tools.lint/lint-checks

  private static boolean hasLooperConstructorParameter(@NonNull ResolvedClass cls) {
    for (ResolvedMethod constructor : cls.getConstructors()) {
      for (int i = 0, n = constructor.getArgumentCount(); i < n; i++) {
        TypeDescriptor type = constructor.getArgumentType(i);
        if (type.matchesSignature(LOOPER_CLS)) {
          return true;
        }
      }
    }
    return false;
  }
}
com.android.tools.lint.client.apiJavaParser$ResolvedMethodgetArgumentType

Popular methods of JavaParser$ResolvedMethod

  • getContainingClass
  • getArgumentCount
  • getName
  • isConstructor
  • getModifiers
  • getParameterAnnotations
    Returns any annotations defined on the given parameter of this method
  • getReturnType
  • getAnnotation
  • getAnnotations
  • getSuperMethod
    Returns the super implementation of the given method, if any

Popular in Java

  • Start an intent from android
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • ImageIO (javax.imageio)
  • Option (scala)
  • Top plugins for Android Studio
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