package com.redhat.ceylon.compiler.java.metadata;

import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/** 
 * Annotates the class containing an annotation constructor method
 * (i.e. adjacent to {@link Method @Method}) 
 * as being a trivial instantiation of an annotation class. 
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface AnnotationInstantiation {
    /** 
     * The annotation class (not the annotation type for that class) 
     * that the annotation constructor instantiates 
     */
    // TODO This might not be needed
    java.lang.Class<?> annotationClass();
    
    // TODO Can also support a constructor which returns a value using some 
    // other annotation @AnnotationValue
    /** 
     * A permutation of the annotation constructor parameters which produces the 
     * argument list for the instantiation of the annotation class.
     */
    short[] arguments() default {};
}

@@ -268,29 +268,8 @@
 tes 
-the class containing 
 an a
@@ -297,16 +297,16 @@
  method%0A
+
  * (i.e.
@@ -452,16 +452,17 @@
 @Target(
+%7B
 ElementT
@@ -469,16 +469,37 @@
 ype.TYPE
+, ElementType.METHOD%7D
 )%0Apublic
@@ -894,16 +894,19 @@
 %0A     * 
+%3Cp%3E
 A permut
@@ -1039,16 +1039,299 @@
 n class.
+%3C/p%3E%0A     * %3Ctable%3E%3Ctbody%3E%0A     * %3Ctr%3E%3Ctd%3E-32768%3C/td%3E  %3Ctd%3Eint, char, boolean, float or String literal%3C/td%3E%3C/tr%3E%0A     * %3Ctr%3E%3Ctd%3E0-255%3C/td%3E   %3Ctd%3Ethe corresponding parameter%3C/td%3E%3C/tr%3E%0A     * %3Ctr%3E%3Ctd%3E256-511%3C/td%3E %3Ctd%3Ethe corresponding parameter spread%3C/td%3E%3C/tr%3E%0A     * %3C/tbody%3E%3C/table%3E
 %0A     */

Change the @Target elements of @AnnotationInstantiation so we can annotation default parameter methods with @AnnotationInstantiation if they invoke annotation classes or constructors. See ceylon/ceylon-compiler#1221.