congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ElementUtils$AnnotationValueVisitorImpl
Code IndexAdd Tabnine to your IDE (free)

How to use
ElementUtils$AnnotationValueVisitorImpl
in
com.oracle.truffle.dsl.processor.java

Best Java code snippets using com.oracle.truffle.dsl.processor.java.ElementUtils$AnnotationValueVisitorImpl (Showing top 2 results out of 315)

origin: com.oracle.truffle/truffle-dsl-processor

public static <T> T resolveAnnotationValue(Class<T> expectedType, AnnotationValue value) {
  if (value == null) {
    return null;
  }
  Object unboxedValue = value.accept(new AnnotationValueVisitorImpl(), null);
  if (unboxedValue != null) {
    if (expectedType == TypeMirror.class && unboxedValue instanceof String) {
      return null;
    }
    if (!expectedType.isAssignableFrom(unboxedValue.getClass())) {
      throw new ClassCastException(unboxedValue.getClass().getName() + " not assignable from " + expectedType.getName());
    }
  }
  return expectedType.cast(unboxedValue);
}
origin: com.oracle/truffle-dsl-processor

@SuppressWarnings({"unchecked"})
private static <T> T resolveAnnotationValue(Class<T> expectedType, AnnotationValue value) {
  if (value == null) {
    return null;
  }
  Object unboxedValue = value.accept(new AnnotationValueVisitorImpl(), null);
  if (unboxedValue != null) {
    if (expectedType == TypeMirror.class && unboxedValue instanceof String) {
      return null;
    }
    if (!expectedType.isAssignableFrom(unboxedValue.getClass())) {
      throw new ClassCastException(unboxedValue.getClass().getName() + " not assignable from " + expectedType.getName());
    }
  }
  return (T) unboxedValue;
}
com.oracle.truffle.dsl.processor.javaElementUtils$AnnotationValueVisitorImpl

Most used methods

  • <init>

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • getApplicationContext (Context)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for WebStorm
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