Пример #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);
 }