예제 #1
0
  @Nullable
  public static String getJvmName(@NotNull Annotated annotated) {
    AnnotationDescriptor jvmNameAnnotation =
        getAnnotationByFqName(annotated.getAnnotations(), JVM_NAME);
    if (jvmNameAnnotation == null) return null;

    Map<ValueParameterDescriptor, ConstantValue<?>> arguments =
        jvmNameAnnotation.getAllValueArguments();
    if (arguments.isEmpty()) return null;

    ConstantValue<?> name = arguments.values().iterator().next();
    if (!(name instanceof StringValue)) return null;

    return ((StringValue) name).getValue();
  }
예제 #2
0
 @Nullable
 public static AnnotationDescriptor getSynchronizedAnnotation(@NotNull Annotated annotated) {
   return getAnnotationByFqName(annotated.getAnnotations(), SYNCHRONIZED);
 }
예제 #3
0
 @Nullable
 public static AnnotationDescriptor getVolatileAnnotation(@NotNull Annotated annotated) {
   return getAnnotationByFqName(annotated.getAnnotations(), VOLATILE);
 }
예제 #4
0
 @Nullable
 public static AnnotationDescriptor getJvmNameAnnotation(@NotNull Annotated annotated) {
   return getAnnotationByFqName(annotated.getAnnotations(), JVM_NAME);
 }