コード例 #1
0
ファイル: DescriptorUtils.java プロジェクト: rlugojr/kotlin
  @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
ファイル: DescriptorUtils.java プロジェクト: rlugojr/kotlin
 @Nullable
 public static AnnotationDescriptor getSynchronizedAnnotation(@NotNull Annotated annotated) {
   return getAnnotationByFqName(annotated.getAnnotations(), SYNCHRONIZED);
 }
コード例 #3
0
ファイル: DescriptorUtils.java プロジェクト: rlugojr/kotlin
 @Nullable
 public static AnnotationDescriptor getVolatileAnnotation(@NotNull Annotated annotated) {
   return getAnnotationByFqName(annotated.getAnnotations(), VOLATILE);
 }
コード例 #4
0
ファイル: DescriptorUtils.java プロジェクト: rlugojr/kotlin
 @Nullable
 public static AnnotationDescriptor getJvmNameAnnotation(@NotNull Annotated annotated) {
   return getAnnotationByFqName(annotated.getAnnotations(), JVM_NAME);
 }