示例#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);
 }